fix: drain PiecewiseMergeJoin output before state transitions - #24298
Open
buraksenn wants to merge 5 commits into
Open
fix: drain PiecewiseMergeJoin output before state transitions#24298buraksenn wants to merge 5 commits into
buraksenn wants to merge 5 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #24298 +/- ##
=======================================
Coverage 81.17% 81.17%
=======================================
Files 1109 1109
Lines 388033 388001 -32
Branches 388033 388001 -32
=======================================
- Hits 314992 314968 -24
+ Misses 54501 54489 -12
- Partials 18540 18544 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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?
PiecewiseMergeJoinchanges state before draining its output coalescer: the Left/Full unmatched pass repeats forever, queued Right/Full rows can be dropped #24297Rationale for this change
ClassicPWMJStreamtransitions phases while its outputBatchCoalescerstill holds completed batches. The Left/Full unmatched pass falls back into its producer when the drained queue is an exact multiple ofbatch_size— emitting duplicate rows forever — and queued unmatched Right/Full batches are dropped at terminal transitions. A zero-row placeholder batch also escapes as stream output on empty results.What changes are included in this PR?
BatchProcessState::next_drained_batch()(finish_buffered_batch+next_completed_batch);Noneguarantees the coalescer is emptyprocess_stream_batchandprocess_unmatched_buffered_batchdrain one batch per poll and transition only after a confirmed-empty pop, so a finished producer can never re-run and no queued batch is lostStatefulStreamResult::Continueinstead of the empty placeholder batch; empty joins now yield no batchesAre these changes tested?
Yes. The existing unmatched Left/Right tests now run with
batch_size = 1(the Left one bounded withtake(6)so the old duplicate loop fails as a snapshot mismatch instead of hanging) — both fail on main and pass here. The empty-join tests assert no batches are emitted.Are there any user-facing changes?
No (PWMJ is experimental and off by default).