[client] Fix early termination in SortMergeReader on changelog deletes#3135
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes SortMergeReader early termination when a snapshot row is deleted by changelog during sort-merge reading (issue #3134), ensuring iteration continues until snapshot input is actually exhausted.
Changes:
- Update
SnapshotMergedRowIteratorWrapper#hasNext()to skipSortMergeRows.EMPTYresults instead of treating them as end-of-input. - Add a regression test that verifies deleted snapshot keys are skipped while later snapshot rows are still returned.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
fluss-client/src/main/java/org/apache/fluss/client/table/scanner/SortMergeReader.java |
Adjusts iterator hasNext() to advance past empty merge results caused by deletes. |
fluss-client/src/test/java/org/apache/fluss/client/table/scanner/SortMergeReaderTest.java |
Adds coverage for snapshot rows deleted by changelog deletes (ensures scan doesn’t stop early). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
|
LGTM! |
luoyuxia
added a commit
to luoyuxia/fluss
that referenced
this pull request
Apr 20, 2026
apache#3135) (cherry picked from commit 776102c)
Ugbot
pushed a commit
to Ugbot/fluss
that referenced
this pull request
Apr 26, 2026
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.
Purpose
Linked issue: close #3134
Fix
SortMergeReaderreturning early when changelog deletes match snapshot rows during sort-merge reading.Brief change log
SnapshotMergedRowIteratorWrapper#hasNext()to skip empty merge results instead of treating them as end-of-inputTests
./mvnw -pl fluss-client spotless:check -DskipTests -Dmaven.test.skip=true./mvnw -pl fluss-client checkstyle:check -DskipTests -Dmaven.test.skip=true./mvnw test -pl fluss-client -Dtest=SortMergeReaderTest -Dcheckstyle.skip=true -Dpmd.skip=true -Dspotless.check.skip=true -Dmaven.javadoc.skip=true, but module test compilation is currently blocked by pre-existing errors influss-client/src/test/java/org/apache/fluss/client/table/LakeEnableTableITCase.javareferencingDATALAKE_ENABLEDAPI and Format
No API or storage format changes.
Documentation
No documentation changes are required.