-
Notifications
You must be signed in to change notification settings - Fork 28.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-49744][SS][PYTHON] Implement TTL support for ListState in TransformWithStateInPandas #48253
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only nit. Thanks @bogao007 !
...main/scala/org/apache/spark/sql/execution/python/TransformWithStateInPandasStateServer.scala
Outdated
Show resolved
Hide resolved
], | ||
) | ||
elif batch_id == 2: | ||
# ttl-count-0 expire and restart from count 0. | ||
# ttl-count-1 get reset in batch 1 and keep the state | ||
# ttl-count-1 get reset in batch 1 and keep the state. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: it may not be very clear what "reset" means here - now I get what you mean, "TTL reset", but I was puzzled and had to think a bit. Same for ttl-list-state-count-1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the comment with more details, thanks!
Thanks! Merging to master. |
…sformWithStateInPandas ### What changes were proposed in this pull request? Implement TTL support for ListState in TransformWithStateInPandas. ### Why are the changes needed? Allow users to add TTL to specific list state. ### Does this PR introduce _any_ user-facing change? Yes ### How was this patch tested? Added unit tests. ### Was this patch authored or co-authored using generative AI tooling? No Closes apache#48253 from bogao007/ttl-list-state. Authored-by: bogao007 <bo.gao@databricks.com> Signed-off-by: Jungtaek Lim <kabhwan.opensource@gmail.com>
What changes were proposed in this pull request?
Implement TTL support for ListState in TransformWithStateInPandas.
Why are the changes needed?
Allow users to add TTL to specific list state.
Does this PR introduce any user-facing change?
Yes
How was this patch tested?
Added unit tests.
Was this patch authored or co-authored using generative AI tooling?
No