fix: preserve no-filter SMJ matches across pending outer batches#23049
Open
neilconway wants to merge 2 commits into
Open
fix: preserve no-filter SMJ matches across pending outer batches#23049neilconway wants to merge 2 commits into
neilconway wants to merge 2 commits into
Conversation
895944d to
421e249
Compare
Contributor
Author
Contributor
|
Thank you for catching this and for the clear explanation. I believe the fix is correct. setting |
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?
fuzz_cases::join_fuzz::test_left_anti_join_1k#23048Rationale for this change
When the no-filter bitwise sort-merge join path finds a matching key,
it advances the inner cursor past that key before marking all matching
outer rows. If the outer key group continues into the next outer batch
and polling that batch returns
Pending,poll_joinresumes from itstop-level state with the inner cursor already past the matched key.
On resume, the stream still retained the already-emitted outer batch.
That stale batch caused the pending boundary state to be applied to the
wrong batch and then discarded. When the actual next outer batch was
loaded later, rows continuing the matched key could compare as
Lessthanthe current inner key and be incorrectly treated as unmatched.
Fix this by clearing
outer_batchafter emitting the fully consumed batchand before polling for the next outer batch. This makes the resumed
top-level state load the actual next outer batch before applying
resume_boundary, matching the filtered code path.What changes are included in this PR?
Are these changes tested?
Yes.
Are there any user-facing changes?
No.