[
https://issues.apache.org/jira/browse/FLINK-35476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17850041#comment-17850041
]
lincoln lee commented on FLINK-35476:
-------------------------------------
[~lyndon.lee] Thanks for reporting this!
It's a known issue(FLINK-30559) and fixed in 1.16+, due to Flink version
policy(
[update-policy-for-old-releases|https://flink.apache.org/downloads/#update-policy-for-old-releases],
[[DISCUSS] Flink minor version support policy for old
releases|https://lists.apache.org/thread/szq23kr3rlkm80rw7k9n95js5vqpsnbv],
[[DISCUSS]Use 1.15.4 as the final patch version of Flink 1.15 and drop 1.15
support|https://lists.apache.org/thread/csm81mlcktobl00p37x9t2jkpwmj9m58] ),
the fix hasn't been backported to 1.15.
So it is recommended to use a higher version, such as 1.19.0 or 1.18.1(because
there're also several other fixes related to 'if' function since 1.18.0, ref to
FLINK-30966).
> The IF built-in function returns an exception when returning a string
> ---------------------------------------------------------------------
>
> Key: FLINK-35476
> URL: https://issues.apache.org/jira/browse/FLINK-35476
> Project: Flink
> Issue Type: Bug
> Components: Table SQL / API, Table SQL / Runtime
> Affects Versions: 1.15.3
> Reporter: lyndon.lee
> Priority: Critical
> Attachments: image-2024-05-28-17-04-59-069.png
>
>
> The IF built-in function returns an exception when returning a string
> There is no explanation in the official documentation!
> offlical link:
> [https://nightlies.apache.org/flink/flink-docs-release-1.15/docs/dev/table/functions/systemfunctions/]
> Flink version:1.15.1/1.15.3
>
> CASE SQL:
> {code:java}
> select
> if('asd'='asd', '1234', '12345' ) as expect_1234
> , if('asd'='123', '1234', '12345') as expect_12345
> ; {code}
> Expected Result:
>
> {code:java}
> the column expect_1234 value should be '1234'
> the column expect_12345 value should be '12345'{code}
>
>
> Real Returend Result( test in sql-client):
> !image-2024-05-28-17-04-59-069.png|width=495,height=337!
--
This message was sent by Atlassian Jira
(v8.20.10#820010)