-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
perf: Re-write join types during filter pushdown #23275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #23275 +/- ##
==========================================
- Coverage 80.75% 80.74% -0.01%
==========================================
Files 1643 1644 +1
Lines 220327 220892 +565
Branches 2786 2786
==========================================
+ Hits 177919 178355 +436
- Misses 41744 41873 +129
Partials 664 664 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
// Projects the new join output table back into the original join output table. | ||
let mut project_to_original: Option<Vec<ExprIR>> = None; | ||
|
||
if options.args.should_coalesce() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This few hundred lines of code in this branch are specifically to handle the differing output schema of coalescing right-joins 🥲.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to extract coalesce to be a query plan thing and not a join property. Would be nice for this as well.
@@ -652,9 +652,6 @@ def test_predicate_pushdown_join_19772( | |||
|
|||
q = left.join(right, on="k", how=join_type).filter(predicate) # type: ignore[arg-type] | |||
|
|||
plan = q.explain() | |||
assert plan.startswith("FILTER") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filter is now pushed
This PR introduces logic to identify columns that are guaranteed to be non-NULL after applying a filter expression, and then uses that to potentially re-write the join types. After the join-type is re-written, we are then able to push the filters past the join.
Example: Full -> Right join
Example
More examples
Full -> Left join
Full -> Inner join
Left -> Inner join
Right -> Inner join