sarutak commented on a change in pull request #32788:
URL: https://github.com/apache/spark/pull/32788#discussion_r646311651
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/StateSchemaCompatibilityChecker.scala
##########
@@ -71,20 +72,16 @@ class StateSchemaCompatibilityChecker(
private def schemasCompatible(storedSchema: StructType, schema: StructType):
Boolean =
DataType.equalsIgnoreNameAndCompatibleNullability(storedSchema, schema)
- private def readSchemaFile(): (StructType, StructType) = {
+ // Visible for testing
+ private[sql] def readSchemaFile(): (StructType, StructType) = {
val inStream = fm.open(schemaFileLocation)
try {
val versionStr = inStream.readUTF()
- // Currently we only support version 1, which we can simplify the
version validation and
- // the parse logic.
val version = MetadataVersionUtil.validateVersion(versionStr,
StateSchemaCompatibilityChecker.VERSION)
- require(version == 1)
-
- val keySchemaStr = inStream.readUTF()
- val valueSchemaStr = inStream.readUTF()
-
- (StructType.fromString(keySchemaStr),
StructType.fromString(valueSchemaStr))
+ require(1 <= version && version <=
StateSchemaCompatibilityChecker.VERSION)
Review comment:
I'll remove `require` here and add a validation for reader.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]