Repository navigation
Conversation
Contributor
|
can we make these SLT test, please? |
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.
Which issue does this PR close?
Rationale for this change
#27415 reports that enabling
datafusion.execution.collect_statisticscould lose Parquet row-group pruning when a predicate combined expressions supported by statistics with an expression that statistics could not evaluate. For example:For a file where
bodyis entirely NULL andtidis always 9, the supported predicates prove that no row can match. The non-prunablearray_elementterm must be handled conservatively as "may match" at its own subtree, without discarding useful information from the supported sibling predicates.The issue reproduces on the release identified in #27415, but it no longer reproduces on current
main. The file-statistics pruning added by #26441 now removes the impossible file before its Parquet opener runs when statistics collection is enabled. Without collected file statistics, the existing Parquet footer path still prunes the impossible row group.As a result, an additional production-code fix does not appear necessary on current
main. This PR adds focused regression coverage for the original predicate and documents the expected behavior of both pruning paths.What changes are included in this PR?
This PR adds
prune_mixed_supported_and_unsupported_predicate_with_file_statisticsto the Parquet row-group pruning integration tests.The test creates three single-row-group Parquet files:
matches: the supported predicates andarray_elementcomparison all match. The file must be retained and the query returns its row.unsupported_does_not_match: the supported predicates can match, but thearray_elementcomparison is false. Statistics cannot prove that, so the file must be retained and normal row filtering later removes the row.cannot_match:bodyis entirely NULL andtidis always 9, while thearray_elementcomparison is true. The supported predicates alone prove that the file cannot match, so the unsupported expression must not prevent pruning.The query runs with
collect_statisticsboth disabled and enabled. It first checks all three files together and then checks each file independently. The individual checks ensure aggregate metrics cannot hide an incorrect implementation that prunes the conservatively retained file while retaining the actually impossible file.The assertions cover:
No production code or public API is changed.
What is the testing strategy for this PR?
The new regression test exercises the exact mixed prunable/non-prunable predicate under both values of
collect_statisticsand verifies query correctness as well as pruning behavior.The following targeted checks pass:
Are there any user-facing changes?
No. Query results, public APIs, and configuration behavior are unchanged. Current
mainalready performs the desired pruning through the file-statistics path introduced by #26441; this PR protects that behavior with focused regression coverage.