[FLINK-35661][table] Fix MiniBatchGroupAggFunction silently dropping records (backport 2.0)#27574
Open
nateab wants to merge 1 commit intoapache:release-2.0from
Open
[FLINK-35661][table] Fix MiniBatchGroupAggFunction silently dropping records (backport 2.0)#27574nateab wants to merge 1 commit intoapache:release-2.0from
nateab wants to merge 1 commit intoapache:release-2.0from
Conversation
Collaborator
rionmonster
approved these changes
Feb 11, 2026
Contributor
|
@flinkbot run azure |
Contributor
|
@nateab , ditto please check the CI failures if they are related to your changes. |
Contributor
Author
|
flaky failure that just got fixed recently, let me rebase and push https://issues.apache.org/jira/browse/FLINK-39052 |
…records When finishBundle() encounters a key with only retraction messages and no existing state, it now uses 'continue' instead of 'return' to skip that key and continue processing remaining keys in the bundle. This change adds a unit test using KeyedOneInputStreamOperatorTestHarness with KeyedMapBundleOperator to verify the fix.
63ae110 to
7481e6c
Compare
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.
What is the purpose of the change
Backport of #27505 to
release-2.0.This fixes a bug in
MiniBatchGroupAggFunction.finishBundle()where records were being silently dropped when a mini-batch bundle contained a key with only retraction messages and no existing accumulator state.The root cause was using
returninstead ofcontinuewheninputRowsbecame empty after filtering out leading retraction messages for a key with no state. This caused the method to exit entirely, abandoning processing of all remaining keys in the bundle.Brief change log
return;tocontinue;inMiniBatchGroupAggFunction.finishBundle()so processing continues to the next key instead of exiting the entire methodMiniBatchGroupAggFunctionTestthat directly verifies the fixVerifying this change
This change added tests and can be verified as follows:
MiniBatchGroupAggFunctionTest.testFinishBundleContinuesAfterEmptyInputRows()which creates a mock bundle with three keys where the first key has only a DELETE message (no existing state). The test verifies that keys after the first are still processed correctly.