[WIP][NEED-HUMAN-REVIEW] Support Multiple Stateful Operators in Update Mode#55250
Closed
HeartSaVioR wants to merge 2 commits intoapache:masterfrom
Closed
[WIP][NEED-HUMAN-REVIEW] Support Multiple Stateful Operators in Update Mode#55250HeartSaVioR wants to merge 2 commits intoapache:masterfrom
HeartSaVioR wants to merge 2 commits intoapache:masterfrom
Conversation
…without aggregation When a streaming query does not contain a streaming aggregation, Update mode is equivalent to Append mode. This means multiple stateful operators should be supported in Update mode as well, as long as there is no streaming aggregation. Previously, `Deduplicate` without event-time columns was not counted as a stateful operation in `isStatefulOperation`, which was an exception allowing some multi-stateful-op patterns to work in Update mode for the wrong reason. This change removes that exception and properly classifies all `Deduplicate` as stateful operations, which is consistent with their physical execution. The existing `ifCannotBeFollowedByStatefulOperation` + `checkStreamingQueryGlobalWatermarkLimit` logic already correctly handles the validation: non-aggregation stateful operators are not flagged, so they can freely chain with each other in any output mode.
…ator position in Update mode Placing streaming aggregation as the last stateful operator (closest to the sink) in Update mode enables early firing from aggregation combined with multiple stateful operators upstream -- a benefit that Append mode cannot provide. If streaming aggregation is NOT at the last stateful operator position, it remains disallowed in Update mode. The existing `ifCannotBeFollowedByStatefulOperation` logic already correctly handles this: Aggregate in non-Append mode is flagged, so it fails when it appears as a descendant of another stateful operator. When Aggregate is at the root (last), no stateful ancestor exists, so the check passes. This commit adds unit tests in UnsupportedOperationsSuite mirroring the existing Append mode coverage, and integration tests in MultiStatefulOperatorsSuite verifying the end-to-end behavior.
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 changes were proposed in this pull request?
Why are the changes needed?
Does this PR introduce any user-facing change?
How was this patch tested?
Was this patch authored or co-authored using generative AI tooling?