You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Jacky Lau (Jira)" <ji...@apache.org> on 2024/03/08 03:23:00 UTC

[jira] [Commented] (FLINK-31663) Add ARRAY_EXCEPT supported in SQL & Table API

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

Jacky Lau commented on FLINK-31663:
-----------------------------------

hi [~dwysakowicz] [~hanyuzheng] [~luoyuxia] , i found the result is not correct.

the pr description is [https://github.com/apache/flink/pull/22588]

we can see it is not contain duplicates, which is same result with spark [https://spark.apache.org/docs/latest/api/sql/index.html#array_except]

but the code logic is contain duplicates. and i think we should align with spark. 
Since the behavior of array_union is already aligned with Spark's, if we don't align here, the logic of the entire function would seem inconsistent. What do you think?
 
 
{code:java}
Flink SQL> SELECT array_except(array[1,2,2], array[2,3,4]);
[1]

Flink SQL> SELECT array_except(array[1,2,2], array[1]);
[2]

Flink SQL> SELECT array_except(array[1,2,2], array[42]);
[1, 2] {code}

> Add ARRAY_EXCEPT supported in SQL & Table API
> ---------------------------------------------
>
>                 Key: FLINK-31663
>                 URL: https://issues.apache.org/jira/browse/FLINK-31663
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Table SQL / API
>            Reporter: luoyuxia
>            Assignee: Hanyu Zheng
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.20.0
>
>




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