From 2700de94c41d3d7ee58066775d6abff7ab38b95a Mon Sep 17 00:00:00 2001 From: timothy65535 Date: Thu, 14 Oct 2021 13:54:14 +0800 Subject: [PATCH] [KYUUBI #1229] Fix met error when debug KyuubiServer in local IDE ### _Why are the changes needed?_ When debug KyuubiServer in IDEA, IDEA: Intellij IDEA 2021.2(Ultimate Edition) throw exception ``` /KyuubiHiveDriverSuite.scala:45:36 Class org.apache.hive.jdbc.HiveConnection not found - continuing with a stub. assert(connection.isInstanceOf[KyuubiConnection]) ``` ``` /KyuubiHiveDriverSuite.scala:47:34 Class org.apache.hive.jdbc.HiveDatabaseMetaData not found - continuing with a stub. assert(metaData.isInstanceOf[KyuubiDatabaseMetaData]) ``` For more detail, please go to https://github.com/apache/incubator-kyuubi/issues/1229 ### _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 #1231 from timothy65535/ky-1229. Closes #1229 873b3314 [timothy65535] [KYUUBI #1229] Fix met error when debug KyuubiServer in local IDE Authored-by: timothy65535 Signed-off-by: Cheng Pan --- .../org/apache/kyuubi/jdbc/KyuubiHiveDriverSuite.scala | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/jdbc/KyuubiHiveDriverSuite.scala b/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/jdbc/KyuubiHiveDriverSuite.scala index f6116a22c..c49a122cb 100644 --- a/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/jdbc/KyuubiHiveDriverSuite.scala +++ b/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/jdbc/KyuubiHiveDriverSuite.scala @@ -22,7 +22,6 @@ import java.util.Properties import org.apache.kyuubi.IcebergSuiteMixin import org.apache.kyuubi.engine.spark.WithSparkSQLEngine import org.apache.kyuubi.engine.spark.shim.SparkCatalogShim -import org.apache.kyuubi.jdbc.hive.{KyuubiConnection, KyuubiDatabaseMetaData} import org.apache.kyuubi.tags.IcebergTest @IcebergTest @@ -42,9 +41,9 @@ class KyuubiHiveDriverSuite extends WithSparkSQLEngine with IcebergSuiteMixin { test("get tables with kyuubi driver") { val driver = new KyuubiHiveDriver() val connection = driver.connect(getJdbcUrl, new Properties()) - assert(connection.isInstanceOf[KyuubiConnection]) + assert(connection.getClass.getName === "org.apache.kyuubi.jdbc.hive.KyuubiConnection") val metaData = connection.getMetaData - assert(metaData.isInstanceOf[KyuubiDatabaseMetaData]) + assert(metaData.getClass.getName === "org.apache.kyuubi.jdbc.hive.KyuubiDatabaseMetaData") val statement = connection.createStatement() val table1 = s"${SparkCatalogShim.SESSION_CATALOG}.default.kyuubi_hive_jdbc" val table2 = s"$catalog.default.hdp_cat_tbl" @@ -74,9 +73,9 @@ class KyuubiHiveDriverSuite extends WithSparkSQLEngine with IcebergSuiteMixin { test("deprecated KyuubiDriver also works") { val driver = new KyuubiDriver() val connection = driver.connect(getJdbcUrl, new Properties()) - assert(connection.isInstanceOf[KyuubiConnection]) + assert(connection.getClass.getName === "org.apache.kyuubi.jdbc.hive.KyuubiConnection") val metaData = connection.getMetaData - assert(metaData.isInstanceOf[KyuubiDatabaseMetaData]) + assert(metaData.getClass.getName === "org.apache.kyuubi.jdbc.hive.KyuubiDatabaseMetaData") val statement = connection.createStatement() try { val resultSet = statement.executeQuery(s"SELECT 1")