[
https://issues.apache.org/jira/browse/CALCITE-4508?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17288480#comment-17288480
]
Julian Hyde commented on CALCITE-4508:
--------------------------------------
Sounds related to CALCITE-4446.
it would be really useful to have a test case involving CASE (not IF, which is
non-standard) where a query returns wrong results.
> Related to FLINK-21162,SQL optimization in OR syntax
> ----------------------------------------------------
>
> Key: CALCITE-4508
> URL: https://issues.apache.org/jira/browse/CALCITE-4508
> Project: Calcite
> Issue Type: Bug
> Affects Versions: 1.26.0
> Environment: flink-1.12,flink1.13
> Reporter: WeiNan Zhao
> Priority: Major
>
> [flink-table/flink-table-planner-blink/src/main/java/org/apache/calcite/rex/RexSimplify.java|https://github.com/apache/flink/pull/14872/files#diff-f13aa38a0e8d4eb656016353b2da73c4d53e9898098a5c497219829c1401c48e]
> linenum:2673
> case IS_NULL:
> {color:#ff0000}/** {color}
> {color:#ff0000}* when is_null in OR operate ,if change to search('',null)
> there was a major mistake, {color}
> {color:#ff0000}* because search has three return values
> (true,false,null),but OR Operate only {color}
> {color:#ff0000}* can return true or false,so wo can't change is_null or ...
> to search('',null); {color}
> {color:#ff0000}*/ {color}
> if (negate) \{ return false; }
> final RexNode arg = ((RexCall) e).operands.get(0);
> {color:#ffab00}return accept1( arg, e.getKind(),
> rexBuilder.makeNullLiteral(arg.getType()), newTerms);
> {color}{color:#4c9aff}It should not be converted here{color}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)