bowenliang123 commented on code in PR #5196:
URL: https://github.com/apache/kyuubi/pull/5196#discussion_r1332403898


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/engine/spark/SparkProcessBuilder.scala:
##########
@@ -102,6 +105,27 @@ class SparkProcessBuilder(
     }
   }
 
+  override protected def engineScalaBinaryVersion: String =
+    StringUtils.defaultIfBlank(System.getenv("SPARK_SCALA_VERSION"), 
sparkCoreScalaVersion)
+
+  override lazy val homeDirFilter: FilenameFilter = {
+    if (SCALA_COMPILE_VERSION.equals("2.13")) {
+      new RegexFileFilter(
+        "^spark-(\\d+\\.\\d+\\.\\d+)-bin-hadoop\\d+-scala\\d+\\.\\d+$",
+        IOCase.INSENSITIVE)
+    } else {
+      new RegexFileFilter("^spark-\\d+\\.\\d+\\.\\d+-bin-hadoop\\d+$", 
IOCase.INSENSITIVE)

Review Comment:
   I have fixed the regex pattern according to your detailed suggestions, 
thanks.
   The `dir.isDirectory` could be skipped, as the dir in FileFilter is 
guaranteed to be a folder directory. 



-- 
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]

Reply via email to