fix: normalize nested field names in RecordBatchTransformer#2251
Open
vovacf201 wants to merge 1 commit intoapache:mainfrom
Open
fix: normalize nested field names in RecordBatchTransformer#2251vovacf201 wants to merge 1 commit intoapache:mainfrom
vovacf201 wants to merge 1 commit intoapache:mainfrom
Conversation
* fix: normalize nested field names in RecordBatchTransformer
Parquet files use "item" as the List inner field name (Parquet spec)
while Iceberg uses "element" (Iceberg spec). Similarly, Parquet uses
"entries" for Map inner fields while Iceberg uses "key_value".
The RecordBatchTransformer previously used equals_datatype() (which
ignores field names) to decide between PassThrough and Promote. This
meant columns with mismatched nested field names were passed through
unchanged, causing downstream consumers that use strict schema
validation (like DataFusion's concat_batches) to fail with:
"column types must match schema types, expected List(Field { name:
element ..."
Fix: use a 3-way comparison in generate_transform_operations:
1. Strict == match → PassThrough (no cast needed)
2. equals_datatype() but != (field names differ) → Promote (cast to
normalize names)
3. Neither → Promote (actual type promotion)
* style: apply nightly rustfmt formatting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Parquet files use "item" as the List inner field name (Parquet spec) while Iceberg uses "element" (Iceberg spec). Similarly, Parquet uses "entries" for Map inner fields while Iceberg uses "key_value".
The RecordBatchTransformer previously used
equals_datatype()(which ignores field names) to decide between PassThrough and Promote. This meant columns with mismatched nested field names were passed through unchanged, causing downstream consumers that use strict schema validation (like DataFusion'sconcat_batches) to fail with:"column types must match schema types, expected List(Field { name: element ..."
Fix: use a 3-way comparison in
generate_transform_operations:==match -> PassThrough (no cast needed)equals_datatype()but!=(field names differ) -> Promote (cast to normalize names)Cherry-picked from risingwavelabs/iceberg-rust commit 2e56dde