Repository navigation
Read a Parquet LIST or MAP used as a MAP key as Array or Map - #130080
alexey-milovidov merged 1 commit into
Conversation
processSubtreeTuple gives the key of a map the context MapKey, but processSubtreeMap and processSubtreeArrayOuter accepted only None and ListElement. A LIST- or MAP-annotated key group therefore fell through to processSubtreeTuple and was read literally (Tuple(list Array(Tuple(element ...)))), and an explicit Array/Map type, e.g. the one an Iceberg schema supplies for map<array<float>, ...>, failed with TYPE_MISMATCH. Both handlers now accept MapKey. A LIST key requested as Tuple or JSON is still read as the tuple of its children, so the type schema inference returned until now (possibly stored in table metadata) keeps reading; a MAP key requested as Tuple already fell back the same way. A MAP key requested as JSON now gets the map's JSON, like a MAP column in any other position. Closes ClickHouse#130000 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 0 findings), plus my own cold review (2 nits).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-49:20261108-051600 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-6:20261108-041600 |
|
cc @al13n321 @grantholly-clickhouse, could you review this and add the |
|
Workflow [PR], commit [ba18d66] Summary: ✅
AI ReviewSummaryReviewed #130080 at Consumers traced for the changed key representation: Missing context / blind spots
Final VerdictStatus: ✅ Approve. No code changes requested; CI validation remains outstanding. |
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, 17 s compile time in total, 7 of them have a recent master baseline. |
af71c9e
Closes: #130000
Related: #130016
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixed reading Parquet files in which the key of a
MAPis aLISTor aMAP, for example a Spark-written Iceberg table with amap<array<float>, string>column. Such a key was read as aTupleof its Parquet children, so schema inference returnedMap(Tuple(list Array(Tuple(element Nullable(Float32)))), ...)and an explicitMap(Array(Float32), String)type, or any Iceberg table with such a column, failed withTYPE_MISMATCH. The key is now read asArrayorMap. Closes #130000.Description
On 26.10 (
26.10.2.103) and 26.3 LTS, reading a ParquetMAPwhose key is aLISTasMap(Array(Float32), String), or through an Iceberg table with amap<array<float>, ...>column, fails withRequested type of column m.key doesn't match parquet schema: parquet type is Tuple ... (TYPE_MISMATCH).SchemaConvertergives the key of a map the contextMapKey, butprocessSubtreeMapandprocessSubtreeArrayOuteraccepted onlyNoneandListElement, so aLISTorMAPgroup in the key position fell through toprocessSubtreeTupleand was read literally. Both now acceptMapKeytoo. ALISTkey requested asTupleorJSONis still read as the tuple of its children, so the type that schema inference returned until now keeps working (aMAPkey requested asTuplealready did). AMAPkey requested asJSONnow gives the map's JSON, as aMAPcolumn does.The new test covers seven map columns with a
LISTorMAPkey (LISTkeys of two element types, aMAP, a list of lists, a list of maps, and aLISTkey inside a map value and inside an array) throughfile(), plus anIcebergLocaltable. All of them fail on master and pass with the fix, 50/50 with randomized settings. With the fix, the four Doris tables from #130016 give exactly the output in its05720reference.Workflow [PR]
Sync PR [sync-upstream/pr/130080]
Version info
26.11.1.1689-master(included in26.11and later)