commit | 0f9a71c971e158aaa97e628aa1c7060711e3ca93 | [log] [tgz] |
---|---|---|
author | julianhyde <julianhyde@gmail.com> | Mon Jan 06 17:19:16 2014 -0800 |
committer | julianhyde <julianhyde@gmail.com> | Mon Jan 06 17:19:16 2014 -0800 |
tree | 52ed9ea0984cabe7dd7e66d866252f040a35fa01 | |
parent | 1ba31f6f183ddf8abe985891d7affa7fa2f79f84 [diff] |
Use new methods for building trees of rule operands.
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.5 or higher; 1.7 preferred), git and maven (2 or higher).
$ 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
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.