Use the effective predicate when doing partition matching #20256
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.
Description
Use the effective predicate instead of the dynamic filter predicate to check for partition matching.
This change results in short circuiting the page source and not having to read anymore the data file footer in the exotic case where a partition filter acts as unenforced
predicate due to table partition spec evolution.
This PR is a follow-up of the hint #20212 (comment)
Additional context and related issues
Imagine the following scenario:
If the table
iceberg.default.t1
(with the filtermonth = 1
- which is unenforced due to partition spec evolution) would be involved in aJOIN
operation and the dynamic filter from the build table would prove to be very selective (e.g. year = 2023), it makes sense for us to use the unenforced filter as well in checking whether we should read at all the data file.Before this change, the page source provider was just using the dynamic filter for partition matching which can potentially result in processing unnecessary data files.
Release notes
(x) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text: