[ https://issues.apache.org/jira/browse/FLINK-31602?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated FLINK-31602: ----------------------------------- Labels: pull-request-available (was: ) > Add ARRAY_POSITION supported in SQL & Table API > ----------------------------------------------- > > Key: FLINK-31602 > URL: https://issues.apache.org/jira/browse/FLINK-31602 > Project: Flink > Issue Type: Improvement > Components: Table SQL / Planner > Affects Versions: 1.18.0 > Reporter: jackylau > Priority: Major > Labels: pull-request-available > Fix For: 1.18.0 > > > array_position(array, element) - Returns the (1-based) index of the first > element of the array as long. > Syntax: > array_position(array, element) > Arguments: > array: An ARRAY to be handled. > Returns: > Returns the position of the first occurrence of element in the given array as > long. > Returns 0 if the given value could not be found in the array. > Returns null if either of the arguments are null > {code:sql} > > SELECT array_position(array(3, 2, 1), 1); > 3 {code} > See also > spark > [https://spark.apache.org/docs/latest/api/sql/index.html#array_remove|https://spark.apache.org/docs/latest/api/sql/index.html#array_position] > postgresql > [https://www.postgresql.org/docs/12/functions-array.html#ARRAY-FUNCTIONS-TABLE] -- This message was sent by Atlassian Jira (v8.20.10#820010)