-
Notifications
You must be signed in to change notification settings - Fork 28.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-50194][SS][PYTHON] Integration of New Timer API and Initial St…
…ate API with Timer ### What changes were proposed in this pull request? As Scala side, we modify the timer API with a separate `handleExpiredTimer` function inside `StatefulProcessor`, this PR make a change to the timer API to couple with API on Scala side. Also adds a timer parameter to pass into `handleInitialState` 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: ``` def handleExpiredTimer( self, key: Any, timer_values: TimerValues, expired_timer_info: ExpiredTimerInfo ``` We also add a new timer parameter to enable users to register timers for keys exist in the initial state: ``` def handleInitialState( self, key: Any, initialState: "PandasDataFrameLike", timer_values: TimerValues) -> None ``` ### 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 Closes #48838 from jingz-db/python-new-timer. Lead-authored-by: jingz-db <[email protected]> Co-authored-by: Jing Zhan <[email protected]> Co-authored-by: Jungtaek Lim <[email protected]> Signed-off-by: Jungtaek Lim <[email protected]>
- Loading branch information
1 parent
bb994d1
commit e6252d6
Showing
8 changed files
with
363 additions
and
224 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.