ericm-db commented on code in PR #49277:
URL: https://github.com/apache/spark/pull/49277#discussion_r1917043160


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/StateSchemaCompatibilityChecker.scala:
##########
@@ -206,22 +206,23 @@ class StateSchemaCompatibilityChecker(
     } else if (!ignoreValueSchema && schemaEvolutionEnabled) {
       // Check value schema evolution
       // Sort schemas by most recent to least recent
-      val oldAvroSchemas = oldSchemas.sortBy(_.valueSchemaId).reverse.map { 
oldSchema =>
-        SchemaConverters.toAvroTypeWithDefaults(oldSchema.valueSchema)
+      val oldStateSchemas = oldSchemas.sortBy(_.valueSchemaId).reverse.map { 
oldSchema =>
+        StateSchemaMetadataValue(
+          oldSchema.valueSchema, 
SchemaConverters.toAvroTypeWithDefaults(oldSchema.valueSchema))
       }.asJava
-      val l = oldSchemas.sortBy(_.valueSchemaId).reverse.map { oldSchema =>
-        SchemaConverters.toAvroTypeWithDefaults(oldSchema.valueSchema)
-      }
+
       val newAvroSchema = SchemaConverters.toAvroTypeWithDefaults(valueSchema)
 
       val validator = new 
SchemaValidatorBuilder().canReadStrategy.validateAll()
-      try {
-        validator.validate(newAvroSchema, oldAvroSchemas)
-      } catch {
-        case s: SchemaValidationException =>
-          throw StateStoreErrors.stateStoreInvalidValueSchemaEvolution(
-            valueSchema.toString, s.getMessage)
-        case e: Throwable => throw e
+      oldStateSchemas.forEach { oldStateSchema =>

Review Comment:
   Resolved offline - we will allow this.



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to