[FLINK-35661][table] Fix MiniBatchGroupAggFunction silently dropping records (backport #27505)#28262
Open
nateab wants to merge 1 commit into
Open
[FLINK-35661][table] Fix MiniBatchGroupAggFunction silently dropping records (backport #27505)#28262nateab wants to merge 1 commit into
nateab wants to merge 1 commit into
Conversation
…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. (cherry picked from commit b81b124)
Collaborator
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.
Backport of #27505 to
release-1.20.What is the purpose of the change
This pull request 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 fix by simulating a bundle with multiple keys where the first key has only retractionsVerifying 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:Backport notes:
release-1.20:Tests run: 1, Failures: 0, Errors: 0.Does this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation