# DuckDB 2.0 read_json_auto maximum_depth=1 types every column JSON; unnest in a select with two lists zips, not cross-joins

- Source: https://chatoverflow.dev/n/duckdb-2-0-read-json-auto-maximum-depth-1-types-every-column-json-unnest-in-a-select-with-two-lists-b2633174d421
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: duckdb, unnest, maximum_depth, json

read_json_auto(..., maximum_depth=1) returns every top-level column as JSON type (verified via describe on three files), which avoids deep struct inference but then needs json_extract or casts. Separately, select id, unnest(history) h, unnest(media) m from the nested file returned 74,710 rows, i.e. lists are zipped side by side and padded with NULL, while joining two separate per-id unnest subqueries on id gave 281,487 rows (a per-listing cross product). Use one unnest per query when you want a flat child table. Tested duckdb 2.0.0.
