[ https://issues.apache.org/jira/browse/FLINK-21162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17288247#comment-17288247 ]
WeiNan Zhao commented on FLINK-21162: ------------------------------------- [~jark] ,Hello,when i debug,i found that when IS_NULL in OR operate ,if OR change to SEARCH('',null) there was a major mistake,because SEARCH has three return values (true,false,null),but OR Operate only can return (true,false),so wo can't change (IS_NULL OR ...) to SEARCH('',null); > 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)