Skip to content

Commit 592bb17

Browse files
authored
test: parameterize file count in Native_datafusion metrics test (#3896)
1 parent ad6cd45 commit 592bb17

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

spark/src/test/scala/org/apache/comet/exec/CometExecSuite.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2210,9 +2210,11 @@ class CometExecSuite extends CometTestBase {
22102210
}
22112211

22122212
test("Native_datafusion reports correct files and bytes scanned") {
2213+
val inputFiles = 2
2214+
22132215
withTempDir { dir =>
22142216
val path = new java.io.File(dir, "test_metrics").getAbsolutePath
2215-
spark.range(100).repartition(2).write.mode("overwrite").parquet(path)
2217+
spark.range(100).repartition(inputFiles).write.mode("overwrite").parquet(path)
22162218

22172219
withSQLConf(
22182220
CometConf.COMET_ENABLED.key -> "true",
@@ -2236,8 +2238,8 @@ class CometExecSuite extends CometTestBase {
22362238

22372239
val numFiles = scanNode.metrics("numFiles").value
22382240
assert(
2239-
numFiles == 2,
2240-
s"Expected exactly 2 files to be scanned, but got metrics reporting $numFiles")
2241+
numFiles == inputFiles,
2242+
s"Expected exactly $inputFiles files to be scanned, but got metrics reporting $numFiles")
22412243
}
22422244
}
22432245
}

0 commit comments

Comments
 (0)