You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Timo Walther (Jira)" <ji...@apache.org> on 2022/04/20 13:19:00 UTC

[jira] [Assigned] (FLINK-26947) Add ARRAY_CONTAINS supported in SQL & Table API

     [ https://issues.apache.org/jira/browse/FLINK-26947?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timo Walther reassigned FLINK-26947:
------------------------------------

    Assignee: Timo Walther

> Add ARRAY_CONTAINS supported in SQL & Table API
> -----------------------------------------------
>
>                 Key: FLINK-26947
>                 URL: https://issues.apache.org/jira/browse/FLINK-26947
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Table SQL / API
>            Reporter: dalongliu
>            Assignee: Timo Walther
>            Priority: Major
>             Fix For: 1.16.0
>
>
> Returns true if {{array}} contains {{{}value{}}}.
> Syntax:
> {code:java}
> array_contains(array, value) {code}
> Arguments:
>  * {{{}array{}}}: An ARRAY to be searched.
>  * {{{}value{}}}: An expression with a type sharing a least common type with the {{array}} elements.
> Returns:
> A BOOLEAN. If {{value}} is {{{}NULL{}}}, the result is {{{}NULL{}}}. If any element in {{array}} is {{{}NULL{}}}, the result is {{NULL}} if {{value}} is not matched to any other element.
> Examples:
> {code:java}
> > SELECT array_contains(array(1, 2, 3), 2);
>  true
> > SELECT array_contains(array(1, NULL, 3), 2);
>  NULL
> > SELECT array_conatins(array(1, 2, 3), NULL);
>  NULL {code}
> See more:
>  * [Spark|https://spark.apache.org/docs/latest/sql-ref-functions-builtin.html#date-and-timestamp-functions]
>  * [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf]



--
This message was sent by Atlassian Jira
(v8.20.7#820007)