Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
Drill, mail # dev - sqlline broken?


+
Ted Dunning 2013-07-21, 21:32
Copy link to this message
-
Re: sqlline broken?
Jacques Nadeau 2013-07-22, 00:18
maybe try with a mvn clean install and let all tests run.

I did a clean checkout and query worked.

Also, we haven't added syntactic sugar yet so you need to do:

>>select _MAP['type'] from donuts

instead of

>>select type from donuts
Note that you can use subqueries to clean things up a bit.

SELECT ppu, count(1) AS cnt FROM
  (SELECT _MAP['ppu'] AS ppu, _MAP['type'] AS type FROM donuts)y
GROUP BY ppu
ORDER BY ppu DESC;

If I recall, Julian has worked on adding views but I don't think we
have that available in Drill yet.  (Julian will be able to confirm).
I also thought we had added limit but I trying it reveals it isn't in
yet.

Jacques
On Sun, Jul 21, 2013 at 2:32 PM, Ted Dunning <[EMAIL PROTECTED]> wrote:
> I am prepping for a workshop and it appears that sql line is a bit broken.
>
> Steps that I did:
>
> installed protoc 2.5.0
> git pull and checkout of pre_exec_merge
>
>
> This seems all in order.
>
> Then I run sqlline and connect to the donuts table which seems to work well
> (I added a -q in sqlline to minimize mvn squawking)
>
> $ cd incubator-drill/sandbox/prototype
> $ mvn install -DskipTests
> $ rm .classpath
> $ ./sqlline
> /Users/tdunning/.sqlline/sqlline.properties (No such file or directory)
> sqlline version ??? by Marc Prud'hommeaux
> sqlline> !connect
> jdbc:optiq:model=common/target/test-classes/donuts-model.json admin admin
> Connecting to jdbc:optiq:model=common/target/test-classes/donuts-model.json
>  ... lots of messages about logback being configured poorly ...
>
> Connected to: Optiq (version 0.4.2)
> Driver: Optiq JDBC Driver (version 0.4.2)
> Autocommit status: true
> Transaction isolation: TRANSACTION_REPEATABLE_READ
>
>
> Here is the exciting part.  I enter a simple query:
>
> 0: jdbc:optiq:model=common/target/test-classe> select * from donuts;
>
> What pops out is a reasonable logical plan:
>
>     {
>         "head":{
>         "type":"apache_drill_logical_plan",
>         "version":"1",
>         "generator":{"type":"manual","info":"na"}
>         },
>         "storage":[
>              {"name":"donuts-json","type":"classpath"},
>              {"name":"queue","type":"queue"}],
>         "query":[
>         {"op":"sequence","do":[
>
> {"op":"scan","memo":"initial_scan","ref":"_MAP","storageengine":"donuts-json","selection":{"path":"/donuts.json","type":"JSON"}},
>
> {"op":"project","projections":[{"expr":"_MAP","ref":"output._MAP"}]},
>             {"op":"store","storageengine":"queue","memo":"output
> sink","target":{"number":0}}
>         ]
>         }
>         ]
>     }
>
> And then problems start:
>
> 14:24:55.515 [main] DEBUG o.a.drill.common.config.DrillConfig - Loading
> configs at the following URLs
> [jar:file:/Users/tdunning/.m2/repository/org/apache/drill/exec/ref/1.0-SNAPSHOT/ref-1.0-SNAPSHOT.jar!/drill-module.conf,
> jar:file:/Users/tdunning/.m2/repository/org/apache/drill/common/1.0-SNAPSHOT/common-1.0-SNAPSHOT.jar!/drill-module.conf,
> file:/Users/tdunning/Apache/Drill/incubator-drill/sandbox/prototype/exec/ref/target/classes/drill-module.conf,
> file:/Users/tdunning/Apache/Drill/incubator-drill/sandbox/prototype/exec/java-exec/target/classes/drill-module.conf]
> 14:24:55.527 [main] DEBUG o.a.d.c.l.data.LogicalOperatorBase - Adding
> Logical Operator sub types: [class
> org.apache.drill.common.logical.data.Join, class
> org.apache.drill.common.logical.data.Project, class
> org.apache.drill.common.logical.data.Limit, class
> org.apache.drill.common.logical.data.Order, class
> org.apache.drill.common.logical.data.Transform, class
> org.apache.drill.common.logical.data.Filter, class
> org.apache.drill.common.logical.data.Constant, class
> org.apache.drill.common.logical.data.Flatten, class
> org.apache.drill.common.logical.data.Sequence, class
> org.apache.drill.common.logical.data.Store, class
> org.apache.drill.common.logical.data.Union, class
> org.apache.drill.common.logical.data.Segment, class
> org.apache.drill.common.logical.data.RunningAggregate, class
> org.apache.drill.common.logical.data.WindowFrame, class
+
Ted Dunning 2013-07-22, 02:16
+
Jacques Nadeau 2013-07-22, 01:13
+
Ted Dunning 2013-07-22, 02:17
+
Jacques Nadeau 2013-07-22, 02:34
+
Ted Dunning 2013-07-22, 01:52