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

[jira] [Created] (FLINK-35987) Add ELT function

Dylan He created FLINK-35987:
--------------------------------

             Summary: Add ELT function
                 Key: FLINK-35987
                 URL: https://issues.apache.org/jira/browse/FLINK-35987
             Project: Flink
          Issue Type: Sub-task
          Components: Table SQL / API
            Reporter: Dylan He


Add ELT function.
----
Returns the n-th expression.

Example:
{code:sql}
> SELECT ELT(1, 'scala', 'java');
 scala
{code}

Syntax:
{code:sql}
ELT(index, expr...)
{code}

Arguments:
 * {{index}}: An INTEGER expression.
 * {{expr}}: Any expression that shares a least common type with all {{expr}}..

Returns:
The result has the type of the least common type of all {{expr}}.
{{index}} must be between 1 and the number of {{expr}}. Otherwise, the function returns an error.

See also:
 * [Spark|https://spark.apache.org/docs/3.5.1/sql-ref-functions-builtin.html#string-functions]
 * [Databricks|https://docs.databricks.com/en/sql/language-manual/functions/elt.html]
 * [MySQL|https://dev.mysql.com/doc/refman/8.4/en/string-functions.html#function_elt]



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