-
Notifications
You must be signed in to change notification settings - Fork 29.1k
[SPARK-50128][SS] Add stateful processor handle APIs using implicit encoders in Scala #48728
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
Conversation
|
cc - @jingz-db @HeartSaVioR - PTAL, thx ! |
HeartSaVioR
left a comment
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.
The change itself looks good to me.
I feel like requiring users to provide TTLConfig(Duration.ZERO) isn't great though. Shall we check whether we could provide a dedicated instance for this? Like TTLConfig.NONE or TTLConfig.none() (if the former does not work with Java).
sql/api/src/main/scala/org/apache/spark/sql/streaming/StatefulProcessorHandle.scala
Show resolved
Hide resolved
sql/api/src/main/scala/org/apache/spark/sql/streaming/StatefulProcessorHandle.scala
Show resolved
Hide resolved
sql/api/src/main/scala/org/apache/spark/sql/streaming/StatefulProcessorHandle.scala
Show resolved
Hide resolved
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/MapStateImplWithTTL.scala
Outdated
Show resolved
Hide resolved
...re/src/main/scala/org/apache/spark/sql/execution/streaming/StatefulProcessorHandleImpl.scala
Outdated
Show resolved
Hide resolved
Done |
HeartSaVioR
left a comment
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.
+1 pending CI
|
https://github.com/anishshri-db/spark/actions/runs/11675450690/job/32510196280
These failures are unrelated to this PR. |
|
Thanks! Merging to master. |
What changes were proposed in this pull request?
Add stateful processor handle APIs using implicit encoders in Scala
Why are the changes needed?
Without the changes, users have to pass explicit SQL encoders for state types while acquiring an instance of the underlying state variable
Does this PR introduce any user-facing change?
Yes
Users can now implicits available in Scala through
import spark.implicits._and only provide the type while getting the state objects. For eg -How was this patch tested?
Existing unit tests
Was this patch authored or co-authored using generative AI tooling?
No