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

Add MAP_FROM_ENTRIES supported in SQL & Table API

    XMLWordPrintableJSON

Details

    Description

      map_from_entries(map) - Returns a map created from an arrays of row with two fields. Note that the number of fields in a row array should be 2 and the key of a row array should not be null.

      Syntax:
      map_from_entries(array_of_rows)

      Arguments:
      array_of_rows: an arrays of row with two fields.

      Returns:

      Returns a map created from an arrays of row with two fields. Note that the number of fields in a row array should be 2 and the key of a row array should not be null.

      Returns null if the argument is null

      > SELECT map_from_entries(map[1, 'a', 2, 'b']);
       [(1,"a"),(2,"b")]

      See also
      presto https://prestodb.io/docs/current/functions/map.html

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

      Attachments

        Issue Links

          Activity

            People

              jackylau Jacky Lau
              jackylau Jacky Lau
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: