Repository navigation
Fix reading structs inside arrays and maps of Delta Lake tables with column mapping - #129103
Conversation
…column mapping With column mapping (`delta.columnMapping.mode` = `id` or `name`), the fields of a struct are stored in data files under their physical names. The names were translated only for structs that are columns or fields of other structs, but not inside `Array` and `Map`, so such fields were not found in the Parquet file and an `Array(Tuple(...))` column was read as `[]`, and the values of a `Map(..., Tuple(...))` column as `(NULL)`, without an error. A subcolumn like `array_of_structs.field` failed with `INCORRECT_DATA`. Translate the names inside arrays and maps (the schema visitor already records them under the names of the kernel for an array element and a map key and value), and resolve a requested subcolumn of an array or a map through the physical type of its column. The tables of the test are the golden tables `table-with-columnmapping-mode-id` and `table-with-columnmapping-mode-name` of delta-kernel-rs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Workflow [PR], commit [fca1c7f] Summary: ✅
AI ReviewSummaryPR #129103, at Missing context / blind spots
Final VerdictStatus: ✅ Approve based on source review and the supplied regression coverage; runtime validation remains subject to CI. |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units7 translation units recompiled, 13 s compile time in total, 7 of them have a recent master baseline. |
…fixtures The columns `ls` (`Array(Tuple(...))`) and `m` (`Map(..., Tuple(...))`) of `spark_nested_name_mode` and `spark_nested_id_mode` were not queried because ClickHouse read them incorrectly; it is fixed now. The results are the same as expected by duckdb-delta. Related: #129103 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…g fix The column-mapped tables (`column_mapping_id`, `delta332_column_mapping_id`, `iceberg_compat_v2`) are now read the same as their writers read them, including structs inside arrays and maps and their subcolumns. Related: #129103 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The tables `table-with-columnmapping-mode-id` and `table-with-columnmapping-mode-name` were added with the fix of reading structs inside arrays and maps under column mapping. Related: #129103 Co-Authored-By: Claude Opus 5.5 <[email protected]>
With column mapping (
delta.columnMapping.mode=idorname), the fields of a struct inside an array or a map of a Delta Lake table were read incorrectly without an error: anArray(Tuple(...))column was read as[]and the values of aMap(..., Tuple(...))column as(NULL), because the logical names of the struct fields were translated to physical names only for structs that are columns or fields of other structs. A subcolumn likearray_of_structs.fieldfailed withINCORRECT_DATA.The names are now translated inside arrays and maps as well, and a subcolumn of an array or a map is resolved through the physical type of its column.
The test uses the golden tables
table-with-columnmapping-mode-idandtable-with-columnmapping-mode-nameof delta-kernel-rs (written by Spark), and compares the result with their expected data. The fix also makes the column-mapped tables of the Delta corpus of #129100 (written by Spark 4.1 and 3.5) and thespark_nested_*_modefixtures of duckdb-delta from #129094 read the same as their writers read them.Related: #129093
Related: #129094
Related: #129100
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix reading structs inside arrays and maps of Delta Lake tables with column mapping: such columns were read as empty arrays or default values, and their subcolumns failed with
INCORRECT_DATA.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/129103]
Version info
26.11.1.1387-master(included in26.11and later)