API: Fix struct metrics in nested struct evaluator test - #17412
Open
nastra wants to merge 1 commit into
Open
Conversation
`FILE_6` in `TestInclusiveMetricsEvaluator` carried value and null counts for the
`required_address` and `optional_address` structs. Parquet produces metrics for leaf
columns only in `ParquetMetrics.MetricsVisitor.struct` and returns just the concatenation of
its children and never emits a `FieldMetrics` for the struct — so no Parquet file yields
those entries. They made `notNull("optional_address")` appear prunable when in practice it is not
uros-b
approved these changes
Jul 29, 2026
dramaticlly
approved these changes
Jul 29, 2026
| shouldRead = | ||
| new InclusiveMetricsEvaluator(NESTED_SCHEMA, isNull("optional_address.required_street2")) | ||
| .eval(FILE_6); | ||
| assertThat(shouldRead).as("Should read: optional_address is optional").isTrue(); |
Contributor
There was a problem hiding this comment.
nit, not related to the change but I think the reason to prune the field 104 and 105 for notNull predicate is a bit different from "optional_address is optional".
Since both are nested within an optional struct, we cannot decide based on schema whether values are nullable or not. The decision is made based on the leaf field metrics (value count = 5 and null count = 5. so all values are null and evaluate to false)
Meant to comment on LINE966, my bad
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.
FILE_6inTestInclusiveMetricsEvaluatorcarried value and null counts for therequired_addressandoptional_addressstructs. Parquet produces metrics for leaf columns only inParquetMetrics.MetricsVisitor.structand returns just the concatenation of its children and never emits aFieldMetricsfor the struct — so no Parquet file yields those entries. They madenotNull("optional_address")appear prunable when in practice it is notproduces, which excludes struct-level value and null counts.