問題文
An events table has a VARIANT column named payload. Each document holds a top-level order_id and an items array with one element per purchased line. The analyst needs one row per purchased line, with the order_id repeated on each row. Which construct produces that result?
選択肢
- A recursive common table expression over the payload column that walks the array by index and the position until it reaches the end.
- A GROUP BY on order_id combined with ARRAY_AGG, which redistributes the array elements and the payload keys for the order across separate rows.
- A lateral FLATTEN over the items array, which returns one row for each element and lets the query keep the order_id from the outer row.
- A path expression that selects the items array with the colon notation, or with an index, which returns one row for each element it contains and repeats the outer order_id.