Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-9777

Support UNNEST(ARRAY[STRUCT()])

Details

    • New Feature
    • Status: Open
    • P3
    • Resolution: Unresolved
    • None
    • None
    • dsl-sql-zetasql
    • None

    Description

      It would be nice to be able to UNNEST an array of structs. For example:

      WITH pcol AS
        (SELECT 1 AS key, ARRAY[STRUCT("abc" AS name, "rst" AS slot),STRUCT("def" AS name, "uvw" AS slot)] AS promo
        UNION ALL
        SELECT 2 AS key, ARRAY[STRUCT("ghi" AS name, "xyz" AS slot)] AS promo)
      
      SELECT * FROM pcol, UNNEST(pcol.promo);
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            apilloud Andrew Pilloud
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: