Repository navigation
Core: Control inferred column metrics and collect nested bounds - #4458
Open
Anurag-S1ngh wants to merge 2 commits into
Open
Anurag-S1ngh wants to merge 2 commits into
Anurag-S1ngh wants to merge 2 commits into
Conversation
Nested fields were downgraded to counts-only statistics, which prevents bounds pruning for struct fields such as GeoParquet bounding boxes. Add write.metadata.metrics.max-inferred-column-defaults, defaulting to 100, and apply the default mode to at most that many primitive fields, matching the Java MetricsConfig. An explicitly configured default mode still applies to every column, and per-column overrides still work beyond the limit. With the limit in place, nested fields collect the same bounds as top-level fields.
property_as_int can return None, which mypy flagged on Python 3.11.
This branch has not been deployed
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.
Rationale for this change
Nested fields were downgraded to counts-only statistics in writer stats planning, so struct columns could not be pruned on bounds. That matters for schemas such as GeoParquet, which keep bounding boxes in struct fields.
Add
write.metadata.metrics.max-inferred-column-defaults(default 100) and applywrite.metadata.metrics.defaultto at most that many primitive fields, mirroring Java's MetricsConfig. With the limit in place, nested fields collect the same bounds as top-level fields.Behavior details:
write.metadata.metrics.defaultis set explicitly, it still applies to every column.write.metadata.metrics.column.*overrides still apply to columns beyond the limit.Are these changes tested?
Yes. New tests cover the limit, overrides beyond the limit, the explicit default bypassing the limit, and the negative fallback. Existing stats tests were updated to expect nested bounds.
tests/io/test_pyarrow_stats.py,tests/table, and the local write tests pass.Are there any user-facing changes?
Yes. Nested columns now collect bounds by default, and tables with more than 100 primitive columns stop collecting inferred metrics beyond the first 100 unless they configure a default mode or per-column overrides.