HeartSaVioR commented on a change in pull request #35731:
URL: https://github.com/apache/spark/pull/35731#discussion_r822157109
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/StateSchemaCompatibilityCheckerSuite.scala
##########
@@ -129,28 +133,59 @@ class StateSchemaCompatibilityCheckerSuite extends
SharedSparkSession {
verifyException(keySchema, valueSchema, keySchema, newValueSchema)
}
- test("changing the nullability of nullable to non-nullable in key should
fail") {
+ // Checks on changing nullability of (nested) field.
+ // Note that these tests have different format of the test name compared to
others, since it was
+ // misleading to understand the assignment as the opposite way.
+
+ test("storing non-nullable column into nullable column in key should be
allowed") {
val nonNullChangedKeySchema = StructType(keySchema.map(_.copy(nullable =
false)))
- verifyException(keySchema, valueSchema, nonNullChangedKeySchema,
valueSchema)
+ verifySuccess(keySchema, valueSchema, nonNullChangedKeySchema, valueSchema)
}
- test("changing the nullability of nullable to non-nullable in value should
fail") {
+ test("storing non-nullable to nullable in value schema should be allowed") {
Review comment:
Good point. explicitly mentioning `column` seems to be better to
understand. will update the test names.
--
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]