Add variant type support to ParquetTypeVisitor#14588
Merged
Merged
Conversation
Implement variant(GroupType) method in ParquetTypeVisitor and all subclasses to enable proper handling of Parquet variant logical types during schema conversion and manipulation operations.
Contributor
|
cc @aihuaxu |
aihuaxu
reviewed
Nov 16, 2025
aihuaxu
left a comment
Contributor
There was a problem hiding this comment.
Minor comments. Otherwise looks good.
- Replace variant spec version with constant - Add variant tests
huaxingao
reviewed
Nov 17, 2025
huaxingao
reviewed
Nov 17, 2025
huaxingao
approved these changes
Nov 18, 2025
Contributor
Contributor
|
@tmater Could you please back-port this fix to 1.10.x? Thanks! |
tmater
added a commit
to tmater/iceberg
that referenced
this pull request
Nov 19, 2025
* Parquet: Add variant type support to ParquetTypeVisitor Implement variant(GroupType) method in ParquetTypeVisitor and all subclasses to enable proper handling of Parquet variant logical types during schema conversion and manipulation operations. * Address review comments - Replace variant spec version with constant - Add variant tests * Column id reordering * Address review comments
Contributor
Author
|
Thank you for the reviews @huaxingao, @aihuaxu! Created a cherry-pick PR to 1.10.x: #14624 |
huaxingao
pushed a commit
that referenced
this pull request
Nov 19, 2025
* Parquet: Add variant type support to ParquetTypeVisitor Implement variant(GroupType) method in ParquetTypeVisitor and all subclasses to enable proper handling of Parquet variant logical types during schema conversion and manipulation operations. * Address review comments - Replace variant spec version with constant - Add variant tests * Column id reordering * Address review comments
3 tasks
thomaschow
pushed a commit
to thomaschow/iceberg
that referenced
this pull request
Jan 19, 2026
* Parquet: Add variant type support to ParquetTypeVisitor Implement variant(GroupType) method in ParquetTypeVisitor and all subclasses to enable proper handling of Parquet variant logical types during schema conversion and manipulation operations. * Address review comments - Replace variant spec version with constant - Add variant tests * Column id reordering * Address review comments
talatuyarer
pushed a commit
to talatuyarer/iceberg
that referenced
this pull request
Apr 1, 2026
* Parquet: Add variant type support to ParquetTypeVisitor Implement variant(GroupType) method in ParquetTypeVisitor and all subclasses to enable proper handling of Parquet variant logical types during schema conversion and manipulation operations. * Address review comments - Replace variant spec version with constant - Add variant tests * Column id reordering * Address review comments
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.
Summary
Adds variant type support to
ParquetTypeVisitorand all its subclasses to enable proper handling of Parquet variant logical types during schema operations.Background
This issue surfaced when using
ParquetUtil.footerMetrics(), which callsconvertAndPrune()on the Parquet schema.TestVariantMetricsuseswriteParquet()and callsParquetMetrics.metrics()directly, which bypasses the schema conversion path and didn't expose this gap. Without thevariant()method implementations, variant fields were being skipped during schema conversion, which then caused an NPE inTypeWithSchemaVisitorwhen it tried to process the variant field that was missing from the converted schema.Changes
variant(GroupType)method toParquetTypeVisitorbase classvariant()in allParquetTypeVisitorsubclasses:MessageTypeToType- converts Parquet variant to IcebergVariantTypeApplyNameMapping- applies name mappings to variant fieldsParquetSchemaUtil.HasIds- checks for field IDs in variant typesRemoveIds- removes IDs from variant schemastestVariantTypeConversion()inTestParquetSchemaUtilTesting
New test validates schema conversion from Parquet variant logical type to Iceberg
VariantType.