You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Jesus Camacho Rodriguez (JIRA)" <ji...@apache.org> on 2016/09/29 11:04:20 UTC

[jira] [Resolved] (CALCITE-1397) ClassCastException in FilterReduceExpressionsRule

     [ https://issues.apache.org/jira/browse/CALCITE-1397?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jesus Camacho Rodriguez resolved CALCITE-1397.
----------------------------------------------
       Resolution: Fixed
    Fix Version/s: 1.10.0

Your suggestion makes sense [~julianhyde], thanks!

I have changed the code accordingly and added a new test that covers the issue.

Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/0a1a190 .

> ClassCastException in FilterReduceExpressionsRule
> -------------------------------------------------
>
>                 Key: CALCITE-1397
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1397
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.9.0
>            Reporter: Jesus Camacho Rodriguez
>            Assignee: Jesus Camacho Rodriguez
>             Fix For: 1.10.0
>
>
> L184 in ReduceExpressionsRule.
> {code}
> ...
>         if (newConditionExp instanceof RexCall) {
>           RexCall rexCall = (RexCall) newConditionExp;
>           boolean reverse = rexCall.getKind() == SqlKind.NOT;
>           if (reverse) {
>             rexCall = (RexCall) rexCall.getOperands().get(0);
>           }
>           reduceNotNullableFilter(call, filter, rexCall, reverse);
>         }
> ...
> {code}
> When we take the _NOT_ input, we do not consider that it might not be a RexCall, which may lead to the ClassCastException.



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