Skip to content

Commit 37e17f2

Browse files
yanghuayaooqinn
authored andcommitted
[KYUUBI #1746] Move sparkEngineMajorMinorVersion into SparkQueryTests to make HiveJDBCTestHelper spark free
… <!-- Thanks for sending a pull request! Here are some tips for you: 1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html 2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'. 3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'. --> ### _Why are the changes needed?_ <!-- Please clarify why the changes are needed. For instance, 1. If you add a feature, you can talk about the use case of it. 2. If you fix a bug, you can clarify why it is a bug. --> ### _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 - [ ] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request Closes #1747 from yanghua/KYUUBI-1746. Closes #1746 f10fc37 [yanghua] [KYUUBI #1746] Move sparkEngineMajorMinorVersion into SparkQueryTests to make HiveJDBCTestHelper spark free Authored-by: yanghua <yanghua1127@gmail.com> Signed-off-by: Kent Yao <yao@apache.org>
1 parent 01f0ea8 commit 37e17f2

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

kyuubi-common/src/test/scala/org/apache/kyuubi/operation/HiveJDBCTestHelper.scala

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,4 @@ trait HiveJDBCTestHelper extends JDBCTestHelper {
141141
}
142142
}
143143

144-
def sparkEngineMajorMinorVersion: (Int, Int) = {
145-
var sparkRuntimeVer = ""
146-
withJdbcStatement() { stmt =>
147-
val result = stmt.executeQuery("SELECT version()")
148-
assert(result.next())
149-
sparkRuntimeVer = result.getString(1)
150-
assert(!result.next())
151-
}
152-
Utils.majorMinorVersion(sparkRuntimeVer)
153-
}
154144
}

kyuubi-common/src/test/scala/org/apache/kyuubi/operation/SparkQueryTests.scala

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import scala.collection.JavaConverters._
2424
import org.apache.commons.lang3.StringUtils
2525
import org.apache.hive.service.rpc.thrift.{TExecuteStatementReq, TFetchResultsReq, TOpenSessionReq, TStatusCode}
2626

27-
import org.apache.kyuubi.KYUUBI_VERSION
27+
import org.apache.kyuubi.{KYUUBI_VERSION, Utils}
2828

2929
trait SparkQueryTests extends HiveJDBCTestHelper {
3030

@@ -532,4 +532,15 @@ trait SparkQueryTests extends HiveJDBCTestHelper {
532532
assert(foundOperationLangItem)
533533
}
534534
}
535+
536+
def sparkEngineMajorMinorVersion: (Int, Int) = {
537+
var sparkRuntimeVer = ""
538+
withJdbcStatement() { stmt =>
539+
val result = stmt.executeQuery("SELECT version()")
540+
assert(result.next())
541+
sparkRuntimeVer = result.getString(1)
542+
assert(!result.next())
543+
}
544+
Utils.majorMinorVersion(sparkRuntimeVer)
545+
}
535546
}

0 commit comments

Comments
 (0)