Repository navigation
fix(variant): write parquet field ids in shredded physical schema - #379
Merged
Merged
Conversation
The generated physical schema of a shredded Variant column carried no `paimon.id`, so the parquet writer emitted no field id for `metadata`, `value`, `typed_value` or any of their descendants. Java Paimon converts the whole Variant group with its generic `ParquetSchemaConverter`, which dereferences the field id of every converted field, so reading such a file threw a NullPointerException before the first row. Configured, inferred and adaptive shredding share this schema construction, so all three produced files that only paimon-cpp could read. Number the generated fields the way the Java `PaimonShreddingUtils` does: each level is numbered from 0 in insertion order, an object field keeps the id from the shredding schema or its position when it has none, and an array element takes the id `ParquetSchemaConverter` generates for it.
SteNicholas
force-pushed
the
PAIMON-344
branch
from
September 21, 2026 09:50
03af658 to
54aae15
Compare
Member
|
Thanks to @SteNicholas for the fix. @suxiaogang223 , could you please check again whether the issue is resolved after this PR is merged? Thanks! |
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.
Purpose
Linked issue: close #344
The generated physical schema of a shredded Variant column carried no
paimon.id, so the parquetwriter emitted no field id for
metadata,value,typed_valueor any of their descendants. JavaPaimon converts the whole Variant group with its generic
ParquetSchemaConverter, whichdereferences the field id of every converted field, so reading such a file threw a
NullPointerExceptionbefore the first row. Configured, inferred and adaptive shredding share thisschema construction, so all three produced files that only paimon-cpp could read.
This numbers the generated fields the way the Java
PaimonShreddingUtilsdoes: each level isnumbered from 0 in insertion order, an object field keeps the id from the shredding schema or its
position when it has none, and an array element takes the id
ParquetSchemaConvertergenerates forit (
SpecialFields.getArrayElementFieldId).Tests
VariantShreddingTest.ShreddingSchemaFieldIdsVariantShreddingTest.ShreddingSchemaRejectsInvalidFieldIdsVariantShreddingTest.ShreddingArraySchemaFieldIdsVariantParquetTest.ShreddedWriteAndReadRoundTrip, extended to assert the raw parquet footerfield ids of the whole shredded subtree under the configured, per-file and adaptive shredding
modes
SpecialFieldsTest.TestGetArrayElementFieldId, pinning the generated element id against thevalues the Java
SpecialFieldsproducesAPI and Format
No public API change. The storage format of shredded Variant columns changes: the generated
physical fields now carry parquet field ids, matching what the Java writer produces. Files written
before this change remain readable by paimon-cpp.
Documentation
No, this is a bug fix and introduces no new feature.
Generative AI tooling
Generated-by: Claude Code (Claude Opus 5)