Live data from Hacker News

Q – Execute SQL on text. Supports joins across files, RPM available

github.com

31–40 of 46 posts

Re: Q – Execute SQL on text. Supports joins across files, RPM available

#31
post #2

It's written in Python, and seems to use SQLite under the hood. I guess it just applies tokenization and throws the text into a temporary database. Quite similar to the Go project https://github.com/dinedal/textql , at least superficially.

A lot of similar tools were discussed when that Go project came up 3 weeks ago:

https://news.ycombinator.com/item?id=7175830

  > MS ADO / ODBC
  > Perl DBI
  > npm j (with jqa)
  > Ruby (csv2sqlite) 
  > Python (csvkit)
  > Go (textql, comp)
  > Java (optiq, openrefine, H2 SQL)
  > R (sqldf)
  > Haskell (txt-sushi)
  > XML (xmlstarlet, xmllint, xmlstar)
  > HTML (HtmlAgilityPack, Chrome $x())
  > Postgres file_fdw
  > Oracle external tables
  > SQL Server OPENDATASOURCE and OPENQUERY
  > Log file viewers (MS LogParser, Apache asql, lnav)

Re: Q – Execute SQL on text. Supports joins across files, RPM available

#33

Don't join ( https://en.wikipedia.org/wiki/Join_%28Unix%29 ), sed, and grep get you most of the way there?

Hi, I'm q's creator, Harel Ben-Attia.

The Linux toolset is really great, and I use it extensively. The whole idea of the tool is not to replace any of the existing tools, but to extend the toolset to concepts which treat text as data. In a way, it's a metatool which provides an easy and familiar way to add more data processing concepts to the linux toolset. There are many cases where I use 'wc -l' in order to count rows in a file, but if i need to count the rows of only the ones which have a specific column which is larger than the value X, or get the sum of some column per group, then q is a simple and readable way to do it properly, without any need for "tricks".

My rationale for creating it is also explained in the README of the github project.

Any more comments are most welcome.

Harel

Re: Q – Execute SQL on text. Supports joins across files, RPM available

#34
post #31
post #2

It's written in Python, and seems to use SQLite under the hood. I guess it just applies tokenization and throws the text into a temporary database. Quite similar to the Go project https://github.com/dinedal/textql , at least superficially.

A lot of similar tools were discussed when that Go project came up 3 weeks ago: https://news.ycombinator.com/item?id=7175830 > MS ADO / ODBC > Perl DBI > npm j (with jqa) > Ruby (csv2sqlite) > Python (csvkit) > Go (textql, comp) > Java (optiq, openrefine, H2 SQL) > R (sqldf) > Haskell (txt-sushi) > XML (xmlstarlet, xmllint, xmlstar) > HTML (HtmlAgilityPack, Chrome $x()) > Postgres file_fdw > Oracle external tables >…

Hi, I'm q's creator, Harel.

There are obviously lots of other software which can provide a similar capability, and while I haven't checked all of them out, I'm really believe that most of them do a great job. However, my rationale for creating this tool was to provide a seamless addition to the Linux command line toolset - A tool as most Linux commands are, and not a capability. The distinction I'm doing here is that tools are reusable, composable and such, vs a capability which is usually less reusable in different contexts. I'm sure that some of the above are definitely tools. I just hope that the tool I have created provides value to people and helps them with their tasks.

As I posted here elsewhere, my complete rationale for creating the tool is available on the README of the github project. Comments and issues are most welcome.

Harel Ben-Attia

Re: Q – Execute SQL on text. Supports joins across files, RPM available

#35
post #13

Earlier quoted context omitted.

And the JS promise library in turn collided with the name of Q, the array-processing language, which itself collided with the name of another programming language named Q ( http://q-lang.sourceforge.net ). If you're naming a tech-related thing after about 1980, the single-letter names are all taken...

Haha, well fair enough - even more reason to have checked I suppose. Maybe textQ would be more appropriate given this project's use case?

Funny enough, another commenter mentioned a similar project in Go called "TextQL."

https://news.ycombinator.com/item?id=7290739

https://github.com/dinedal/textql

Re: Q – Execute SQL on text. Supports joins across files, RPM available

#38
Why limit available data around the senseless syntax of a query language? Linux commands are much faster and way more easier to use / reuse via a bash script. Modifying an enormous SQL command is going to be a maintenance nightmare. Especially in a few years, when the SQL DBA will basically be extinct.

Re: Q – Execute SQL on text. Supports joins across files, RPM available

#39

Earlier quoted context omitted.

I'm probably heavily biased, but to me Perl is the best command-line regex tool. Perl was invented to gather data and report on it, and its regex engine is incredibly fast and powerful. As an added bonus it supports some Python and PCRE-specific extensions. But this Q app is useful for people who either don't know Perl or can get what they need done faster with SQL than with scripting. In terms of 'verbosity' you can…

> As an added bonus it supports some Python and PCRE-specific extensions. This is a bit of a strange thing to say, since nearly all of the advanced regex features showed up in Perl first . PCRE stands for "Perl-compliant regular expressions," so there's certainly no extensions there that didn't originally come from Perl. I'm less sure about Python, but I get the sense that they borrow from Perl regular expressions as…

http://perldoc.perl.org/perlre.html#PCRE/Python-Support

  PCRE/Python Support
  
  As of Perl 5.10.0, Perl supports several Python/PCRE-specific extensions to the
  regex syntax. While Perl programmers are encouraged to use the Perl-specific
  syntax, the following are also accepted:
  
      (?Ppattern)
      Define a named capture group. Equivalent to (?pattern).
  
      (?P=NAME)
      Backreference to a named capture group. Equivalent to \g{NAME} .
  
      (?P>NAME)
      Subroutine call to a named capture group. Equivalent to (?&NAME).
Post reply on HN