drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-3823) Exception when grouping by case expression and columns array
Date Wed, 04 May 2016 16:27:12 GMT

    [ https://issues.apache.org/jira/browse/DRILL-3823?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15270936#comment-15270936
] 

ASF GitHub Bot commented on DRILL-3823:
---------------------------------------

Github user hsuanyi closed the pull request at:

    https://github.com/apache/drill/pull/490


> Exception when grouping by case expression and columns array
> ------------------------------------------------------------
>
>                 Key: DRILL-3823
>                 URL: https://issues.apache.org/jira/browse/DRILL-3823
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Query Planning & Optimization
>    Affects Versions: 1.1.0, 1.2.0
>            Reporter: Victoria Markman
>            Assignee: Sean Hsuan-Yi Chu
>             Fix For: 1.7.0
>
>         Attachments: t1.csv
>
>
> In drill version 1.2.0:
> {code}
> 0: jdbc:drill:schema=dfs> select 
> . . . . . . . . . . . . >         count(*),
> . . . . . . . . . . . . >         case when columns[0] = '' then cast(null as integer)
else cast(columns[0] as integer) end
> . . . . . . . . . . . . > from    
> . . . . . . . . . . . . >         `t1.csv`
> . . . . . . . . . . . . > group by
> . . . . . . . . . . . . >         case when columns[0] = '' then cast(null as integer)
else cast(columns[0] as integer) end;
> Error: SYSTEM ERROR: UnsupportedOperationException: class org.apache.calcite.sql.SqlLiteral:
NULL
> [Error Id: e4b37748-e81a-41c9-bfbc-e8f60cb43977 on atsqa4-133.qa.lab:31010] (state=,code=0)
> {code}
> drillbit.log
> {code}
> 2015-09-23 00:00:13,947 [29fe1472-1af8-ba17-4184-3bc38da1d372:foreman] ERROR o.a.drill.exec.work.foreman.Foreman
- SYSTEM ERROR: UnsupportedOperationException: class org.apache.calcite.sql.SqlLiteral: NULL
> [Error Id: 46bce8a5-048a-4caa-bcfc-9b2326cfd831 on atsqa4-133.qa.lab:31010]
> org.apache.drill.common.exceptions.UserException: SYSTEM ERROR: UnsupportedOperationException:
class org.apache.calcite.sql.SqlLiteral: NULL
> [Error Id: 46bce8a5-048a-4caa-bcfc-9b2326cfd831 on atsqa4-133.qa.lab:31010]
>         at org.apache.drill.common.exceptions.UserException$Builder.build(UserException.java:524)
~[drill-common-1.2.0-SNAPSHOT.jar:1.2.0-SNAPSHOT]
>         at org.apache.drill.exec.work.foreman.Foreman$ForemanResult.close(Foreman.java:742)
[drill-java-exec-1.2.0-SNAPSHOT.jar:1.2.0-SNAPSHOT]
>         at org.apache.drill.exec.work.foreman.Foreman$StateSwitch.processEvent(Foreman.java:841)
[drill-java-exec-1.2.0-SNAPSHOT.jar:1.2.0-SNAPSHOT]
>         at org.apache.drill.exec.work.foreman.Foreman$StateSwitch.processEvent(Foreman.java:786)
[drill-java-exec-1.2.0-SNAPSHOT.jar:1.2.0-SNAPSHOT]
>         at org.apache.drill.common.EventProcessor.sendEvent(EventProcessor.java:73) [drill-common-1.2.0-SNAPSHOT.jar:1.2.0-SNAPSHOT]
>         at org.apache.drill.exec.work.foreman.Foreman$StateSwitch.moveToState(Foreman.java:788)
[drill-java-exec-1.2.0-SNAPSHOT.jar:1.2.0-SNAPSHOT]
>         at org.apache.drill.exec.work.foreman.Foreman.moveToState(Foreman.java:894) [drill-java-exec-1.2.0-SNAPSHOT.jar:1.2.0-SNAPSHOT]
>         at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:255) [drill-java-exec-1.2.0-SNAPSHOT.jar:1.2.0-SNAPSHOT]
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
[na:1.7.0_71]
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[na:1.7.0_71]
>         at java.lang.Thread.run(Thread.java:745) [na:1.7.0_71]
> Caused by: org.apache.drill.exec.work.foreman.ForemanException: Unexpected exception
during fragment initialization: Internal error: while converting CASE WHEN `t1.csv`.`columns`[0]
= '' THEN CAST(NULL AS INTEGER) ELSE CAST(`t1.csv`.`columns`[0] AS INTEGER)
>  END
>         ... 4 common frames omitted
> Caused by: java.lang.AssertionError: Internal error: while converting CASE WHEN `t1.csv`.`columns`[0]
= '' THEN CAST(NULL AS INTEGER) ELSE CAST(`t1.csv`.`columns`[0] AS INTEGER) END
>         at org.apache.calcite.util.Util.newInternal(Util.java:792) ~[calcite-core-1.4.0-drill-r2.jar:1.4.0-drill-r2]
>         at org.apache.calcite.sql2rel.ReflectiveConvertletTable$1.convertCall(ReflectiveConvertletTable.java:96)
~[calcite-core-1.4.0-drill-r2.jar:1.4.0-drill-r2]
>         at org.apache.calcite.sql2rel.SqlNodeToRexConverterImpl.convertCall(SqlNodeToRexConverterImpl.java:60)
~[calcite-core-1.4.0-drill-r2.jar:1.4.0-drill-r2]
>         at org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.visit(SqlToRelConverter.java:4162)
~[calcite-core-1.4.0-drill-r2.jar:1.4.0-drill-r2]
>         at org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.visit(SqlToRelConverter.java:3595)
~[calcite-core-1.4.0-drill-r2.jar:1.4.0-drill-r2]
>         at org.apache.calcite.sql.SqlCall.accept(SqlCall.java:130) ~[calcite-core-1.4.0-drill-r2.jar:1.4.0-drill-r2]
>         at org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.convertExpression(SqlToRelConverter.java:4054)
~[calcite-core-1.4.0-drill-r2.jar:1.4.0-drill-r2]
>         at org.apache.calcite.sql2rel.SqlToRelConverter$AggConverter.addGroupExpr(SqlToRelConverter.java:4346)
~[calcite-core-1.4.0-drill-r2.jar:1.4.0-drill-r2]
>         at org.apache.calcite.sql2rel.SqlToRelConverter.createAggImpl(SqlToRelConverter.java:2432)
~[calcite-core-1.4.0-drill-r2.jar:1.4.0-drill-r2]
>         at org.apache.calcite.sql2rel.SqlToRelConverter.convertAgg(SqlToRelConverter.java:2388)
~[calcite-core-1.4.0-drill-r2.jar:1.4.0-drill-r2]
>         at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectImpl(SqlToRelConverter.java:621)
~[calcite-core-1.4.0-drill-r2.jar:1.4.0-drill-r2]
>         at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelect(SqlToRelConverter.java:582)
~[calcite-core-1.4.0-drill-r2.jar:1.4.0-drill-r2]
>         at org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryRecursive(SqlToRelConverter.java:2787)
~[calcite-core-1.4.0-drill-r2.jar:1.4.0-drill-r2]
>         at org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:536)
~[calcite-core-1.4.0-drill-r2.jar:1.4.0-drill-r2]
>         at org.apache.calcite.prepare.PlannerImpl.convert(PlannerImpl.java:204) ~[calcite-core-1.4.0-drill-r2.jar:1.4.0-drill-r2]
>         at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.convertToRel(DefaultSqlHandler.java:467)
~[drill-java-exec-1.2.0-SNAPSHOT.jar:1.2.0-SNAPSHOT]
>         at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.validateAndConvert(DefaultSqlHandler.java:193)
~[drill-java-exec-1.2.0-SNAPSHOT.jar:1.2.0-SNAPSHOT]
>         at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan(DefaultSqlHandler.java:159)
~[drill-java-exec-1.2.0-SNAPSHOT.jar:1.2.0-SNAPSHOT]
>         at org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:178)
~[drill-java-exec-1.2.0-SNAPSHOT.jar:1.2.0-SNAPSHOT]
>         at org.apache.drill.exec.work.foreman.Foreman.runSQL(Foreman.java:905) [drill-java-exec-1.2.0-SNAPSHOT.jar:1.2.0-SNAPSHOT]
>         at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:244) [drill-java-exec-1.2.0-SNAPSHOT.jar:1.2.0-SNAPSHOT]
>         ... 3 common frames omitted
> Caused by: java.lang.reflect.InvocationTargetException: null
> {code}
> The same query fails in 1.1.0 in a different way:
> {code}
> 0: jdbc:drill:schema=dfs> select 
> . . . . . . . . . . . . >         count(*),
> . . . . . . . . . . . . >         case when columns[0] = '' then cast(null as integer)
else cast(columns[0] as integer) end
> . . . . . . . . . . . . > from    
> . . . . . . . . . . . . >         `t1.csv`
> . . . . . . . . . . . . > group by
> . . . . . . . . . . . . >         case when columns[0] = '' then cast(null as integer)
else cast(columns[0] as integer) end;
> Error: SYSTEM ERROR: NullPointerException
> [Error Id: 5b550b12-d6a2-46c2-abcd-607ec213ca96 on atsqa4-133.qa.lab:31010] (state=,code=0)
> {code}
> drillbit.log
> {code}
> org.apache.drill.exec.work.foreman.ForemanException: Unexpected exception during fragment
initialization: Internal error: while converting CASE WHEN `t1.csv`.`columns`[0] = '' THEN
CAST(NULL AS INTEGER) ELSE CAST(`t1.csv`.`columns`[0] AS INTEGER) END
>         at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:253) [drill-java-exec-1.1.0-SNAPSHOT.jar:1.1.0-SNAPSHOT]
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
[na:1.7.0_71]
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[na:1.7.0_71]
>         at java.lang.Thread.run(Thread.java:745) [na:1.7.0_71]
> Caused by: java.lang.AssertionError: Internal error: while converting CASE WHEN `t1.csv`.`columns`[0]
= '' THEN CAST(NULL AS INTEGER) ELSE CAST(`t1.csv`.`columns`[0] AS INTEGER) END
>         at org.apache.calcite.util.Util.newInternal(Util.java:790) ~[calcite-core-1.1.0-drill-r14.jar:1.1.0-drill-r14]
>         at org.apache.calcite.sql2rel.ReflectiveConvertletTable$1.convertCall(ReflectiveConvertletTable.java:96)
~[calcite-core-1.1.0-drill-r14.jar:1.1.0-drill-r14]
>         at org.apache.calcite.sql2rel.SqlNodeToRexConverterImpl.convertCall(SqlNodeToRexConverterImpl.java:60)
~[calcite-core-1.1.0-drill-r14.jar:1.1.0-drill-r14]
>         at org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.visit(SqlToRelConverter.java:4070)
~[calcite-core-1.1.0-drill-r14.jar:1.1.0-drill-r14]
>         at org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.visit(SqlToRelConverter.java:1)
~[calcite-core-1.1.0-drill-r14.jar:1.1.0-drill-r14]
>         at org.apache.calcite.sql.SqlCall.accept(SqlCall.java:130) ~[calcite-core-1.1.0-drill-r14.jar:1.1.0-drill-r14]
>         at org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.convertExpression(SqlToRelConverter.java:3963)
~[calcite-core-1.1.0-drill-r14.jar:1.1.0-drill-r14]
>         at org.apache.calcite.sql2rel.SqlToRelConverter$AggConverter.addGroupExpr(SqlToRelConverter.java:4253)
~[calcite-core-1.1.0-drill-r14.jar:1.1.0-drill-r14]
>         at org.apache.calcite.sql2rel.SqlToRelConverter.createAggImpl(SqlToRelConverter.java:2405)
~[calcite-core-1.1.0-drill-r14.jar:1.1.0-drill-r14]
>         at org.apache.calcite.sql2rel.SqlToRelConverter.convertAgg(SqlToRelConverter.java:2360)
~[calcite-core-1.1.0-drill-r14.jar:1.1.0-drill-r14]
>         at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectImpl(SqlToRelConverter.java:604)
~[calcite-core-1.1.0-drill-r14.jar:1.1.0-drill-r14]
>         at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelect(SqlToRelConverter.java:564)
~[calcite-core-1.1.0-drill-r14.jar:1.1.0-drill-r14]
>         at org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryRecursive(SqlToRelConverter.java:2759)
~[calcite-core-1.1.0-drill-r14.jar:1.1.0-drill-r14]
>         at org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:522)
~[calcite-core-1.1.0-drill-r14.jar:1.1.0-drill-r14]
>         at org.apache.calcite.prepare.PlannerImpl.convert(PlannerImpl.java:198) ~[calcite-core-1.1.0-drill-r14.jar:1.1.0-drill-r14]
>         at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.convertToRel(DefaultSqlHandler.java:448)
~[drill-java-exec-1.1.0-SNAPSHOT.jar:1.1.0-SNAPSHOT]
>         at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.validateAndConvert(DefaultSqlHandler.java:191)
~[drill-java-exec-1.1.0-SNAPSHOT.jar:1.1.0-SNAPSHOT]
>         at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan(DefaultSqlHandler.java:157)
~[drill-java-exec-1.1.0-SNAPSHOT.jar:1.1.0-SNAPSHOT]
>         at org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:178)
~[drill-java-exec-1.1.0-SNAPSHOT.jar:1.1.0-SNAPSHOT]
>         at org.apache.drill.exec.work.foreman.Foreman.runSQL(Foreman.java:903) [drill-java-exec-1.1.0-SNAPSHOT.jar:1.1.0-SNAPSHOT]
>         at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:242) [drill-java-exec-1.1.0-SNAPSHOT.jar:1.1.0-SNAPSHOT]
>         ... 3 common frames omitted
> Caused by: java.lang.reflect.InvocationTargetException: null
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_71]
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
~[na:1.7.0_71]
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
~[na:1.7.0_71]
>         at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_71]
>         at org.apache.calcite.sql2rel.ReflectiveConvertletTable$1.convertCall(ReflectiveConvertletTable.java:87)
~[calcite-core-1.1.0-drill-r14.jar:1.1.0-drill-r14]
>         ... 22 common frames omitted
> Caused by: java.lang.NullPointerException: null
>         at org.apache.calcite.rex.RexBuilder.makeCast(RexBuilder.java:463) ~[calcite-core-1.1.0-drill-r14.jar:1.1.0-drill-r14]
>         at org.apache.calcite.sql2rel.SqlNodeToRexConverterImpl.convertLiteral(SqlNodeToRexConverterImpl.java:93)
~[calcite-core-1.1.0-drill-r14.jar:1.1.0-drill-r14]
>         at org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.visit(SqlToRelConverter.java:4059)
~[calcite-core-1.1.0-drill-r14.jar:1.1.0-drill-r14]
>         at org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.visit(SqlToRelConverter.java:1)
~[calcite-core-1.1.0-drill-r14.jar:1.1.0-drill-r14]
>         at org.apache.calcite.sql.SqlLiteral.accept(SqlLiteral.java:329) ~[calcite-core-1.1.0-drill-r14.jar:1.1.0-drill-r14]
>         at org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.convertExpression(SqlToRelConverter.java:3963)
~[calcite-core-1.1.0-drill-r14.jar:1.1.0-drill-r14]
>         at org.apache.calcite.sql2rel.StandardConvertletTable.convertCast(StandardConvertletTable.java:420)
~[calcite-core-1.1.0-drill-r14.jar:1.1.0-drill-r14]
>         at org.apache.calcite.sql2rel.StandardConvertletTable$1.convertCall(StandardConvertletTable.java:108)
~[calcite-core-1.1.0-drill-r14.jar:1.1.0-drill-r14]
>         at org.apache.calcite.sql2rel.SqlNodeToRexConverterImpl.convertCall(SqlNodeToRexConverterImpl.java:60)
~[calcite-core-1.1.0-drill-r14.jar:1.1.0-drill-r14]
>         at org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.visit(SqlToRelConverter.java:4070)
~[calcite-core-1.1.0-drill-r14.jar:1.1.0-drill-r14]
>         at org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.visit(SqlToRelConverter.java:1)
~[calcite-core-1.1.0-drill-r14.jar:1.1.0-drill-r14]
>         at org.apache.calcite.sql.SqlCall.accept(SqlCall.java:130) ~[calcite-core-1.1.0-drill-r14.jar:1.1.0-drill-r14]
>         at org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.convertExpression(SqlToRelConverter.java:3963)
~[calcite-core-1.1.0-drill-r14.jar:1.1.0-drill-r14]
>         at org.apache.calcite.sql2rel.StandardConvertletTable.convertCase(StandardConvertletTable.java:298)
~[calcite-core-1.1.0-drill-r14.jar:1.1.0-drill-r14]
>         ... 27 common frames omitted
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message