[ https://issues.apache.org/jira/browse/FLINK-32969?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lyn Zhang updated FLINK-32969: ------------------------------ Description: If Function will cause NullPointException when the third param is other function. h1. Example: {code:java} CREATE TABLE source ( name STRING , score INT ) WITH ( 'connector' = 'socket', 'hostname' = 'localhost:9999', 'port' = '9999', 'byte-delimiter' = '10', 'format' = 'json' ); CREATE TABLE print( name STRING, score INT ) WITH ('connector' = 'print'); INSERT INTO print SELECT IF(name = 'aa', 'null', CONCAT(name,'x')),score FROM source;{code} –- \{"name":"aa","score":10} h1. Code Generator Result [^if_function_codegen.java] !image-2023-08-28-10-55-26-228.png|width=648,height=317! h1. Exception Stack !image-2023-08-28-11-02-03-842.png|width=707,height=161! was: If Function will cause NullPointException when the third param is other function. h1. Example: {code:java} CREATE TABLE source ( name STRING , score INT ) WITH ( 'connector' = 'socket', 'hostname' = 'localhost:9999', 'port' = '9999', 'byte-delimiter' = '10', 'format' = 'json' ); CREATE TABLE print( name STRING, score INT ) WITH ('connector' = 'print'); INSERT INTO print SELECT IF(name = 'aa', 'null', CONCAT(name,'x')),score FROM source;{code} –- \{"name":"aa","score":10} h1. Code Generator Result [^if_function_codegen.java] !image-2023-08-28-10-55-26-228.png! h1. Exception Stack !image-2023-08-28-11-02-03-842.png! > IfCallGen NullPointException Bug > -------------------------------- > > Key: FLINK-32969 > URL: https://issues.apache.org/jira/browse/FLINK-32969 > Project: Flink > Issue Type: Bug > Components: Table SQL / Planner > Affects Versions: 1.17.1 > Reporter: Lyn Zhang > Priority: Major > Attachments: if_function_codegen.java, > image-2023-08-28-10-55-26-228.png, image-2023-08-28-11-02-03-842.png > > > If Function will cause NullPointException when the third param is other > function. > h1. Example: > {code:java} > CREATE TABLE source ( > name STRING , > score INT > ) WITH ( > 'connector' = 'socket', > 'hostname' = 'localhost:9999', > 'port' = '9999', > 'byte-delimiter' = '10', > 'format' = 'json' > ); > CREATE TABLE print( > name STRING, > score INT > ) WITH ('connector' = 'print'); > INSERT INTO print > SELECT IF(name = 'aa', 'null', CONCAT(name,'x')),score > FROM source;{code} > –- \{"name":"aa","score":10} > > h1. Code Generator Result > [^if_function_codegen.java] > !image-2023-08-28-10-55-26-228.png|width=648,height=317! > h1. Exception Stack > !image-2023-08-28-11-02-03-842.png|width=707,height=161! -- This message was sent by Atlassian Jira (v8.20.10#820010)