Repository navigation
[SPARK-46913][SS] Add support for processing/event time based timers with transformWithState operator - #45051
Closed
anishshri-db wants to merge 39 commits into
Closed
anishshri-db wants to merge 39 commits into
anishshri-db wants to merge 39 commits into
Conversation
anishshri-db
marked this pull request as draft
February 6, 2024 23:20
…tely and also for each col family in RocksDB state store provider
anishshri-db
marked this pull request as ready for review
February 22, 2024 22:00
Contributor
Author
|
@HeartSaVioR - PTAL, thx ! |
sahnib
reviewed
Feb 27, 2024
sahnib
left a comment
Contributor
There was a problem hiding this comment.
Still reviewing, posting initial set of comments.
sahnib
reviewed
Feb 27, 2024
sahnib
left a comment
Contributor
There was a problem hiding this comment.
Thanks for making these changes.
sahnib
reviewed
Feb 29, 2024
sahnib
left a comment
Contributor
There was a problem hiding this comment.
LGTM. One minor comment, thanks.
HeartSaVioR
reviewed
Mar 8, 2024
HeartSaVioR
left a comment
Contributor
There was a problem hiding this comment.
Went through implementation part, will continue with tests.
HeartSaVioR
reviewed
Mar 8, 2024
HeartSaVioR
left a comment
Contributor
There was a problem hiding this comment.
Done reviewing for the first round.
Contributor
|
Thanks! Merging to master. |
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?
Add support for processing/event time based timers with
transformWithStateoperatorWhy are the changes needed?
Changes are required to add event-driven timer based support for stateful streaming applications based on arbitrary state API with the
transformWithStateoperatorAs part of this change - we introduce a bunch of functions that users can use within the
StatefulProcessorlogic. Using theStatefulProcessorHandle, users can do the following:Note that all the above operations are tied to the implicit grouping key.
In terms of the implementation, we make use of additional column families to support the operations mentioned above. For registered timers, we maintain a primary index (as a col family) that keeps the mapping between the grouping key and expiry timestamp. This col family is used to add and delete timers with direct access to the key and also for listing registered timers for a given grouping key using
prefix scan. We also maintain a secondary index that inverts the ordering of the timestamp and grouping key. We will incorporate the use of the range scan encoder for this col family in a separate PR.Few additional constraints:
_are reserved and cannot be used as state variablestimeoutModeto the operator. Currently, they can choose to not register timeouts or register timeouts that are processing-time based or event-time based. However, this mode has to be declared upfront within the operator arguments.Does this PR introduce any user-facing change?
Yes
How was this patch tested?
Added unit tests as well as pseudo-integration tests
StatefulProcessorHandleSuite
TransformWithStateSuite
Was this patch authored or co-authored using generative AI tooling?
No