-- Query generated by: templates/unnest_parquet_view.sql.py socorro_crash_v2 telemetry_derived.socorro_crash_v2
CREATE OR REPLACE VIEW
  `moz-fx-data-shared-prod.telemetry.socorro_crash_v2`
AS
SELECT
  * REPLACE (
    ARRAY(SELECT * FROM UNNEST(additional_minidumps.list)) AS additional_minidumps,
    ARRAY(SELECT * FROM UNNEST(addons.list)) AS addons,
    (
      SELECT AS STRUCT
        json_dump.* REPLACE (
          (
            SELECT AS STRUCT
              json_dump.crashing_thread.* REPLACE (
                ARRAY(SELECT * FROM UNNEST(json_dump.crashing_thread.frames.list)) AS frames
              )
          ) AS crashing_thread,
          ARRAY(SELECT * FROM UNNEST(json_dump.modules.list)) AS modules,
          ARRAY(
            SELECT AS STRUCT
              _0.element.* REPLACE (ARRAY(SELECT * FROM UNNEST(_0.element.frames.list)) AS frames)
            FROM
              UNNEST(json_dump.threads.list) AS _0
          ) AS threads
        )
    ) AS json_dump,
    (
      SELECT AS STRUCT
        memory_report.* REPLACE (ARRAY(SELECT * FROM UNNEST(memory_report.reports.list)) AS reports)
    ) AS memory_report
  )
FROM
  `moz-fx-data-shared-prod.telemetry_derived.socorro_crash_v2`
