Not sure how useful it is, but it's something! Wrote a little function
to wrap `vmstat` and got it working on OSX and linux.
https://github.com/joshelser/calcite/commit/01980a96acab47be2692d188ece2a6fa6bec08ae
Would be happy to see it land in Calcite, either with your commit,
Julian, or I can do it after.
On 7/25/17 11:32 AM, Josh Elser wrote:
I (think?) I have some free time, so let me play around with this today :)
On 7/25/17 3:13 AM, Julian Hyde wrote:
I had an idea last week and implemented it quickly over the weekend.
You know how bash hackers write pipelines of operations like grep,
sort, uniq, sed? Those are basically relational operations, but the
pipelines are difficult to write because you’re dealing with
space-separated strings. So, my idea was to allow people to write the
same pipelines using SQL. Which meant making SQL easily available from
the command line, and making the data sources of those operations
(shell commands such as du, ps, git log) available as tables.
I call this the OS adapter, and the script that launches SQL from the
command line is sqlsh. To find the 5 most prolific committers you’d type
$ git log | grep Author: | sort | uniq -c | sort -nr | head -5
and now you can instead type
$ ./sqlsh select author, count\(\*\) from git_commits group by 1 order
by 2 desc limit 5
and Calcite reads from the same data source and executes the query
using its operators.
It’s ready to commit. Can someone please review
https://issues.apache.org/jira/browse/CALCITE-1896
<https://issues.apache.org/jira/browse/CALCITE-1896>?
It would be great to get contributions to this. Adding new data
sources (/etc/passwd, netstat, the file system, apt, the maven repo)
should be fairly straightforward.
Julian