Return a single object for single-col enumerator

Optiq expects that an enumerator of a single column returns the
single value of that column, and not an array with length 1.
The CsvEnumerator is changed to be generically typed as Object
instead of Object[], and return a single object when only a single
column is being read.
3 files changed
tree: 62e4c1e7ab91a859bc19e576882f4e0eaa0bac72
  1. src/
  2. .gitignore
  3. .travis.yml
  4. HISTORY.md
  5. LICENSE
  6. NOTICE
  7. pom.xml
  8. README.md
  9. sqlline
  10. TUTORIAL.md
README.md

Build Status

optiq-csv

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.

Download and build

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

Kick the tires

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.

More information