commit | 48da40619450ca58a59b1f0415f9802aa8ddb0d8 | [log] [tgz] |
---|---|---|
author | Julian Hyde <julianhyde@gmail.com> | Fri Mar 21 15:31:39 2014 -0700 |
committer | Julian Hyde <julianhyde@gmail.com> | Fri Mar 21 15:31:39 2014 -0700 |
tree | 7b736c3e7fc94f049e0f097d2371157e2c7435cd | |
parent | f1c415b3f84ddcae8cf1b60c466cf439189cdc5a [diff] |
Use build-classpath on bash (including cygwin); native windows still uses copy-dependencies.
Optiq adapter that reads CSV files.
Optiq-csv is a nice simple example of how to connect Optiq to your own data source and quickly get a full SQL/JDBC interface.
You need Java (1.6 or higher; 1.7 preferred), git and maven (3.0.4 or later).
$ git clone git://github.com/julianhyde/optiq-csv.git $ cd optiq-csv $ mvn compile
Let‘s take a quick look at optiq-csv’s (and optiq‘s) features. We’ll use sqlline, a SQL shell that connects to any JDBC data source and is included with optiq-csv.
Connect to Optiq and try out some queries:
$ ./sqlline sqlline> !connect jdbc:optiq:model=target/test-classes/model.json admin admin sqlline> !tables sqlline> !describe emps sqlline> SELECT * FROM emps; sqlline> EXPLAIN PLAN FOR SELECT * FROM emps; sqlline> !connect jdbc:optiq:model=target/test-classes/smart.json admin admin sqlline> EXPLAIN PLAN FOR SELECT * FROM emps; sqlline> SELECT depts.name, count(*) . . . .> FROM emps JOIN depts USING (deptno) . . . .> GROUP BY depts.name; sqlline> VALUES char_length('hello, ' || 'world!'); sqlline> !quit
(On Windows, the command is sqlline.bat
.)
As you can see, Optiq has a full SQL implementation that can efficiently query any data source.
For a more leisurely walk through what Optiq can do and how it does it, try the Tutorial.