You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2023/06/10 19:01:00 UTC

[jira] [Comment Edited] (CALCITE-5657) Add ARRAY_DISTINCT for Spark dialect

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

Julian Hyde edited comment on CALCITE-5657 at 6/10/23 7:00 PM:
---------------------------------------------------------------

If the list is short, it's more efficient to test whether the list is distinct before creating a {{LinkedHashSet}}. Also, regardless of the size of the list, it's worth checking whether the list is just a single element, repeated. See {{Util.distinctList(List)}}.


was (Author: julianhyde):
If the list is short, it's more efficient to test whether the list is distinct before creating a HashSet. See {{Util.distinctList(List)}}.

> Add ARRAY_DISTINCT for Spark dialect
> ------------------------------------
>
>                 Key: CALCITE-5657
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5657
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.34.0
>            Reporter: jackylau
>            Assignee: jackylau
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.35.0
>
>          Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> {{ARRAY_DISTINCT}} - Returns the input ARRAY with unique elements. If the array itself is null, the function will return null. Keeps ordering of elements.
> For more details
> https://spark.apache.org/docs/latest/sql-ref-functions-builtin.html



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