HeartSaVioR commented on a change in pull request #24173: [SPARK-27237][SS] 
Introduce State schema validation among query restart
URL: https://github.com/apache/spark/pull/24173#discussion_r299523932
 
 

 ##########
 File path: 
sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingAggregationSuite.scala
 ##########
 @@ -686,6 +659,57 @@ class StreamingAggregationSuite extends 
StateStoreMetricsTest with Assertions {
     }
   }
 
+  testQuietlyWithAllStateVersions("changing schema of state when restarting 
query -" +
+    " schema check off", (SQLConf.STATE_SCHEMA_CHECK_ENABLED.key, "false")) {
+    withTempDir { tempDir =>
+      val (inputData, aggregated) = 
prepareTestForChangingSchemaOfState(tempDir)
+
+      testStream(aggregated, Update())(
+        StartStream(checkpointLocation = tempDir.getAbsolutePath),
+        AddData(inputData, 21),
+        ExpectFailure[SparkException] { e =>
+          val cause = e.getCause
+          // it would bring other error in runtime, but it shouldn't check 
schema in any way
+          assert(!cause.isInstanceOf[StateSchemaNotCompatible])
 
 Review comment:
   Note that it anyway throws exception even disabling schema check, and the 
exception would be non-friendly one. That's what this patch brings the value.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to