chaoqin-li1123 commented on code in PR #43393:
URL: https://github.com/apache/spark/pull/43393#discussion_r1362899909
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/IncrementalExecution.scala:
##########
@@ -177,6 +183,20 @@ class IncrementalExecution(
}
}
+ object WriteStatefulOperatorMetadataRule extends SparkPlanPartialRule {
+ override val rule: PartialFunction[SparkPlan, SparkPlan] = {
+ case stateStoreWriter: StateStoreWriter =>
+ if (isFirstBatch) {
+ val metadata = stateStoreWriter.operatorStateMetadata()
+ val metadataWriter = new OperatorStateMetadataWriter(new Path(
+ checkpointLocation,
stateStoreWriter.getStateInfo.operatorId.toString), hadoopConf)
+ metadataWriter.write(metadata)
+ }
+ stateStoreWriter
+ case plan: SparkPlan => plan
Review Comment:
Thanks for reminding, we can simplify the code a lot.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]