Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-9518 UDF support for complex types
  3. IMPALA-10920

UNNEST function for arrays in the select list

    XMLWordPrintableJSON

Details

    • ghx-label-3

    Description

      There is a need for implementing an UNNEST(array) function that could be given in the select list so that we can replicate Postgres functionality that has the very same.

      Considering the following table:

      CREATE TABLE tbl (
        id int,
        arr1 array<int>,
        arr2 array<int>)
      STORED AS PARQUET;
      

      with this data:

      1, {1,2}, {11,22,33}
      

      A sample query would look like this:

      SELECT id, UNNEST(arr1), UNNEST(arr2) FROM tbl;
      
      id unnest(arr1) unnest(arr2)
      1 1 11
      1 2 22
      1 null 33

      Not that the expected is to 'zip' the arrays instead of joining their values to have the same behaviour as Postgres 10+.

      Attachments

        Issue Links

          Activity

            People

              gaborkaszab Gabor Kaszab
              gaborkaszab Gabor Kaszab
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: