This is an automated email from the ASF dual-hosted git repository.
dongjoon-hyun pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/spark-kubernetes-operator.git
The following commit(s) were added to refs/heads/main by this push:
new 31d7d03 [SPARK-58331] Use Java-friendly `sparkVersion` API instead of
`labels` override in `SparkAppDriverConf`
31d7d03 is described below
commit 31d7d0343917fb1d8e711b7747597c488f6113c1
Author: Dongjoon Hyun <[email protected]>
AuthorDate: Fri Jul 24 13:19:20 2026 -0700
[SPARK-58331] Use Java-friendly `sparkVersion` API instead of `labels`
override in `SparkAppDriverConf`
### What changes were proposed in this pull request?
This PR aims to replace the Scala-typed `labels()` override of
`SparkAppDriverConf` with the Java-friendly `sparkVersion()` API which was
introduced via SPARK-56736 in Apache Spark 4.2.0.
- https://github.com/apache/spark/pull/55697
### Why are the changes needed?
To use Java-friendly APIs instead of Scala APIs.
### Does this PR introduce _any_ user-facing change?
No. The generated driver labels are identical. The existing `testLabels`
test passes without modification.
### How was this patch tested?
Pass the CIs.
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Fable 5
Closes #774 from dongjoon-hyun/SPARK-58331.
Authored-by: Dongjoon Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
---
.../java/org/apache/spark/k8s/operator/SparkAppDriverConf.java | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git
a/spark-submission-worker/src/main/java/org/apache/spark/k8s/operator/SparkAppDriverConf.java
b/spark-submission-worker/src/main/java/org/apache/spark/k8s/operator/SparkAppDriverConf.java
index e6a3099..0e33308 100644
---
a/spark-submission-worker/src/main/java/org/apache/spark/k8s/operator/SparkAppDriverConf.java
+++
b/spark-submission-worker/src/main/java/org/apache/spark/k8s/operator/SparkAppDriverConf.java
@@ -19,8 +19,6 @@
package org.apache.spark.k8s.operator;
-import static org.apache.spark.k8s.operator.Constants.LABEL_SPARK_VERSION_NAME;
-
import java.util.Optional;
import org.apache.spark.SparkConf;
@@ -90,13 +88,13 @@ public final class SparkAppDriverConf extends
KubernetesDriverConf {
}
/**
- * Returns the driver label key and value map.
+ * Returns the Spark version of the application.
*
- * @return The label key-value pair map.
+ * @return The Spark version.
*/
@Override
- public scala.collection.immutable.Map<String, String> labels() {
- return super.labels().updated(LABEL_SPARK_VERSION_NAME, sparkVersion);
+ public String sparkVersion() {
+ return sparkVersion;
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]