drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Hsuan-Yi Chu (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-2966) HAVING clause with CASE statement with IN predicate causes assertion
Date Wed, 06 May 2015 01:24:00 GMT

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

Sean Hsuan-Yi Chu commented on DRILL-2966:
------------------------------------------

A patch is available from Calcite:
https://issues.apache.org/jira/browse/CALCITE-694

Once that gets checked in, we will add a test case on drill side.


> 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 10000.0 and 20000.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)

Mime
View raw message