[
https://issues.apache.org/jira/browse/CALCITE-2551?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
pengzhiwei updated CALCITE-2551:
--------------------------------
Description:
In the sql as follow:
{code:java}
select empno from emp
where not case when true then deptno in (10,20) else true end
{code}
A ClassCastException was thrown out as follow:
{code:java}
java.lang.ClassCastException: org.apache.calcite.sql.fun.SqlCase cannot be cast
to org.apache.calcite.sql.SqlBasicCall
at
org.apache.calcite.sql2rel.SqlToRelConverter.pushDownNotForIn(SqlToRelConverter.java:987)
at
org.apache.calcite.sql2rel.SqlToRelConverter.convertWhere(SqlToRelConverter.java:1070)
at
{code}
The problem is that the SqlToRelConverter#pushDownNotForIn method miss
consideration
for SqlCase.
was:
In the sql as follow:
{code:java}
select empno from emp
where not case when true then deptno in (10,20) else true end
{code}
A ClassCastException was thrown out as follow:
{code:java}
java.lang.ClassCastException: org.apache.calcite.sql.fun.SqlCase cannot be cast
to org.apache.calcite.sql.SqlBasicCall
at
org.apache.calcite.sql2rel.SqlToRelConverter.pushDownNotForIn(SqlToRelConverter.java:987)
at
org.apache.calcite.sql2rel.SqlToRelConverter.convertWhere(SqlToRelConverter.java:1070)
at
{code}
The problem is that the SqlToRelConverter#pushDownNotForIn method miss
consideration
for SqlCase.
I have made a PR for this issue,anybody can have a check for me? Thanks!
https://github.com/apache/calcite/pull/826
> ClassCastException in SqlToRelConverter#pushDownNotForIn
> --------------------------------------------------------
>
> Key: CALCITE-2551
> URL: https://issues.apache.org/jira/browse/CALCITE-2551
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.17.0
> Reporter: pengzhiwei
> Assignee: Julian Hyde
> Priority: Critical
>
> In the sql as follow:
> {code:java}
> select empno from emp
> where not case when true then deptno in (10,20) else true end
> {code}
> A ClassCastException was thrown out as follow:
> {code:java}
> java.lang.ClassCastException: org.apache.calcite.sql.fun.SqlCase cannot be
> cast to org.apache.calcite.sql.SqlBasicCall
> at
> org.apache.calcite.sql2rel.SqlToRelConverter.pushDownNotForIn(SqlToRelConverter.java:987)
> at
> org.apache.calcite.sql2rel.SqlToRelConverter.convertWhere(SqlToRelConverter.java:1070)
> at
> {code}
> The problem is that the SqlToRelConverter#pushDownNotForIn method miss
> consideration
> for SqlCase.
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)