pan3793 commented on code in PR #5196:
URL: https://github.com/apache/kyuubi/pull/5196#discussion_r1332984656
##########
kyuubi-server/src/main/scala/org/apache/kyuubi/engine/spark/SparkProcessBuilder.scala:
##########
@@ -102,6 +103,26 @@ class SparkProcessBuilder(
}
}
+ private lazy val sparkCoreScalaVersion: String = {
Review Comment:
we can make it testable by breaking into a `function` and a `lazy val`
```
private[kyuubi] def extractScalaVersion(sparkJars: Seq[String]): String = {
val r = """^spark-core_(\d\.\d+).*.jar$""".r
sparkJars.collectFirst { case r(scalaVersion) => scalaVersion
}.getOrElse {
throw new KyuubiException("xxxx")
}
}
private lazy val sparkCoreScalaVersion: String = {
val sparkJars = Files.list(Paths.get(sparkHome, "jars"))
.iterator().asScala.map(_.getFileName.toString).toSeq
extractScalaVersion(sparkJars)
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]