You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "siying (via GitHub)" <gi...@apache.org> on 2024/11/19 04:19:55 UTC
Re: [PR] [SPARK-50339][SS] Enable changelog to store lineage information [spark]
siying commented on code in PR #48880:
URL: https://github.com/apache/spark/pull/48880#discussion_r1847617722
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/RocksDBSuite.scala:
##########
@@ -754,6 +754,43 @@ class RocksDBSuite extends AlsoTestWithChangelogCheckpointingEnabled with Shared
}
}
+ testWithChangelogCheckpointingEnabled("RocksDBFileManager: read and write changelog " +
+ "under checkpoint format V2") {
+ val dfsRootDir = new File(Utils.createTempDir().getAbsolutePath + "/state/1/1")
+ val fileManager = new RocksDBFileManager(
+ dfsRootDir.getAbsolutePath, Utils.createTempDir(), new Configuration)
+ val checkpointUniqueId = Some(java.util.UUID.randomUUID.toString)
+ val lineage: Array[LineageItem] = Array(
+ LineageItem(1, java.util.UUID.randomUUID.toString),
+ LineageItem(2, java.util.UUID.randomUUID.toString),
+ LineageItem(3, java.util.UUID.randomUUID.toString)
+ )
+ val changelogWriter = fileManager.getChangeLogWriter(3, false, checkpointUniqueId)
+ changelogWriter.writeLineage(lineage)
+ assert(changelogWriter.version === 1)
+
+ (1 to 5).foreach(i => changelogWriter.put(i.toString, i.toString))
+ (2 to 4).foreach(j => changelogWriter.delete(j.toString))
+
+ changelogWriter.commit()
+ val changelogReader = fileManager.getChangelogReader(3, false, checkpointUniqueId)
+ assert(changelogReader.version === 1)
Review Comment:
Should we cover both V1 and V2? I saw lineage is written in both.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org