You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Weijie Guo (Jira)" <ji...@apache.org> on 2024/07/10 06:58:09 UTC
[jira] [Updated] (FLINK-32530) array_position semantic should align with array_contains instead of spark
[ https://issues.apache.org/jira/browse/FLINK-32530?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Weijie Guo updated FLINK-32530:
-------------------------------
Fix Version/s: 2.0.0
(was: 1.20.0)
> array_position semantic should align with array_contains instead of spark
> -------------------------------------------------------------------------
>
> Key: FLINK-32530
> URL: https://issues.apache.org/jira/browse/FLINK-32530
> Project: Flink
> Issue Type: Improvement
> Components: Table SQL / Planner
> Affects Versions: 1.18.0
> Reporter: Jacky Lau
> Priority: Major
> Labels: pull-request-available
> Fix For: 2.0.0
>
>
> when i supports array_contains to calcite https://issues.apache.org/jira/browse/CALCITE-5707 i found the spark and flink's behavior is different.
> {code:java}
> spark: array_contains(array[1, null], null) -> null
> flink: array_contains(array[1, null], null) -> true {code}
> so array_remove is also different(the array_remove isĀ supported by me, which aligns with flink).
> {code:java}
> spark: array_remove(array[1, null], null) -> null
> flink: array_remove(array[1, null], null) -> 1 {code}
> while array_position is align with spark, i think it is not correct.
> {code:java}
> spark: array_position(array[1, null], null) -> 2
> flink: array_position(array[1, null], null) -> 2 {code}
> and i test on postgre which is also 2
> {code:java}
> postgre:
> select array_position(ARRAY[1, null], null); {code}
> so the semantic should only follow one way to handle null element. so i think it should be changed
--
This message was sent by Atlassian Jira
(v8.20.10#820010)