Skip to content

Conversation

bogao007
Copy link
Contributor

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

@HyukjinKwon HyukjinKwon changed the title [SPARK-49744] Implement TTL support for ListState in TransformWithStateInPandas [SPARK-49744][SS] Implement TTL support for ListState in TransformWithStateInPandas Sep 25, 2024
@HyukjinKwon HyukjinKwon changed the title [SPARK-49744][SS] Implement TTL support for ListState in TransformWithStateInPandas [SPARK-49744][SS][PYTHON[ Implement TTL support for ListState in TransformWithStateInPandas Sep 25, 2024
@HyukjinKwon HyukjinKwon changed the title [SPARK-49744][SS][PYTHON[ Implement TTL support for ListState in TransformWithStateInPandas [SPARK-49744][SS][PYTHON] Implement TTL support for ListState in TransformWithStateInPandas Sep 25, 2024
Copy link
Contributor

@HeartSaVioR HeartSaVioR left a 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 !

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.
Copy link
Contributor

@HeartSaVioR HeartSaVioR Oct 4, 2024

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.

Copy link
Contributor Author

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!

@HeartSaVioR
Copy link
Contributor

Thanks! Merging to master.

himadripal pushed a commit to himadripal/spark that referenced this pull request Oct 19, 2024
…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 <[email protected]>
Signed-off-by: Jungtaek Lim <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants