Skip to content

Commit

Permalink
temporarily add debug lines
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvarya-db committed Dec 12, 2024
1 parent a25ab08 commit 0e07f1c
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,7 @@ class CheckpointsSuite

// Copy the source2 DV table to a temporary directory, so that we do updates to it
FileUtils.copyDirectory(source, target)
import testImplicits._

if (v2Checkpoint) {
spark.sql(s"ALTER TABLE delta.`${target.getAbsolutePath}` SET TBLPROPERTIES " +
Expand All @@ -571,11 +572,24 @@ class CheckpointsSuite

sql(s"ALTER TABLE delta.`${target.getAbsolutePath}` " +
s"SET TBLPROPERTIES (${DeltaConfigs.CHECKPOINT_INTERVAL.key} = 10)")

def listFiles(file: File): Seq[File] = {
if (file.isDirectory) {
file.listFiles().flatMap(listFiles)
} else {
Seq(file)
}
}
// scalastyle:off println
println("TODO: printing all files before insert")
listFiles(target).foreach(println)
def insertData(data: String): Unit = {
spark.sql(s"INSERT INTO TABLE delta.`${target.getAbsolutePath}` $data")
}
val newData = Seq.range(3000, 3010)
newData.foreach { i => insertData(s"VALUES($i)") }
println("TODO: printing all files after insert")
listFiles(target).foreach(println)

// Check the target file has checkpoint generated
val deltaLog = DeltaLog.forTable(spark, target.getAbsolutePath)
Expand All @@ -597,7 +611,6 @@ class CheckpointsSuite
}



testDifferentV2Checkpoints(s"V2 Checkpoint compat file equivalency to normal V2 Checkpoint") {
withTempDir { tempDir =>
spark.range(10).write.format("delta").save(tempDir.getAbsolutePath)
Expand Down

0 comments on commit 0e07f1c

Please sign in to comment.