anishshri-db commented on code in PR #47574:
URL: https://github.com/apache/spark/pull/47574#discussion_r1735576312
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/state/StateDataSource.scala:
##########
@@ -91,25 +199,45 @@ class StateDataSource extends TableProvider with
DataSourceRegister {
val storeId = new StateStoreId(stateCheckpointLocation.toString,
sourceOptions.operatorId,
partitionId, sourceOptions.storeName)
val providerId = new StateStoreProviderId(storeId, UUID.randomUUID())
- val manager = new StateSchemaCompatibilityChecker(providerId,
hadoopConf)
- val stateSchema = manager.readSchemaFile().head
- (stateSchema.keySchema, stateSchema.valueSchema)
- }
-
- if (sourceOptions.readChangeFeed) {
- new StructType()
- .add("batch_id", LongType)
- .add("change_type", StringType)
- .add("key", keySchema)
- .add("value", valueSchema)
- .add("partition_id", IntegerType)
- } else {
- new StructType()
- .add("key", keySchema)
- .add("value", valueSchema)
- .add("partition_id", IntegerType)
+ val storeMetadata = stateStoreMetadata.get
+
+ val stateVarName = sourceOptions.stateVarName
+ .getOrElse(StateStore.DEFAULT_COL_FAMILY_NAME)
+
+ // Read the schema file path from operator metadata version v2
onwards
+ val oldSchemaFilePath = if (storeMetadata.length > 0 &&
storeMetadata.head.version == 2) {
Review Comment:
Done
--
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]