dalongliu created FLINK-26947:
---------------------------------
Summary: 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
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.1#820001)