[ https://issues.apache.org/jira/browse/FLINK-21162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17288158#comment-17288158 ]
WeiNan Zhao commented on FLINK-21162: ------------------------------------- |if (!${castedNeedle.nullTerm}) { | $resultTerm = $setTerm.contains(${castedNeedle.resultTerm}); | $nullTerm = !$resultTerm && $setTerm.containsNull(); |}else{ | // resultTerm return true, but null in set,we give nullItem = true? | {color:#FF0000}$resultTerm = $setTerm.containsNull();{color} {color:#FF0000}| $nullTerm = true;{color} |} wo can return resultTerm = true ,help if function make judgments,but make nullTerm = true. > FLINK SQL IF function semantic incorrect > ---------------------------------------- > > Key: FLINK-21162 > URL: https://issues.apache.org/jira/browse/FLINK-21162 > Project: Flink > Issue Type: Bug > Components: Table SQL / API, Table SQL / Planner, Table SQL / Runtime > Affects Versions: 1.12.1 > Reporter: 谢波 > Assignee: WeiNan Zhao > Priority: Major > Labels: pull-request-available > > I have a job using IF() test condition. > when i use "IF(col = '', 'a', 'b'), WHEN col = '' return a ", it is ok. > when i use "IF(col IS NULL, 'a', 'b'), WHEN col = NULL return a ", it is ok. > when i use "IF(col = '' OR col IS NULL, 'a', 'b'),WHEN col = ''return a", it > is ok. > when i use "IF(col = '' OR col IS NULL, 'a', 'b'),WHEN col = NULL return b" > ,that's amazing. > The semantic seems like inccorrect. > > my table ddl: > CREATE TABLE print(a STRING, b STRING) WITH ( 'connector' = 'print' ); > my dml : > INSERT INTO print > SELECT return_flag, > IF(return_flag = '' OR return_flag IS NULL, 'N', 'Y') returnFlag > FROM header; > my test data: > 3> +I(,N) > 5> +I(X,Y) > 1> +I(null,Y) > 2> +I(,N) > 5> +I(null,Y) > 3> +I(,N) > -- This message was sent by Atlassian Jira (v8.3.4#803005)