Skip to content

Commit 18f9b3f

Browse files
authored
[AURON #2440] Consolidate Maven properties and format code (#2441)
# Which issue does this PR close? Closes #2440 # Rationale for this change `./dev/reformat` produced different formatting results depending on the JDK used to run it. `pom.xml` selected `scalafmtVersion` based on the active JDK profile: `3.0.0` for `jdk-8`/`jdk-11`, and `3.9.9` for `jdk-17`/`jdk-21`. However, `scalafmt.conf` declares `version = 3.9.9`, so only the JDK 17/21 profiles actually matched the intended formatting rules. As a result, running the formatter under JDK 8/11 vs JDK 17/21 produced different indentation for multi-line string interpolations (e.g. `.getOrElse(...)` continuation lines), causing spurious diffs in `git status` depending on which JDK happened to be active locally. # What changes are included in this PR? Unify `scalafmtVersion` to `3.9.9` across all `jdk-8`/`jdk-11`/`jdk-17`/`jdk-21` profiles, matching the version declared in `scalafmt.conf`. # Are there any user-facing changes? No # How was this patch tested? GHA # Was this patch authored or co-authored using generative AI tooling? - [ ] Yes - [ ] No
1 parent 0d4d779 commit 18f9b3f

6 files changed

Lines changed: 9 additions & 15 deletions

File tree

pom.xml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@
5757
<javaVersion>8</javaVersion>
5858
<maven.compiler.source>${javaVersion}</maven.compiler.source>
5959
<maven.compiler.target>${javaVersion}</maven.compiler.target>
60+
<semanticdb.version>4.14.5</semanticdb.version>
61+
<scalafmtVersion>3.9.9</scalafmtVersion>
6062
<scalaVersion>2.12</scalaVersion>
6163
<scalaLongVersion>2.12.18</scalaLongVersion>
6264
<scala-xml.version>2.1.0</scala-xml.version>
@@ -1162,8 +1164,6 @@
11621164
<properties>
11631165
<javaVersion>8</javaVersion>
11641166
<spotless.plugin.version>2.30.0</spotless.plugin.version>
1165-
<semanticdb.version>4.14.5</semanticdb.version>
1166-
<scalafmtVersion>3.0.0</scalafmtVersion>
11671167
</properties>
11681168
</profile>
11691169

@@ -1175,8 +1175,6 @@
11751175
<properties>
11761176
<javaVersion>11</javaVersion>
11771177
<spotless.plugin.version>2.30.0</spotless.plugin.version>
1178-
<semanticdb.version>4.14.5</semanticdb.version>
1179-
<scalafmtVersion>3.0.0</scalafmtVersion>
11801178
</properties>
11811179
</profile>
11821180

@@ -1188,8 +1186,6 @@
11881186
<properties>
11891187
<javaVersion>17</javaVersion>
11901188
<spotless.plugin.version>2.45.0</spotless.plugin.version>
1191-
<semanticdb.version>4.14.5</semanticdb.version>
1192-
<scalafmtVersion>3.9.9</scalafmtVersion>
11931189
</properties>
11941190
</profile>
11951191

@@ -1201,8 +1197,6 @@
12011197
<properties>
12021198
<javaVersion>21</javaVersion>
12031199
<spotless.plugin.version>2.45.0</spotless.plugin.version>
1204-
<semanticdb.version>4.14.5</semanticdb.version>
1205-
<scalafmtVersion>3.9.9</scalafmtVersion>
12061200
</properties>
12071201
</profile>
12081202

spark-extension/src/main/scala/org/apache/spark/sql/auron/AuronConverters.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ object AuronConverters extends Logging {
509509
assert(
510510
!exec.requiredSchema.exists(e => existTimestampType(e.dataType)),
511511
s"Parquet scan with timestamp type is not supported for table: ${tableIdentifier
512-
.getOrElse("unknown")}. " +
512+
.getOrElse("unknown")}. " +
513513
"Set spark.auron.enable.scan.parquet.timestamp=true to enable timestamp support " +
514514
"or remove timestamp columns from the query.")
515515
}
@@ -520,15 +520,15 @@ object AuronConverters extends Logging {
520520
assert(
521521
!exec.requiredSchema.exists(e => existTimestampType(e.dataType)),
522522
s"ORC scan with timestamp type is not supported for tableIdentifier: ${tableIdentifier
523-
.getOrElse("unknown")}. " +
523+
.getOrElse("unknown")}. " +
524524
"Set spark.auron.enable.scan.orc.timestamp=true to enable timestamp support " +
525525
"or remove timestamp columns from the query.")
526526
}
527527
addRenameColumnsExec(Shims.get.createNativeOrcScanExec(exec))
528528
case p =>
529529
throw new NotImplementedError(
530530
s"Cannot convert FileSourceScanExec tableIdentifier: ${tableIdentifier.getOrElse(
531-
"unknown")}, class: ${p.getClass.getName}")
531+
"unknown")}, class: ${p.getClass.getName}")
532532
}
533533
}
534534

spark-extension/src/main/scala/org/apache/spark/sql/auron/AuronSparkSessionExtension.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ case class AuronColumnarOverrides(sparkSession: SparkSession) extends ColumnarRu
9191
dumpSimpleSparkPlanTreeNode(sparkPlanTransformed)
9292

9393
logInfo(s"Transformed spark plan after preColumnarTransitions:\n${sparkPlanTransformed
94-
.treeString(verbose = true, addSuffix = true)}")
94+
.treeString(verbose = true, addSuffix = true)}")
9595

9696
// post-transform
9797
Shims.get.postTransform(sparkPlanTransformed, sparkSession.sparkContext)

spark-extension/src/main/scala/org/apache/spark/sql/auron/NativeHelper.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ object NativeHelper extends Logging {
7474
val heapMemory = Runtime.getRuntime.maxMemory()
7575
val offheapMemory = totalMemory - heapMemory
7676
logWarning(s"memory total: ${Utils.bytesToString(totalMemory)}, onheap: ${Utils.bytesToString(
77-
heapMemory)}, offheap: ${Utils.bytesToString(offheapMemory)}")
77+
heapMemory)}, offheap: ${Utils.bytesToString(offheapMemory)}")
7878
offheapMemory
7979
}
8080

spark-extension/src/main/scala/org/apache/spark/sql/auron/util/TaskContextHelper.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ object TaskContextHelper extends Logging {
4747
val thread = Thread.currentThread()
4848
val threadPrefix = if (context != null) {
4949
s"auron native task ${context.partitionId()}.${context.attemptNumber()} in stage ${context
50-
.stageId()}.${context.stageAttemptNumber()} (TID ${context.taskAttemptId()})"
50+
.stageId()}.${context.stageAttemptNumber()} (TID ${context.taskAttemptId()})"
5151
} else {
5252
"auron native task"
5353
}

thirdparty/auron-uniffle/src/main/scala/org/apache/spark/sql/execution/auron/shuffle/uniffle/AuronUniffleShuffleReader.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class AuronUniffleShuffleReader[K, C](
172172
}
173173
if (!emptyPartitionIds.isEmpty) {
174174
logDebug(s"Found ${emptyPartitionIds
175-
.size()} empty shuffle partitions: ${emptyPartitionIds.asScala.mkString(",")}")
175+
.size()} empty shuffle partitions: ${emptyPartitionIds.asScala.mkString(",")}")
176176
}
177177
iterators = shuffleDataIterList.iterator()
178178
if (iterators.hasNext) {

0 commit comments

Comments
 (0)