Skip to content

Commit ba454b4

Browse files
committed
fix: Scala 2.13 compilation errors and unused parameter warnings
- Fix type mismatch by adding .toSeq to ArrayBuffer in CometNativeCompaction - Replace asScala on CloseableIterator with explicit while loop for Scala 2.13 compatibility - Remove unused warehouseDir parameters and filesBefore/nativeFilesAfter variables - Remove unused tableLocation parameter from buildCompactionConfig
1 parent 961ac46 commit ba454b4

2 files changed

Lines changed: 4 additions & 15 deletions

File tree

spark/src/test/scala/org/apache/comet/CometIcebergCompactionBenchmarkTest.scala

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,7 @@ class CometIcebergCompactionBenchmarkTest extends CometTestBase {
144144
l_quantity DOUBLE, l_extendedprice DOUBLE, l_discount DOUBLE, l_tax DOUBLE,
145145
l_returnflag STRING, l_linestatus STRING"""
146146
val (lSpark, lNative, lSpeedup) =
147-
runTableBenchmark(
148-
"lineitem",
149-
lineitemSchema,
150-
numFragments,
151-
rowsPerFragment)
147+
runTableBenchmark("lineitem", lineitemSchema, numFragments, rowsPerFragment)
152148
println(f"${"lineitem"}%-15s $lSpark%12d $lNative%12d ${lSpeedup}%9.2fx")
153149

154150
// Orders benchmark
@@ -165,11 +161,7 @@ class CometIcebergCompactionBenchmarkTest extends CometTestBase {
165161
"""c_custkey BIGINT, c_name STRING, c_address STRING, c_nationkey BIGINT,
166162
c_phone STRING, c_acctbal DOUBLE, c_mktsegment STRING, c_comment STRING"""
167163
val (cSpark, cNative, cSpeedup) =
168-
runTableBenchmark(
169-
"customer",
170-
customerSchema,
171-
numFragments,
172-
rowsPerFragment)
164+
runTableBenchmark("customer", customerSchema, numFragments, rowsPerFragment)
173165
println(f"${"customer"}%-15s $cSpark%12d $cNative%12d ${cSpeedup}%9.2fx")
174166

175167
println("-" * 60)

spark/src/test/scala/org/apache/spark/sql/comet/CometNativeCompaction.scala

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,8 @@ class CometNativeCompaction(spark: SparkSession) extends Logging {
132132
s"Processing file group ${groupIndex + 1}/${fileGroups.size} " +
133133
s"with ${group.size} files")
134134

135-
val compactionConfig = buildCompactionConfig(
136-
tableConfig,
137-
group,
138-
targetFileSizeBytes,
139-
compression)
135+
val compactionConfig =
136+
buildCompactionConfig(tableConfig, group, targetFileSizeBytes, compression)
140137
val result = executeNativeCompaction(compactionConfig)
141138

142139
result match {

0 commit comments

Comments
 (0)