[
https://issues.apache.org/jira/browse/CALCITE-1397?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15530752#comment-15530752
]
Julian Hyde commented on CALCITE-1397:
--------------------------------------
Need a test case.
It might be simpler if {{reduceNotNullableFilter}} accepted any {{RexNode}},
not just {{RexCall}}; it would no-op if the arg was not IS_NULL, IS_UNKNOWN,
IS_NOT_NULL. Then you can remove the casts and 'if' before you call it.
> 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
>
> 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)