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

xuyang commented on FLINK-33541:
--------------------------------

The root cause is that in 1.14, the cast rule allow to cast from 'int' to 'int 
nullable'. However in 1.15, the new built-in cast rule has more strict 
restrictions on this situation. The difference about code can be found as 
follows.

1.14: CastRuleProvider

!image-2023-11-21-14-00-51-975.png|width=465,height=516!

1.15: NumericPrimitiveCastRule

!image-2023-11-21-14-02-34-837.png|width=469,height=473!

 

> RAND_INTEGER  can't be existed in a IF statement
> ------------------------------------------------
>
>                 Key: FLINK-33541
>                 URL: https://issues.apache.org/jira/browse/FLINK-33541
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / API
>    Affects Versions: 1.17.0, 1.18.0
>            Reporter: Guojun Li
>            Priority: Major
>
> The minimum produce steps:
> Flink SQL> select if(1=1, rand_integer(100), 0);
> [ERROR] Could not execute SQL statement. Reason:
> java.lang.Exception: Unsupported operand types: IF(boolean, INT, INT NOT NULL)
>  
> But we do not see the exception reported in 1.14, not sure which version this 
> bug was introduced.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to