[
https://issues.apache.org/jira/browse/CALCITE-4508?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17288400#comment-17288400
]
WeiNan Zhao edited comment on CALCITE-4508 at 2/22/21, 2:43 PM:
----------------------------------------------------------------
IF(col = '' OR col IS NULL, 'a', 'b'), in flink ,it convert to
SEARCH('',null),in flink (Search|In) in the same codegen, but IN can return
three values (true,false,null).
was (Author: zhaoweinan):
IF(col = '' OR col IS NULL, 'a', 'b'), in flink ,it convert to
SEARCH('',null),but search can return three values, true,false,null.
> 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
> Components: stream
> Affects Versions: 1.26.0
> Environment: flink-1.12,flink1.13
> Reporter: WeiNan Zhao
> Priority: Major
> Fix For: 1.26.0
>
>
> [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)