[ 
https://issues.apache.org/jira/browse/FLINK-32969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17759427#comment-17759427
 ] 

Lyn Zhang commented on FLINK-32969:
-----------------------------------

[~luoyuxia] looks like it has been fixed in 1.17.2 and 1.18, I will try to run 
this sql in those versions, this issue closed first.

> 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 a udf.
> 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)

Reply via email to