Conversation
xiaoh1024
marked this pull request as ready for review
September 21, 2026 18:00
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.
What changes were proposed in this pull request?
Extract necessary predicates when a V2 scan filter cannot be fully translated, for both
SupportsPushDownFiltersandSupportsPushDownV2Filters. Retain the original expression for post-scan filtering.For example,
id = 1 OR (id = 2 AND split(name, ',')[0] = 'fred')can pushid = 1 OR id = 2while Spark evaluates the original condition.Why are the changes needed?
An unsupported expression in one branch currently prevents the entire OR predicate from being pushed down, even when both branches imply a translatable condition. Extracting that condition lets the data source filter rows earlier.
Does this PR introduce any user-facing change?
Yes. Eligible V2 scans push an additional filter; query results are unchanged.
How was this patch tested?
Added regression tests covering both filter APIs, residual filtering, NULL values, unsupported OR branches, NOT, non-deterministic expressions, and fully translatable filters. Added an H2 JDBC test checking the pushed predicate and query results.
Was this patch authored or co-authored using generative AI tooling?
Yes.