[jira] [Updated] (DRILL-2966) HAVING clause with CASE statement with IN predicate causes assertion
[ https://issues.apache.org/jira/browse/DRILL-2966?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sean Hsuan-Yi Chu updated DRILL-2966: - Attachment: DRILL-2966.1.patch > HAVING clause with CASE statement with IN predicate causes assertion > > > Key: DRILL-2966 > URL: https://issues.apache.org/jira/browse/DRILL-2966 > Project: Apache Drill > Issue Type: Bug > Components: Query Planning & Optimization >Affects Versions: 0.9.0 >Reporter: Aman Sinha >Assignee: Sean Hsuan-Yi Chu > Fix For: 1.0.0 > > Attachments: DRILL-2966.1.patch > > > The following query fails in sql-to-rel conversion: > {code} > select count(*) from emp > group by emp.deptno > having sum(case when emp.empno in (1, 2, 3) then emp.sal else 0 end) > between 1.0 and 2.0 > {code} > {code} > java.lang.AssertionError: Internal error: while converting CASE WHEN > `EMP`.`EMPNO` IN (1, 2, 3) THEN `EMP`.`SAL` ELSE 0 END > at > org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.convertExpression(SqlToRelConverter.java:4058) > at > org.apache.calcite.sql2rel.StandardConvertletTable.convertCase(StandardConvertletTable.java:301) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:606) > at > org.apache.calcite.sql2rel.ReflectiveConvertletTable$1.convertCall(ReflectiveConvertletTable.java:87) > at > org.apache.calcite.sql2rel.SqlNodeToRexConverterImpl.convertCall(SqlNodeToRexConverterImpl.java:60) > at > org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.visit(SqlToRelConverter.java:4212) > at > org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.visit(SqlToRelConverter.java:3668) > at org.apache.calcite.sql.SqlCall.accept(SqlCall.java:130) > at > org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.convertExpression(SqlToRelConverter.java:4105) > at > org.apache.calcite.sql2rel.SqlToRelConverter$AggConverter.visit(SqlToRelConverter.java:4483) > at > org.apache.calcite.sql2rel.SqlToRelConverter$AggConverter.visit(SqlToRelConverter.java:4329) > at org.apache.calcite.sql.SqlCall.accept(SqlCall.java:130) > at > org.apache.calcite.sql2rel.SqlToRelConverter$AggConverter.visit(SqlToRelConverter.java:4528) > at > org.apache.calcite.sql2rel.SqlToRelConverter$AggConverter.visit(SqlToRelConverter.java:4329) > at org.apache.calcite.sql.SqlCall.accept(SqlCall.java:130) > at > org.apache.calcite.sql2rel.SqlToRelConverter.createAggImpl(SqlToRelConverter.java:2573) > at > org.apache.calcite.sql2rel.SqlToRelConverter.convertAgg(SqlToRelConverter.java:2510) > {code} > This is dependent on CALCITE-694 . -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (DRILL-2966) HAVING clause with CASE statement with IN predicate causes assertion
[ https://issues.apache.org/jira/browse/DRILL-2966?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Aman Sinha updated DRILL-2966: -- Assignee: Sean Hsuan-Yi Chu (was: Aman Sinha) > HAVING clause with CASE statement with IN predicate causes assertion > > > Key: DRILL-2966 > URL: https://issues.apache.org/jira/browse/DRILL-2966 > Project: Apache Drill > Issue Type: Bug > Components: Query Planning & Optimization >Affects Versions: 0.9.0 >Reporter: Aman Sinha >Assignee: Sean Hsuan-Yi Chu > Fix For: 1.0.0 > > > The following query fails in sql-to-rel conversion: > {code} > select count(*) from emp > group by emp.deptno > having sum(case when emp.empno in (1, 2, 3) then emp.sal else 0 end) > between 1.0 and 2.0 > {code} > {code} > java.lang.AssertionError: Internal error: while converting CASE WHEN > `EMP`.`EMPNO` IN (1, 2, 3) THEN `EMP`.`SAL` ELSE 0 END > at > org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.convertExpression(SqlToRelConverter.java:4058) > at > org.apache.calcite.sql2rel.StandardConvertletTable.convertCase(StandardConvertletTable.java:301) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:606) > at > org.apache.calcite.sql2rel.ReflectiveConvertletTable$1.convertCall(ReflectiveConvertletTable.java:87) > at > org.apache.calcite.sql2rel.SqlNodeToRexConverterImpl.convertCall(SqlNodeToRexConverterImpl.java:60) > at > org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.visit(SqlToRelConverter.java:4212) > at > org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.visit(SqlToRelConverter.java:3668) > at org.apache.calcite.sql.SqlCall.accept(SqlCall.java:130) > at > org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.convertExpression(SqlToRelConverter.java:4105) > at > org.apache.calcite.sql2rel.SqlToRelConverter$AggConverter.visit(SqlToRelConverter.java:4483) > at > org.apache.calcite.sql2rel.SqlToRelConverter$AggConverter.visit(SqlToRelConverter.java:4329) > at org.apache.calcite.sql.SqlCall.accept(SqlCall.java:130) > at > org.apache.calcite.sql2rel.SqlToRelConverter$AggConverter.visit(SqlToRelConverter.java:4528) > at > org.apache.calcite.sql2rel.SqlToRelConverter$AggConverter.visit(SqlToRelConverter.java:4329) > at org.apache.calcite.sql.SqlCall.accept(SqlCall.java:130) > at > org.apache.calcite.sql2rel.SqlToRelConverter.createAggImpl(SqlToRelConverter.java:2573) > at > org.apache.calcite.sql2rel.SqlToRelConverter.convertAgg(SqlToRelConverter.java:2510) > {code} > This is dependent on CALCITE-694 . -- This message was sent by Atlassian JIRA (v6.3.4#6332)