Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-32263

Add ELT support in SQL & Table API

    XMLWordPrintableJSON

Details

    Description

      Implement the elt function to extract the n-th input value from a list of inputs.

      Description:
      The elt function in the ETL pipeline extracts the value at the n-th position from a list of input values. 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 list of inputs.

      Syntax:

       

      elt[n: int, *inputs: str] -> str or None

       

      Arguments:

      n: The index of the input value to extract. It should be a positive integer.
      *inputs: Variable-length arguments representing the list of inputs.

      Returns:
      The value at the n-th position in the list of inputs. If the index exceeds the length of the array, the function returns NULL. 

      Examples:

      Retrieving the second element from a list of strings:

      elt(2, 'scala', 'java')
      Output: 'java'

      Retrieving the second element from a list of mixed types:

      
      result = elt(2, 'a', 1)
      Output: 1

      See also:

       

      spark:https://spark.apache.org/docs/latest/api/sql/index.html#elt

       

       

      Attachments

        Issue Links

          Activity

            People

              hanyuzheng Hanyu Zheng
              bvarghese Bonnie Varghese
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: