Parquet: Fix variant metrics crash when value column has no stats#16585
Merged
Conversation
wombatu-kun
reviewed
Jun 7, 2026
wombatu-kun
approved these changes
Jun 8, 2026
Collaborator
Author
|
@Fokko PTAL when you get a chance. |
huaxingao
approved these changes
Jun 20, 2026
Contributor
|
Thanks @nssalian for the PR! Thanks @wombatu-kun for the review! |
jakelong95
pushed a commit
to jakelong95/iceberg
that referenced
this pull request
Jun 29, 2026
…ache#16585) * Parquet: Fix variant metrics crash when value column has no stats * Fixup after 16327
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.
Closes #16567
Rationale for this change
Spark writes to Iceberg tables with shredded VARIANT columns crash with
NoSuchElementExceptionduringDataWriter.close()when the variantvaluesub-column has no usable parquetStatistics. Matches the iceberg-go #932 approach for variant sub-columns lacking stats.What changes are included in this PR?
MetricsVariantVisitor.value()returns empty bounds whenvalueResultis empty, instead of callingIterables.getOnlyElementon it.Are these changes tested?
Yes.
testShreddedValueColumnWithEmptyStatswrites a shredded variant with parquet stats disabled. Fails with the issue's exact stack trace without the fix; passes with it.Are there any user-facing changes?
No. Crash becomes graceful drop of bounds for the affected variant column.