feat(pwmj): support RightSemi/RightAnti existence joins - #24457
Open
SubhamSinghal wants to merge 1 commit into
Open
feat(pwmj): support RightSemi/RightAnti existence joins#24457SubhamSinghal wants to merge 1 commit into
SubhamSinghal wants to merge 1 commit into
Conversation
SubhamSinghal
marked this pull request as ready for review
August 18, 2026 12:57
Contributor
Author
|
benchmark PR: #24458 |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #24457 +/- ##
==========================================
+ Coverage 81.23% 81.26% +0.03%
==========================================
Files 1112 1113 +1
Lines 390635 392183 +1548
Branches 390635 392183 +1548
==========================================
+ Hits 317350 318727 +1377
- Misses 54650 54695 +45
- Partials 18635 18761 +126 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
Author
|
@comphead @kumarUjjawal PR for right semi/anti join. Please help in reviewing this PR. Thanks. |
Contributor
|
Thanks @SubhamSinghal I'll check this today |
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?
Part of #17427 (the PiecewiseMergeJoin epic). This is the second half of its existence-join item: #23870 added
LeftSemi/LeftAnti, this addsRightSemi/RightAnti. Only the Mark joins remain unsupported.Rationale for this change
A range-predicate right semi/anti join —
... RIGHT SEMI JOIN r ON l.v > r.v, or any query that decorrelates to one — currently falls back toNestedLoopJoinExec.What changes are included in this PR?
New
RightExistencePWMJStream(right_existence_join.rs), a 3-state machine: await the buffered reduction, then per streamed batch evaluate the key, compare it against the reduced key with a vectorizedcmpkernel, and filter. Plus:exec.rs— dispatch;build_buffered_extreme, which folds every buffered partition on its ownSpawnedTask;BufferedExtremeas the shared state; relaxed ordering, distribution and partitioning declarations for these two join types; removal of the deadsort_optionsflip and theunimplemented!()placeholder that the swap design had left behind.physical_planner.rs— the gate now excludes only the Mark joins.utils.rs—is_supported_existence_joinwidened; newis_supported_right_existence_join(which deliberately excludesRightMark, so a Mark join cannot inherit the relaxed input requirements if that gate is ever loosened); no visited-indices bitmap allocated for these join types.extreme_keymadepub(super)so both existence streams share one implementation.Are these changes tested?
Yes
Benchmark
Microbenchmark, 20K × 20K rows, single inequality,
enable_piecewise_merge_joinon vs offAre there any user-facing changes?
No