Yikf commented on code in PR #5196:
URL: https://github.com/apache/kyuubi/pull/5196#discussion_r1308250142
##########
kyuubi-server/src/main/scala/org/apache/kyuubi/engine/ProcBuilder.scala:
##########
@@ -320,9 +323,17 @@ trait ProcBuilder {
.orElse {
// 2. get from $KYUUBI_HOME/externals/kyuubi-download/target
env.get(KYUUBI_HOME).flatMap { p =>
- val candidates = Paths.get(p, "externals", "kyuubi-download",
"target")
- .toFile.listFiles(homeDirFilter)
- if (candidates == null) None else candidates.map(_.toPath).headOption
+ Paths.get(p, "externals", "kyuubi-download", "target").toFile
+ .listFiles(homeDirFilter)
+ .filter(p =>
+ shortName match {
+ case "spark" => if (serverRuntimeScalaVersion === "2.13") {
+ p.getName.contains("2.13")
Review Comment:
case "spark" if (serverRuntimeScalaVersion === "2.13") =>
p.getName.contains("2.13")
case _ => true
##########
kyuubi-common/src/test/scala/org/apache/kyuubi/operation/SparkQueryTests.scala:
##########
@@ -391,7 +391,7 @@ trait SparkQueryTests extends SparkDataTypeTests with
HiveJDBCTestHelper {
statement.execute(code1)
val rs = statement.executeQuery(code2)
rs.next()
- assert(rs.getString(1) == "x: Int = 3")
+ assert(rs.getString(1) contains "x: Int = 3")
Review Comment:
ditto
##########
kyuubi-util-scala/src/main/scala/org/apache/kyuubi/util/ScalaVersionUtils.scala:
##########
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kyuubi.util
+
+import scala.util.Properties
+
+object ScalaVersionUtils {
+
+ /**
+ * Semantic version of runtime Scala,
+ * e.g., 2.12
+ *
+ * @return
Review Comment:
nit
##########
kyuubi-common/src/test/scala/org/apache/kyuubi/operation/SparkQueryTests.scala:
##########
@@ -241,7 +241,7 @@ trait SparkQueryTests extends SparkDataTypeTests with
HiveJDBCTestHelper {
|""".stripMargin
val rs1 = statement.executeQuery(code)
rs1.next()
- assert(rs1.getString(1) startsWith "df: org.apache.spark.sql.DataFrame")
+ assert(rs1.getString(1) contains "df: org.apache.spark.sql.DataFrame")
Review Comment:
why do we need change this?
--
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]