WweiL commented on code in PR #47932:
URL: https://github.com/apache/spark/pull/47932#discussion_r1809581984


##########
sql/core/src/test/scala/org/apache/spark/sql/streaming/resources/testCommitLogV1/testCommitLog:
##########
@@ -0,0 +1,2 @@
+v1
+{"nextBatchWatermarkMs":1,"stateUniqueIds":{}}

Review Comment:
   This is for same-version verification, e.g. a spark 4.0 query (with this 
change) but have checkpoint format v2 turned off.
   
   For cross version validation (a spark 4.0 query run against commit log 
created in spark 3.5, see the test here)
   ```
   // Old metadata structure with no state unique ids should not affect the 
deserialization
     test("Cross-version V1 SerDe") {
       val commitlogV1 = """v1
                           |{"nextBatchWatermarkMs":233}""".stripMargin
       val inputStream: ByteArrayInputStream =
         new ByteArrayInputStream(commitlogV1.getBytes("UTF-8"))
       val commitMetadata: CommitMetadata = new CommitLog(
         spark, testCommitLogV1FilePath.toString).deserialize(inputStream)
       assert(commitMetadata.nextBatchWatermarkMs === 233)
       assert(commitMetadata.stateUniqueIds === Map.empty)
     }
   ```



-- 
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]

Reply via email to