Core: Add pruneColumnStats to RewriteManifests#17258
Open
JoeryH wants to merge 1 commit into
Open
Conversation
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 #17257.
Adds a
pruneColumnStats()option toRewriteManifests. When enabled, columnstats that exceed the table's current
write.metadata.metrics.*configurationare dropped as manifests are rewritten: columns configured
nonelose allstats,
countscolumns lose their bounds, andtruncate(n)/fullcolumns areleft unchanged (existing bounds are never re-truncated).
Iceberg infers metrics for up to 100 columns by default, which bloats manifests
and slows planning on wide tables. Tightening the metrics config doesn't shrink
existing manifests today because
RewriteManifestscopies each data file'sstats verbatim. This option lets users reclaim that space during a manifest
rewrite without rewriting the data files.
Pruning applies only to manifests that are actually rewritten. With no
clusterBy(...)set, enabling it triggers a full rewrite so all data files areregrouped. The new
defaultinterface method throwsUnsupportedOperationException, keeping existing implementors compatible.