flink
flink copied to clipboard
[FLINK-32263]-table-Add-ELT-function
What is the purpose of the change
Implement the elt function to extract the n-th input value from a row of inputs. The elt function in the ETL pipeline extracts the value at the n-th position from a input row. It is similar to array indexing, where the first element is at position 1. This function provides a convenient way to retrieve specific elements from a row of inputs.
Brief change log
ELT for Table API and SQL
Verifying this change
Syntax:
ELT(row, n)
Arguments: row: input row, it can contain mixed type data. n: The index of the input value to extract. It should be a positive integer.
Returns: Returns the element at the n-th position from a row of input values. If 'n' is less than 1 or greater than the number of inputs, or if any of the inputs is null, the function will return null.
Examples:
SELECT ELT(('scala', 'java'), 2)
Output: 'java'
SELECT ELT((2, 'a'), 1)
Output: 2
See also: spark:https://spark.apache.org/docs/latest/api/sql/index.html#elt
Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): (yes / no)
- The public API, i.e., is any changed class annotated with
@Public(Evolving)
: (yes / no) - The serializers: (yes / no / don't know)
- The runtime per-record code paths (performance sensitive): (yes / no / don't know)
- Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (yes / no / don't know)
- The S3 file system connector: (yes / no / don't know)
Documentation
- Does this pull request introduce a new feature? (yes / no)
- If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
CI report:
- 3909532819df8eecaf7140a1d18f6ae77a6253b7 Azure: SUCCESS
Bot commands
The @flinkbot bot supports the following commands:-
@flinkbot run azure
re-run the last Azure build
@flinkbot run azure
@flinkbot run azure