[SPARK-50194][SS][PYTHON] Integration of New Timer API and Initial State API with Timer #48838
+192
−128
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?
As Scala side, we modify the timer API with a separate
handleExpiredTimer
function insideStatefulProcessor
, this PR make a change to the timer API to couple with API on Scala side. Also adds a timer parameter to pass intohandleInitialState
function to support use cases for registering timers in the first batch for initial state rows.Why are the changes needed?
This change is to couple with Scala side of APIs: #48553
Does this PR introduce any user-facing change?
Yes.
We add a new user defined function to explicitly handle expired timeres:
We also add a new timer parameter to enable users to register timers for keys exist in the initial state:
How was this patch tested?
Add a new test in
test_pandas_transform_with_state
Was this patch authored or co-authored using generative AI tooling?
No