An array stores multiple values as one nested field. In DuckDB, unpacking an array turns each element into a separate row, making nested JSON easier to query. section 5.3
Flatten shot arrays
Create a reusable shots view by unnesting h and a, then query the resulting rows for analysis. A flattened view can aggregate expected goals and goals by team.
FROM 'xg/shots_*.json' SELECT unnest(h) AS row UNION ALL #1 FROM 'xg/shots_*.json' SELECT unnest(a) AS row LIMIT 3; #2
Run the DuckDB query to see array elements become individual rows. section 5.3







































