You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by vl...@apache.org on 2014/11/23 17:53:17 UTC

incubator-calcite git commit: [CALCITE-469] Update example/csv README.md instructions

Repository: incubator-calcite
Updated Branches:
  refs/heads/master b8a6b1e36 -> 539253562


[CALCITE-469] Update example/csv README.md instructions


Project: http://git-wip-us.apache.org/repos/asf/incubator-calcite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-calcite/commit/53925356
Tree: http://git-wip-us.apache.org/repos/asf/incubator-calcite/tree/53925356
Diff: http://git-wip-us.apache.org/repos/asf/incubator-calcite/diff/53925356

Branch: refs/heads/master
Commit: 539253562067dcea9609c766fa7b6f413e1ac001
Parents: b8a6b1e
Author: Larry McCay <la...@gmail.com>
Authored: Sun Nov 23 19:52:22 2014 +0300
Committer: Vladimir Sitnikov <si...@gmail.com>
Committed: Sun Nov 23 19:52:46 2014 +0300

----------------------------------------------------------------------
 example/csv/README.md | 71 +++++++++++++++++++++++++++++++---------------
 1 file changed, 48 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/53925356/example/csv/README.md
----------------------------------------------------------------------
diff --git a/example/csv/README.md b/example/csv/README.md
index 9d419c3..0570e3a 100644
--- a/example/csv/README.md
+++ b/example/csv/README.md
@@ -1,12 +1,10 @@
-[![Build Status](https://travis-ci.org/julianhyde/optiq-csv.png)](https://travis-ci.org/julianhyde/optiq-csv)
-
-optiq-csv
+Calcite-csv
 ============
 
 Calcite adapter that reads
 <a href="http://en.wikipedia.org/wiki/Comma-separated_values">CSV</a> files.
 
-Optiq-csv is a nice simple example of how to connect
+Calcite-csv is a nice simple example of how to connect
 <a href="https://github.com/apache/incubator-calcite">Apache Calcite</a>
 to your own data source and quickly get a full SQL/JDBC interface.
 
@@ -16,34 +14,60 @@ Download and build
 You need Java (1.6 or higher; 1.7 preferred), git and maven (3.0.4 or later).
 
 ```bash
-$ git clone git://github.com/julianhyde/optiq-csv.git
-$ cd optiq-csv
-$ mvn compile
+$ git clone https://github.com/apache/incubator-calcite.git
+$ cd incubator-calcite
+$ mvn install -DskipTests -Dcheckstyle.skip=true
+$ cd example/csv
 ```
 
 Kick the tires
 ==============
 
-Let's take a quick look at optiq-csv's (and Calcite's) features.
+Let's take a quick look at calcite-csv's (and Calcite's) features.
 We'll use <code>sqlline</code>, a SQL shell that connects to
-any JDBC data source and is included with optiq-csv.
+any JDBC data source and is included with calcite-csv.
 
 Connect to Calcite and try out some queries:
 
 ```SQL
 $ ./sqlline
-sqlline> !connect jdbc:calcite: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:calcite: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
+!connect jdbc:calcite:model=target/test-classes/model.json admin admin
+
+VALUES char_length('Hello, ' || 'world!');
+
+!tables
+
+!describe emps
+
+SELECT * FROM emps;
+
+EXPLAIN PLAN FOR SELECT * FROM emps;
+
+-- non-smart model does not optimize "fetch only required columns"
+EXPLAIN PLAN FOR SELECT empno, name FROM emps;
+```
+
+Connect to "smart" model and see how it uses just the required columns from the
+CSV.
+```SQL
+!connect jdbc:calcite:model=target/test-classes/smart.json admin admin
+EXPLAIN PLAN FOR SELECT * FROM emps;
+
+-- Smart model optimizes "fetch only required columns"
+EXPLAIN PLAN FOR SELECT empno, name FROM emps;
+
+SELECT depts.name, count(*)
+  FROM emps JOIN depts USING (deptno)
+ GROUP BY depts.name;
+
+EXPLAIN PLAN FOR SELECT empno, name FROM emps;
+
+-- However it is not very smart, so it cannot see through calculations
+-- This is solved in CALCITE-477
+EXPLAIN PLAN FOR SELECT empno*2, name FROM emps;
+```
+```
+!quit
 ```
 
 (On Windows, the command is `sqlline.bat`.)
@@ -60,8 +84,9 @@ More information
 * License: Apache License, Version 2.0.
 * Author: Julian Hyde
 * Blog: http://julianhyde.blogspot.com
-* Project page: http://www.hydromatic.net/optiq-csv
-* Source code: http://github.com/julianhyde/optiq-csv
+* Project page: http://calcite.incubator.apache.org/
+* Source code: https://git-wip-us.apache.org/repos/asf?p=incubator-calcite.git
+* Github mirror: https://github.com/apache/incubator-calcite
 * Developers list: http://mail-archives.apache.org/mod_mbox/incubator-calcite-dev/
 * <a href="TUTORIAL.md">Tutorial</a>
 * <a href="HISTORY.md">Release notes and history</a>