Skip to content

Commit c60f5b7

Browse files
committed
[KYUUBI apache#5196][FOLLOWUP] Extract spark core scala version lazily and respect engine env
### _Why are the changes needed?_ Only extract the spark core scala version if `SPARK_SCALA_VERSION` env is empty, and respect engine env. ### _How was this patch tested?_ - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [ ] Add screenshots for manual tests if appropriate - [x] [Run test](https://kyuubi.readthedocs.io/en/master/contributing/code/testing.html#running-tests) locally before make a pull request ### _Was this patch authored or co-authored using generative AI tooling?_ No. Closes apache#5434 from turboFei/lazy_scala_version. Closes apache#5196 fdccef7 [fwang12] lazy extract spark core scala version Authored-by: fwang12 <fwang12@ebay.com> Signed-off-by: fwang12 <fwang12@ebay.com>
1 parent b24d94e commit c60f5b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kyuubi-server/src/main/scala/org/apache/kyuubi/engine/spark/SparkProcessBuilder.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ class SparkProcessBuilder(
108108
}
109109

110110
override protected val engineScalaBinaryVersion: String = {
111-
val sparkCoreScalaVersion =
111+
env.get("SPARK_SCALA_VERSION").filter(StringUtils.isNotBlank).getOrElse {
112112
extractSparkCoreScalaVersion(Paths.get(sparkHome, "jars").toFile.list())
113-
StringUtils.defaultIfBlank(System.getenv("SPARK_SCALA_VERSION"), sparkCoreScalaVersion)
113+
}
114114
}
115115

116116
override protected lazy val engineHomeDirFilter: FileFilter = file => {

0 commit comments

Comments
 (0)