Here is the log file:

2016-08-24 21:22:46,910 [2841efd8-fe6f-38dc-b4cc-a01204b141e0:foreman] INFO  
o.a.drill.exec.work.foreman.Foreman - Query text for query id 
2841efd8-fe6f-38dc-b4cc-a01204b141e0: SELECT * FROM (SELECT * FROM 
mysql.scan_test_data.acme_sales) T LIMIT 0
2016-08-24 21:22:47,396 [2841efd8-fe6f-38dc-b4cc-a01204b141e0:foreman] ERROR 
o.a.drill.exec.work.foreman.Foreman - SYSTEM ERROR: NullPointerException


[Error Id: f9661104-b930-4a78-b290-9c2aeda49807 on 10.0.1.164:31010]
org.apache.drill.common.exceptions.UserException: SYSTEM ERROR: 
NullPointerException


[Error Id: f9661104-b930-4a78-b290-9c2aeda49807 on 10.0.1.164:31010]
        at 
org.apache.drill.common.exceptions.UserException$Builder.build(UserException.java:543)
 ~[drill-common-1.7.0.jar:1.7.0]
        at 
org.apache.drill.exec.work.foreman.Foreman$ForemanResult.close(Foreman.java:791)
 [drill-java-exec-1.7.0.jar:1.7.0]
        at 
org.apache.drill.exec.work.foreman.Foreman.moveToState(Foreman.java:901) 
[drill-java-exec-1.7.0.jar:1.7.0]
        at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:271) 
[drill-java-exec-1.7.0.jar:1.7.0]
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
[na:1.7.0_111]
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
[na:1.7.0_111]
        at java.lang.Thread.run(Thread.java:745) [na:1.7.0_111]
Caused by: org.apache.drill.exec.work.foreman.ForemanException: Unexpected 
exception during fragment initialization: null
        ... 4 common frames omitted
Caused by: java.lang.NullPointerException: null
        at 
org.apache.drill.exec.planner.sql.handlers.FindLimit0Visitor$FindHardDistributionScans.visit(FindLimit0Visitor.java:262)
 ~[drill-java-exec-1.7.0.jar:1.7.0]
        at org.apache.calcite.rel.core.TableScan.accept(TableScan.java:166) 
~[calcite-core-1.4.0-drill-r11.jar:1.4.0-drill-r11]
        at 
org.apache.calcite.rel.RelShuttleImpl.visitChild(RelShuttleImpl.java:53) 
~[calcite-core-1.4.0-drill-r11.jar:1.4.0-drill-r11]
        at 
org.apache.calcite.rel.RelShuttleImpl.visitChildren(RelShuttleImpl.java:68) 
~[calcite-core-1.4.0-drill-r11.jar:1.4.0-drill-r11]
        at org.apache.calcite.rel.RelShuttleImpl.visit(RelShuttleImpl.java:126) 
~[calcite-core-1.4.0-drill-r11.jar:1.4.0-drill-r11]
        at 
org.apache.calcite.rel.AbstractRelNode.accept(AbstractRelNode.java:256) 
~[calcite-core-1.4.0-drill-r11.jar:1.4.0-drill-r11]
        at 
org.apache.calcite.rel.RelShuttleImpl.visitChild(RelShuttleImpl.java:53) 
~[calcite-core-1.4.0-drill-r11.jar:1.4.0-drill-r11]
        at 
org.apache.calcite.rel.RelShuttleImpl.visitChildren(RelShuttleImpl.java:68) 
~[calcite-core-1.4.0-drill-r11.jar:1.4.0-drill-r11]
        at org.apache.calcite.rel.RelShuttleImpl.visit(RelShuttleImpl.java:126) 
~[calcite-core-1.4.0-drill-r11.jar:1.4.0-drill-r11]
        at 
org.apache.calcite.rel.AbstractRelNode.accept(AbstractRelNode.java:256) 
~[calcite-core-1.4.0-drill-r11.jar:1.4.0-drill-r11]
        at 
org.apache.drill.exec.planner.sql.handlers.FindLimit0Visitor.containsLimit0(FindLimit0Visitor.java:129)
 ~[drill-java-exec-1.7.0.jar:1.7.0]
        at 
org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.convertToDrel(DefaultSqlHandler.java:259)
 ~[drill-java-exec-1.7.0.jar:1.7.0]
        at 
org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.convertToDrel(DefaultSqlHandler.java:286)
 ~[drill-java-exec-1.7.0.jar:1.7.0]
        at 
org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan(DefaultSqlHandler.java:168)
 ~[drill-java-exec-1.7.0.jar:1.7.0]
        at 
org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:94)
 ~[drill-java-exec-1.7.0.jar:1.7.0]
        at org.apache.drill.exec.work.foreman.Foreman.runSQL(Foreman.java:978) 
[drill-java-exec-1.7.0.jar:1.7.0]
        at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:257) 
[drill-java-exec-1.7.0.jar:1.7.0]
        ... 3 common frames omitted

Please let me know if you meant a different log.



Thank you,
Chris Altman



> On Aug 24, 2016, at 5:11 PM, Parth Chandra <[email protected]> wrote:
> 
> I think the ODBC driver encapsulates the original query in a LIMIT 0 query
> to determine the types of the columns returned by the query. Drill does not
> have a prepare phase for the query so the ODBC driver does this to mimic
> the behavior of prepare.
> 
> Your real problem is that the query is crashing.
> 
> Do you have access to the server logs? Can you find the error in the server
> log and provide the stack trace?
> 
> My guess would be that this is a bug in Drill's  JDBC storage plugin.
> 
> 
> 
> On Wed, Aug 24, 2016 at 1:15 PM, Christopher Altman <[email protected]>
> wrote:
> 
>> I am:
>> * Using an ODBC connector to Apache Drill
>> * Drill is connected to a MySQL server
>> * The SQL Statement (passing through ODBC) is "SELECT count(*) from
>> mysql.test.acme_sales"
>> 
>> Within the Drill Profiles section is see that my query was mapped to:
>> "SELECT * FROM (SELECT count(*) from mysql.test.acme_sales ) T LIMIT 0”
>> 
>> Which return an error "SYSTEM ERROR: NullPointerException”
>> 
>> 
>> My question is, why is Drill adding the “T LIMIT 0”?
>> 
>> If I change it to “T LIMIT 1” in the Query tab I get valid results.
>> 
>> Maybe I am missing a larger picture here, but I cannot get my SQL commands
>> to successfully pass through ODBC and execute on MySQL.
>> 
>> Thank you for your help!
>> 
>> Chris
>> 
>> 
>> 
>> 

Reply via email to