-
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-49467][SS] Add support for state data source reader and list s…
…tate ### What changes were proposed in this pull request? Add support for state data source reader and list state ### Why are the changes needed? This change adds support for reading state written using list state used primarily within the stateful processor used with the `transformWithState` operator ### Does this PR introduce _any_ user-facing change? Yes Users can read state and `explode` entries using the following query: ``` val stateReaderDf = spark.read .format("statestore") .option(StateSourceOptions.PATH, <checkpoint_location>) .option(StateSourceOptions.STATE_VAR_NAME, <state_var_name>) .load() val listStateDf = stateReaderDf .selectExpr( "key.value AS groupingKey", "list_value AS valueList", "partition_id") .select($"groupingKey", explode($"valueList").as("valueList")) ``` ### How was this patch tested? Added unit tests ``` [info] Run completed in 1 minute, 3 seconds. [info] Total number of tests run: 8 [info] Suites: completed 1, aborted 0 [info] Tests: succeeded 8, failed 0, canceled 0, ignored 0, pending 0 [info] All tests passed. ``` ### Was this patch authored or co-authored using generative AI tooling? No Closes #47978 from anishshri-db/task/SPARK-49467. Authored-by: Anish Shrigondekar <[email protected]> Signed-off-by: Jungtaek Lim <[email protected]>
- Loading branch information
1 parent
fdeb288
commit 5d1d44f
Showing
3 changed files
with
216 additions
and
46 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