anishshri-db commented on code in PR #46856:
URL: https://github.com/apache/spark/pull/46856#discussion_r1626401368
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/StateSchemaCompatibilityCheckerSuite.scala:
##########
@@ -313,22 +314,13 @@ class StateSchemaCompatibilityCheckerSuite extends
SharedSparkSession {
runSchemaChecker(dir, queryId, oldKeySchema, oldValueSchema,
ignoreValueSchema = ignoreValueSchema)
- val e = intercept[StateSchemaNotCompatible] {
+ val e = intercept[SparkUnsupportedOperationException] {
runSchemaChecker(dir, queryId, newKeySchema, newValueSchema,
ignoreValueSchema = ignoreValueSchema)
}
-
- assert(e.getMessage.contains("Provided schema doesn't match to the schema
for existing state!"))
- assert(e.getMessage.contains(newKeySchema.toString()))
- assert(e.getMessage.contains(oldKeySchema.toString()))
-
- if (ignoreValueSchema) {
- assert(!e.getMessage.contains(newValueSchema.toString()))
- assert(!e.getMessage.contains(oldValueSchema.toString()))
- } else {
- assert(e.getMessage.contains(newValueSchema.toString()))
- assert(e.getMessage.contains(oldValueSchema.toString()))
- }
+ assert(e.getErrorClass === "STATE_STORE_KEY_SCHEMA_NOT_COMPATIBLE" ||
+ e.getErrorClass === "STATE_STORE_VALUE_SCHEMA_NOT_COMPATIBLE")
+ assert(e.getMessage.contains("does not match existing"))
Review Comment:
Added an additional check if `ignoreValueSchema` is set to true
--
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]