Skip to content

Commit

Permalink
[SPARK-48772][SS][SQL] State Data Source Change Feed Reader Mode
Browse files Browse the repository at this point in the history
This PR adds ability of showing the evolution of state as Change Data Capture (CDC) format to state data source.

An example usage:
```
.format("statestore")
.option("readChangeFeed", true)
.option("changeStartBatchId", 5) #required
.option("changeEndBatchId", 10)  #not required, default: latest batch Id available
```
_Note that this mode does not support the option "joinSide"._

The current state reader can only return the entire state at a specific version. If an error occurs related to state, knowing the change of state across versions to find out at which version state starts to go wrong is important for debugging purposes.

No.

Adds a new test suite `StateDataSourceChangeDataReadSuite` that includes 1) testing input error 2) testing new API added 3) integration test.

No.

Closes apache#47188 from eason-yuchen-liu/readStateChange.

Lead-authored-by: Yuchen Liu <[email protected]>
Co-authored-by: Yuchen Liu <[email protected]>
Signed-off-by: Jungtaek Lim <[email protected]>
  • Loading branch information
2 people authored and jingz-db committed Jul 11, 2024
1 parent cb60dc9 commit c8b5b70
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ object StateSourceOptions extends DataSourceOptions {
val CHANGE_START_BATCH_ID = newOption("changeStartBatchId")
val CHANGE_END_BATCH_ID = newOption("changeEndBatchId")
val STATE_VAR_NAME = newOption("stateVarName")
val READ_CHANGE_FEED = newOption("readChangeFeed")
val CHANGE_START_BATCH_ID = newOption("changeStartBatchId")
val CHANGE_END_BATCH_ID = newOption("changeEndBatchId")

object JoinSideValues extends Enumeration {
type JoinSideValues = Value
Expand Down

0 comments on commit c8b5b70

Please sign in to comment.