feat: Enable creating dynamic filters for both sides; support right side bound collection #18247
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?
dynamic_filter_side; enable dynamic filter pushdown in HashJoinExec #17518 with little refactoringRationale for this change
The first step to fully support dynamic filter pushdown is to allow dynamic filter creation when the build side is on the right. This feature enables right side as the build side, and also implements bound collection from the right.
The concept "build side" here means that either this side is preserved, or its bound can be safely pushed down to the other side without impacting the result. The other side is called "probe side".
What changes are included in this PR?
JoinTypes.JoinTypes.Note: In hash join, we collect the left side at first and get its bound naturally. For right build side, it needs to go through a different path by calculating bounds in
fetch_next_probe, which is not the best practice.TODO: Still looking for ways to make right side bound collection more natural.
Are these changes tested?
Unit test added to test both left join and right join. Bounds are collected correctly.
TODO: verify if any query plan is impacted.
Are there any user-facing changes?
No user-facing changes because the physical plan implementation should be internal.
No breaking change to public APIs.