You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by ch...@apache.org on 2021/10/27 11:14:21 UTC

[incubator-kyuubi] branch master updated: [KYUUBI #1287] [TEST] Refacotor test hierarchical

This is an automated email from the ASF dual-hosted git repository.

chengpan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-kyuubi.git


The following commit(s) were added to refs/heads/master by this push:
     new 6539731  [KYUUBI #1287] [TEST] Refacotor test hierarchical
6539731 is described below

commit 6539731417028b91265459eaaf4d5e5d8efcd117
Author: Cheng Pan <ch...@apache.org>
AuthorDate: Wed Oct 27 19:14:13 2021 +0800

    [KYUUBI #1287] [TEST] Refacotor test hierarchical
    
    <!--
    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.
    -->
    Change the name to reflect functionalities, restore `SparkQueryTests` both on Engine&Server sides
    
    Rename `JDBCTestUtils` to `HiveJDBCTestHelper`
    Rename `BasicJDBCTests` to `SparkMetadataTests`
    Rename `HiveJDBCTests` to `HiveMetadataTests`
    Rename `BasicDeltaJDBCTests` to `DeltaMetadataTests`
    Rename `BasicHudiJDBCTests` to `HudiMetadataTests`
    Rename `BasicIcebergJDBCTests` to `IcebergMetadataTests`
    Rename `KyuubiOperationGroupSuite` to `KyuubiOperationPerGroupSuite`
    
    Rename sorts of `spark` prefixed fields in `HiveJDBCTestHelper`
    
    Use `UserGroupInformation.createUserForTesting` for `KyuubiOperationPerGroupSuite`
    
    Hierarchical
    
    ```
    - HiveJDBCTestHelper
        - DeltaMetadataTests
            - [ENGINE] SparkDeltaOperationSuite
            - [SERVER] DeltaOperationSuite
        - HudiMetadataTests
            - [ENGINE] SparkHudiOperationSuite
            - [SERVER] HudiOperationSuite
        - IcebergMetadataTests
            - [ENGINE] SparkIcebergOperationSuite
            - [SERVER] IcebergOperationSuite
        - SparkMetadataTests
            - [SERVER] KyuubiJdbcDriverHASuite
            - HiveMetadataTests
                - [ENGINE] SparkOperationSuite mixin SparkQueryTests
                - [SERVER] KyuubiOperationHiveCatalogSuite
        - SparkQueryTests
            - [ENGINE] SparkOperationSuite mixin HiveMetadataTests
            - [SERVER] KubernetesJDBCTestsSuite
            - [SERVER] KyuubiOperationPerServerSuite
            - [SERVER] KyuubiOperationPerGroupSuite
            - [SERVER] KyuubiOperationPerUserSuite
            - [SERVER] KyuubiOperationYarnClusterSuite
        ... other Suites for specific cases
    ```
    
    ### _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
    
    - [x] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request
    
    Closes #1287 from pan3793/ut.
    
    Closes #1287
    
    d9a410ca [Cheng Pan] Fix K8s tests
    478a60dc [Cheng Pan] Fix scalastyle
    91f2a27b [Cheng Pan] Rename BasicQueryTests to SparkQueryTests
    40154223 [Cheng Pan] Rename JDBCTestHelper to HiveJDBCTestHelper
    efb99110 [Cheng Pan] Use UGI createUserForTesting
    d82b0635 [Cheng Pan] Reset UGI
    11927101 [Cheng Pan] Refresh group mappings after update Hadoop conf
    b21f36e7 [Cheng Pan] Restore lazy val user
    25008ad3 [Cheng Pan] Rename `KyuubiOperationGroupSuite` to `KyuubiOperationPerGroupSuite`
    d71c7e1b [Cheng Pan] Refacotor test hierarchical
    
    Authored-by: Cheng Pan <ch...@apache.org>
    Signed-off-by: Cheng Pan <ch...@apache.org>
---
 .../kyuubi/engine/spark/IndividualSparkSuite.scala |  4 +-
 .../kyuubi/engine/spark/SchedulerPoolSuite.scala   |  4 +-
 .../engine/spark/ShareLevelSparkEngineSuite.scala  |  4 +-
 .../spark/events/EventLoggingServiceSuite.scala    | 12 +++---
 .../spark/operation/SparkDeltaOperationSuite.scala |  4 +-
 .../spark/operation/SparkHudiOperationSuite.scala  |  4 +-
 .../operation/SparkIcebergOperationSuite.scala     |  4 +-
 .../spark/operation/SparkOperationSuite.scala      | 12 +++---
 .../kyuubi/engine/spark/session/SessionSuite.scala |  4 +-
 .../engine/spark/session/SingleSessionSuite.scala  |  4 +-
 .../spark/kyuubi/SQLOperationListenerSuite.scala   |  4 +-
 .../apache/spark/kyuubi/ui/EngineTabSuite.scala    |  4 +-
 .../kubernetes/test/KubernetesJDBCTestsSuite.scala |  4 +-
 ...ltaJDBCTests.scala => DeltaMetadataTests.scala} |  2 +-
 ...DBCTestUtils.scala => HiveJDBCTestHelper.scala} | 49 +++++++++++-----------
 ...HiveJDBCTests.scala => HiveMetadataTests.scala} |  3 +-
 ...HudiJDBCTests.scala => HudiMetadataTests.scala} |  8 ++--
 ...gJDBCTests.scala => IcebergMetadataTests.scala} | 14 +++----
 ...sicJDBCTests.scala => SparkMetadataTests.scala} |  3 +-
 .../{JDBCTests.scala => SparkQueryTests.scala}     |  2 +-
 .../kyuubi/engine/spark/InitializeSQLSuite.scala   |  4 +-
 .../kyuubi/engine/spark/SparkSqlEngineSuite.scala  |  4 +-
 .../kyuubi/events/EventLoggingServiceSuite.scala   |  4 +-
 .../operation/KyuubiIncrementCollectSuite.scala    |  2 +-
 .../kyuubi/operation/KyuubiJdbcDriverHASuite.scala |  2 +-
 .../operation/KyuubiOperationEnginePoolSuite.scala |  2 +-
 .../KyuubiOperationHiveCatalogSuite.scala          |  2 +-
 .../KyuubiOperationKerberosAndPlainAuthSuite.scala |  2 +-
 .../operation/KyuubiOperationManagerSuite.scala    |  2 +-
 .../KyuubiOperationPerConnectionSuite.scala        |  2 +-
 ...te.scala => KyuubiOperationPerGroupSuite.scala} | 25 +++++++----
 .../operation/KyuubiOperationPerServerSuite.scala  |  2 +-
 .../operation/KyuubiOperationPerUserSuite.scala    |  2 +-
 .../KyuubiOperationYarnClusterSuite.scala          |  2 +-
 .../kyuubi/operation/PlanOnlyOperationSuite.scala  |  2 +-
 .../operation/datalake/DeltaOperationSuite.scala   |  4 +-
 .../operation/datalake/HudiOperationSuite.scala    |  4 +-
 .../operation/datalake/IcebergOperationSuite.scala |  4 +-
 .../kyuubi/operation/tpcds/DDLTPCDSSuite.scala     |  4 +-
 .../operation/tpcds/OutputSchemaTPCDSSuite.scala   |  4 +-
 40 files changed, 119 insertions(+), 109 deletions(-)

diff --git a/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/IndividualSparkSuite.scala b/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/IndividualSparkSuite.scala
index 4fe2cf6..903734a 100644
--- a/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/IndividualSparkSuite.scala
+++ b/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/IndividualSparkSuite.scala
@@ -28,7 +28,7 @@ import org.scalatest.time.SpanSugar._
 
 import org.apache.kyuubi.KyuubiFunSuite
 import org.apache.kyuubi.config.KyuubiConf
-import org.apache.kyuubi.operation.JDBCTestUtils
+import org.apache.kyuubi.operation.HiveJDBCTestHelper
 
 class SparkEngineSuites extends KyuubiFunSuite {
 
@@ -99,4 +99,4 @@ class SparkEngineSuites extends KyuubiFunSuite {
   }
 }
 
-trait WithSparkSuite extends WithSparkSQLEngine with JDBCTestUtils
+trait WithSparkSuite extends WithSparkSQLEngine with HiveJDBCTestHelper
diff --git a/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/SchedulerPoolSuite.scala b/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/SchedulerPoolSuite.scala
index ee69811..1109291 100644
--- a/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/SchedulerPoolSuite.scala
+++ b/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/SchedulerPoolSuite.scala
@@ -23,9 +23,9 @@ import org.apache.spark.scheduler.{SparkListener, SparkListenerJobEnd, SparkList
 import org.scalatest.concurrent.PatienceConfiguration.Timeout
 import org.scalatest.time.SpanSugar.convertIntToGrainOfTime
 
-import org.apache.kyuubi.operation.JDBCTestUtils
+import org.apache.kyuubi.operation.HiveJDBCTestHelper
 
-class SchedulerPoolSuite extends WithSparkSQLEngine with JDBCTestUtils {
+class SchedulerPoolSuite extends WithSparkSQLEngine with HiveJDBCTestHelper {
   override protected def jdbcUrl: String = getJdbcUrl
   override def withKyuubiConf: Map[String, String] = {
     val poolFile =
diff --git a/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/ShareLevelSparkEngineSuite.scala b/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/ShareLevelSparkEngineSuite.scala
index dc82c11..3410bb6 100644
--- a/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/ShareLevelSparkEngineSuite.scala
+++ b/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/ShareLevelSparkEngineSuite.scala
@@ -22,7 +22,7 @@ import java.util.UUID
 import org.apache.kyuubi.config.KyuubiConf.ENGINE_SHARE_LEVEL
 import org.apache.kyuubi.engine.ShareLevel
 import org.apache.kyuubi.engine.ShareLevel.ShareLevel
-import org.apache.kyuubi.operation.JDBCTestUtils
+import org.apache.kyuubi.operation.HiveJDBCTestHelper
 import org.apache.kyuubi.service.ServiceState
 
 /**
@@ -30,7 +30,7 @@ import org.apache.kyuubi.service.ServiceState
  * e.g. cleanup discovery service before stop.
  */
 abstract class ShareLevelSparkEngineSuite
-  extends WithDiscoverySparkSQLEngine with JDBCTestUtils {
+  extends WithDiscoverySparkSQLEngine with HiveJDBCTestHelper {
   def shareLevel: ShareLevel
   override def withKyuubiConf: Map[String, String] = {
     super.withKyuubiConf ++ Map(ENGINE_SHARE_LEVEL.key -> shareLevel.toString)
diff --git a/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/events/EventLoggingServiceSuite.scala b/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/events/EventLoggingServiceSuite.scala
index 216cb7f..fa2638d 100644
--- a/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/events/EventLoggingServiceSuite.scala
+++ b/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/events/EventLoggingServiceSuite.scala
@@ -30,9 +30,9 @@ import org.apache.kyuubi.config.KyuubiConf
 import org.apache.kyuubi.engine.spark.{KyuubiSparkUtil, WithSparkSQLEngine}
 import org.apache.kyuubi.events.EventLoggerType._
 import org.apache.kyuubi.events.JsonProtocol
-import org.apache.kyuubi.operation.{JDBCTestUtils, OperationHandle}
+import org.apache.kyuubi.operation.{HiveJDBCTestHelper, OperationHandle}
 
-class EventLoggingServiceSuite extends WithSparkSQLEngine with JDBCTestUtils {
+class EventLoggingServiceSuite extends WithSparkSQLEngine with HiveJDBCTestHelper {
 
   private val logRoot = "file://" + Utils.createTempDir().toString
   private val currentDate = Utils.getDateFromTimestamp(System.currentTimeMillis())
@@ -62,7 +62,7 @@ class EventLoggingServiceSuite extends WithSparkSQLEngine with JDBCTestUtils {
 
     withJdbcStatement() { statement =>
       val table = engineEventPath.getParent
-      val resultSet = statement.executeQuery(s"SELECT * FROM `json`.`${table}`")
+      val resultSet = statement.executeQuery(s"SELECT * FROM `json`.`$table`")
       while (resultSet.next()) {
         assert(resultSet.getString("Event") === classOf[EngineEvent].getCanonicalName)
         assert(resultSet.getString("applicationId") === spark.sparkContext.applicationId)
@@ -78,7 +78,7 @@ class EventLoggingServiceSuite extends WithSparkSQLEngine with JDBCTestUtils {
       }
 
       val table3 = sessionEventPath.getParent
-      val rs3 = statement.executeQuery(s"SELECT * FROM `json`.`${table3}`")
+      val rs3 = statement.executeQuery(s"SELECT * FROM `json`.`$table3`")
       while (rs3.next()) {
         assert(rs3.getString("Event") === classOf[SessionEvent].getCanonicalName)
         assert(rs3.getString("username") === Utils.currentUser)
@@ -112,8 +112,8 @@ class EventLoggingServiceSuite extends WithSparkSQLEngine with JDBCTestUtils {
       val statementId = OperationHandle(opHandle).identifier.toString
 
       eventually(timeout(60.seconds), interval(5.seconds)) {
-        val result = spark.sql(s"select * from `json`.`${table}`")
-          .where(s"statementId = '${statementId}'")
+        val result = spark.sql(s"select * from `json`.`$table`")
+          .where(s"statementId = '$statementId'")
 
         assert(result.select("statementId").first().get(0) === statementId)
         assert(result.count() >= 1)
diff --git a/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/operation/SparkDeltaOperationSuite.scala b/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/operation/SparkDeltaOperationSuite.scala
index d85b391..d07eca4 100644
--- a/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/operation/SparkDeltaOperationSuite.scala
+++ b/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/operation/SparkDeltaOperationSuite.scala
@@ -18,11 +18,11 @@
 package org.apache.kyuubi.engine.spark.operation
 
 import org.apache.kyuubi.engine.spark.WithSparkSQLEngine
-import org.apache.kyuubi.operation.BasicDeltaJDBCTests
+import org.apache.kyuubi.operation.DeltaMetadataTests
 import org.apache.kyuubi.tags.DeltaTest
 
 @DeltaTest
-class SparkDeltaOperationSuite extends WithSparkSQLEngine with BasicDeltaJDBCTests {
+class SparkDeltaOperationSuite extends WithSparkSQLEngine with DeltaMetadataTests {
 
   override protected def jdbcUrl: String = getJdbcUrl
 
diff --git a/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/operation/SparkHudiOperationSuite.scala b/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/operation/SparkHudiOperationSuite.scala
index e401433..649e7c0 100644
--- a/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/operation/SparkHudiOperationSuite.scala
+++ b/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/operation/SparkHudiOperationSuite.scala
@@ -18,11 +18,11 @@
 package org.apache.kyuubi.engine.spark.operation
 
 import org.apache.kyuubi.engine.spark.WithSparkSQLEngine
-import org.apache.kyuubi.operation.BasicHudiJDBCTests
+import org.apache.kyuubi.operation.HudiMetadataTests
 import org.apache.kyuubi.tags.HudiTest
 
 @HudiTest
-class SparkHudiOperationSuite extends WithSparkSQLEngine with BasicHudiJDBCTests {
+class SparkHudiOperationSuite extends WithSparkSQLEngine with HudiMetadataTests {
 
   override protected def jdbcUrl: String = getJdbcUrl
 
diff --git a/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/operation/SparkIcebergOperationSuite.scala b/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/operation/SparkIcebergOperationSuite.scala
index cea2438..225fa0a 100644
--- a/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/operation/SparkIcebergOperationSuite.scala
+++ b/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/operation/SparkIcebergOperationSuite.scala
@@ -18,11 +18,11 @@
 package org.apache.kyuubi.engine.spark.operation
 
 import org.apache.kyuubi.engine.spark.WithSparkSQLEngine
-import org.apache.kyuubi.operation.BasicIcebergJDBCTests
+import org.apache.kyuubi.operation.IcebergMetadataTests
 import org.apache.kyuubi.tags.IcebergTest
 
 @IcebergTest
-class SparkIcebergOperationSuite extends WithSparkSQLEngine with BasicIcebergJDBCTests {
+class SparkIcebergOperationSuite extends WithSparkSQLEngine with IcebergMetadataTests {
 
   override protected def jdbcUrl: String = getJdbcUrl
 
diff --git a/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/operation/SparkOperationSuite.scala b/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/operation/SparkOperationSuite.scala
index 38ec6b0..ede5ac6 100644
--- a/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/operation/SparkOperationSuite.scala
+++ b/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/operation/SparkOperationSuite.scala
@@ -35,11 +35,11 @@ import org.apache.spark.sql.types._
 import org.apache.kyuubi.Utils
 import org.apache.kyuubi.engine.spark.WithSparkSQLEngine
 import org.apache.kyuubi.engine.spark.shim.SparkCatalogShim
-import org.apache.kyuubi.operation.HiveJDBCTests
+import org.apache.kyuubi.operation.{HiveMetadataTests, SparkQueryTests}
 import org.apache.kyuubi.operation.meta.ResultSetSchemaConstant._
 import org.apache.kyuubi.util.KyuubiHadoopUtils
 
-class SparkOperationSuite extends WithSparkSQLEngine with HiveJDBCTests {
+class SparkOperationSuite extends WithSparkSQLEngine with HiveMetadataTests with SparkQueryTests {
 
   override protected def jdbcUrl: String = getJdbcUrl
   override def withKyuubiConf: Map[String, String] = Map.empty
@@ -81,7 +81,7 @@ class SparkOperationSuite extends WithSparkSQLEngine with HiveJDBCTests {
 
     val ddl =
       s"""
-         |CREATE TABLE IF NOT EXISTS $dftSchema.$tableName (
+         |CREATE TABLE IF NOT EXISTS $defaultSchema.$tableName (
          |  ${schema.toDDL}
          |)
          |USING parquet""".stripMargin
@@ -92,7 +92,7 @@ class SparkOperationSuite extends WithSparkSQLEngine with HiveJDBCTests {
       val metaData = statement.getConnection.getMetaData
 
       Seq("%", null, ".*", "c.*") foreach { columnPattern =>
-        val rowSet = metaData.getColumns("", dftSchema, tableName, columnPattern)
+        val rowSet = metaData.getColumns("", defaultSchema, tableName, columnPattern)
 
         import java.sql.Types._
         val expectedJavaTypes = Seq(BOOLEAN, TINYINT, SMALLINT, INTEGER, BIGINT, FLOAT, DOUBLE,
@@ -103,7 +103,7 @@ class SparkOperationSuite extends WithSparkSQLEngine with HiveJDBCTests {
 
         while (rowSet.next()) {
           assert(rowSet.getString(TABLE_CAT) === SparkCatalogShim.SESSION_CATALOG)
-          assert(rowSet.getString(TABLE_SCHEM) === dftSchema)
+          assert(rowSet.getString(TABLE_SCHEM) === defaultSchema)
           assert(rowSet.getString(TABLE_NAME) === tableName)
           assert(rowSet.getString(COLUMN_NAME) === schema(pos).name)
           assert(rowSet.getInt(DATA_TYPE) === expectedJavaTypes(pos))
@@ -209,7 +209,7 @@ class SparkOperationSuite extends WithSparkSQLEngine with HiveJDBCTests {
       val apis = Seq(metaData.getFunctions _, metaData.getProcedures _)
       Seq("to_timestamp", "date_part", "lpad", "date_format", "cos", "sin").foreach { func =>
         apis.foreach { apiFunc =>
-          val resultSet = apiFunc("", dftSchema, func)
+          val resultSet = apiFunc("", defaultSchema, func)
           while (resultSet.next()) {
             val exprInfo = FunctionRegistry.expressions(func)._1
             assert(resultSet.getString(FUNCTION_CAT).isEmpty)
diff --git a/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/session/SessionSuite.scala b/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/session/SessionSuite.scala
index 928b90a..1639d7d 100644
--- a/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/session/SessionSuite.scala
+++ b/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/session/SessionSuite.scala
@@ -22,10 +22,10 @@ import org.scalatest.time.SpanSugar._
 
 import org.apache.kyuubi.config.KyuubiConf._
 import org.apache.kyuubi.engine.spark.WithSparkSQLEngine
-import org.apache.kyuubi.operation.JDBCTestUtils
+import org.apache.kyuubi.operation.HiveJDBCTestHelper
 import org.apache.kyuubi.service.ServiceState._
 
-class SessionSuite extends WithSparkSQLEngine with JDBCTestUtils {
+class SessionSuite extends WithSparkSQLEngine with HiveJDBCTestHelper {
   override def withKyuubiConf: Map[String, String] = {
    Map(ENGINE_SHARE_LEVEL.key -> "CONNECTION")
   }
diff --git a/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/session/SingleSessionSuite.scala b/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/session/SingleSessionSuite.scala
index bb9e1b5..34bba41 100644
--- a/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/session/SingleSessionSuite.scala
+++ b/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/session/SingleSessionSuite.scala
@@ -19,9 +19,9 @@ package org.apache.kyuubi.engine.spark.session
 
 import org.apache.kyuubi.config.KyuubiConf._
 import org.apache.kyuubi.engine.spark.WithSparkSQLEngine
-import org.apache.kyuubi.operation.JDBCTestUtils
+import org.apache.kyuubi.operation.HiveJDBCTestHelper
 
-class SingleSessionSuite extends WithSparkSQLEngine with JDBCTestUtils {
+class SingleSessionSuite extends WithSparkSQLEngine with HiveJDBCTestHelper {
 
   override def withKyuubiConf: Map[String, String] = {
     Map(ENGINE_SHARE_LEVEL.key -> "SERVER",
diff --git a/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/spark/kyuubi/SQLOperationListenerSuite.scala b/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/spark/kyuubi/SQLOperationListenerSuite.scala
index 16fb00a..6af004d 100644
--- a/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/spark/kyuubi/SQLOperationListenerSuite.scala
+++ b/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/spark/kyuubi/SQLOperationListenerSuite.scala
@@ -23,9 +23,9 @@ import org.apache.hive.service.rpc.thrift.{TExecuteStatementReq, TFetchOrientati
 import org.scalatest.time.SpanSugar._
 
 import org.apache.kyuubi.engine.spark.WithSparkSQLEngine
-import org.apache.kyuubi.operation.JDBCTestUtils
+import org.apache.kyuubi.operation.HiveJDBCTestHelper
 
-class SQLOperationListenerSuite extends WithSparkSQLEngine with JDBCTestUtils {
+class SQLOperationListenerSuite extends WithSparkSQLEngine with HiveJDBCTestHelper {
 
   override def withKyuubiConf: Map[String, String] = Map.empty
 
diff --git a/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/spark/kyuubi/ui/EngineTabSuite.scala b/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/spark/kyuubi/ui/EngineTabSuite.scala
index 717c9fa..f2ad75e 100644
--- a/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/spark/kyuubi/ui/EngineTabSuite.scala
+++ b/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/spark/kyuubi/ui/EngineTabSuite.scala
@@ -23,9 +23,9 @@ import org.apache.http.util.EntityUtils
 import org.apache.spark.SparkContext
 
 import org.apache.kyuubi.engine.spark.WithSparkSQLEngine
-import org.apache.kyuubi.operation.JDBCTestUtils
+import org.apache.kyuubi.operation.HiveJDBCTestHelper
 
-class EngineTabSuite extends WithSparkSQLEngine with JDBCTestUtils {
+class EngineTabSuite extends WithSparkSQLEngine with HiveJDBCTestHelper {
   override def withKyuubiConf: Map[String, String] = Map(
     "spark.ui.enabled" -> "true",
     "spark.ui.port" -> "0")
diff --git a/kubernetes/integration-tests/src/test/scala/org/apache/kyuubi/kubernetes/test/KubernetesJDBCTestsSuite.scala b/kubernetes/integration-tests/src/test/scala/org/apache/kyuubi/kubernetes/test/KubernetesJDBCTestsSuite.scala
index bc827ae..f982aaa 100644
--- a/kubernetes/integration-tests/src/test/scala/org/apache/kyuubi/kubernetes/test/KubernetesJDBCTestsSuite.scala
+++ b/kubernetes/integration-tests/src/test/scala/org/apache/kyuubi/kubernetes/test/KubernetesJDBCTestsSuite.scala
@@ -18,10 +18,10 @@
 package org.apache.kyuubi.kubernetes.test
 
 import org.apache.kyuubi.Logging
-import org.apache.kyuubi.operation.JDBCTests
+import org.apache.kyuubi.operation.SparkQueryTests
 
 // TODO: [KYUUBI-863] Support test Spark engine using k8s master with minikube
-class KubernetesJDBCTestsSuite extends JDBCTests with Logging {
+class KubernetesJDBCTestsSuite extends SparkQueryTests with Logging {
   private lazy val _jdbcUrl: String = {
     val kubernetesclient = MiniKube.getKubernetesClient
     val kyuubiServers =
diff --git a/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/BasicDeltaJDBCTests.scala b/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/DeltaMetadataTests.scala
similarity index 99%
rename from kyuubi-common/src/test/scala/org/apache/kyuubi/operation/BasicDeltaJDBCTests.scala
rename to kyuubi-common/src/test/scala/org/apache/kyuubi/operation/DeltaMetadataTests.scala
index bf07da1..d44f223 100644
--- a/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/BasicDeltaJDBCTests.scala
+++ b/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/DeltaMetadataTests.scala
@@ -20,7 +20,7 @@ package org.apache.kyuubi.operation
 import org.apache.kyuubi.DeltaSuiteMixin
 import org.apache.kyuubi.operation.meta.ResultSetSchemaConstant._
 
-trait BasicDeltaJDBCTests extends JDBCTestUtils with DeltaSuiteMixin {
+trait DeltaMetadataTests extends HiveJDBCTestHelper with DeltaSuiteMixin {
 
   test("get catalogs") {
     withJdbcStatement() { statement =>
diff --git a/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/JDBCTestUtils.scala b/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/HiveJDBCTestHelper.scala
similarity index 84%
rename from kyuubi-common/src/test/scala/org/apache/kyuubi/operation/JDBCTestUtils.scala
rename to kyuubi-common/src/test/scala/org/apache/kyuubi/operation/HiveJDBCTestHelper.scala
index 0abcbaf..c21392a 100644
--- a/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/JDBCTestUtils.scala
+++ b/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/HiveJDBCTestHelper.scala
@@ -30,7 +30,7 @@ import org.scalatest.time.SpanSugar.convertIntToGrainOfTime
 import org.apache.kyuubi.{KyuubiFunSuite, Utils}
 import org.apache.kyuubi.service.authentication.PlainSASLHelper
 
-trait JDBCTestUtils extends KyuubiFunSuite {
+trait HiveJDBCTestHelper extends KyuubiFunSuite {
 
   // Load KyuubiHiveDriver class before using it, otherwise will cause the first call
   // `DriverManager.getConnection("jdbc:hive2://...")` failure.
@@ -38,46 +38,47 @@ trait JDBCTestUtils extends KyuubiFunSuite {
   def hiveJdbcDriverClass: String = "org.apache.kyuubi.jdbc.KyuubiHiveDriver"
   Class.forName(hiveJdbcDriverClass)
 
-  protected val dftSchema = "default"
+  protected def defaultSchema = "default"
+  protected def matchAllPatterns = Seq("", "*", "%", null, ".*", "_*", "_%", ".%")
   protected lazy val user: String = Utils.currentUser
-  protected val patterns = Seq("", "*", "%", null, ".*", "_*", "_%", ".%")
-  protected def jdbcUrl: String
-  private var _sessionConfs: Map[String, String] = Map.empty
-  private var _sparkHiveConfs: Map[String, String] = Map.empty
-  private var _sparkHiveVars: Map[String, String] = Map.empty
-  protected def sessionConfigs: Map[String, String] = _sessionConfs
-  protected def sparkHiveConfigs: Map[String, String] = _sparkHiveConfs
-  protected def sparkHiveVars: Map[String, String] = _sparkHiveVars
+  private var _sessionConfigs: Map[String, String] = Map.empty
+  private var _jdbcConfigs: Map[String, String] = Map.empty
+  private var _jdbcVars: Map[String, String] = Map.empty
+  protected def sessionConfigs: Map[String, String] = _sessionConfigs
+  protected def jdbcConfigs: Map[String, String] = _jdbcConfigs
+  protected def jdbcVars: Map[String, String] = _jdbcVars
 
   def withSessionConf[T](
-      sessionConfs: Map[String, String] = Map.empty)(
-      sparkHiveConfs: Map[String, String])(
-      sparkHiveVars: Map[String, String])(f: => T): T = {
-    this._sessionConfs = sessionConfs
-    this._sparkHiveConfs = sparkHiveConfs
-    this._sparkHiveVars = sparkHiveVars
+      sessionConfigs: Map[String, String] = Map.empty)(
+      jdbcConfigs: Map[String, String])(
+      jdbcVars: Map[String, String])(f: => T): T = {
+    this._sessionConfigs = sessionConfigs
+    this._jdbcConfigs = jdbcConfigs
+    this._jdbcVars = jdbcVars
     try f finally {
-      _sparkHiveVars = Map.empty
-      _sparkHiveConfs = Map.empty
-      _sessionConfs = Map.empty
+      _jdbcVars = Map.empty
+      _jdbcConfigs = Map.empty
+      _sessionConfigs = Map.empty
     }
   }
 
+  protected def jdbcUrl: String
+
   protected def jdbcUrlWithConf: String = jdbcUrlWithConf(jdbcUrl)
 
   protected def jdbcUrlWithConf(jdbcUrl: String): String = {
     val sessionConfStr = sessionConfigs.map(kv => kv._1 + "=" + kv._2).mkString(";")
-    val sparkHiveConfStr = if (sparkHiveConfigs.isEmpty) {
+    val jdbcConfStr = if (jdbcConfigs.isEmpty) {
       ""
     } else {
-      "?" + sparkHiveConfigs.map(kv => kv._1 + "=" + kv._2).mkString(";")
+      "?" + jdbcConfigs.map(kv => kv._1 + "=" + kv._2).mkString(";")
     }
-    val sparkHiveVarsStr = if (sparkHiveVars.isEmpty) {
+    val jdbcVarsStr = if (jdbcVars.isEmpty) {
       ""
     } else {
-      "#" + sparkHiveVars.map(kv => kv._1 + "=" + kv._2).mkString(";")
+      "#" + jdbcVars.map(kv => kv._1 + "=" + kv._2).mkString(";")
     }
-    jdbcUrl + sessionConfStr + sparkHiveConfStr + sparkHiveVarsStr
+    jdbcUrl + sessionConfStr + jdbcConfStr + jdbcVarsStr
   }
 
   def assertJDBCConnectionFail(jdbcUrl: String = jdbcUrlWithConf): SQLException = {
diff --git a/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/HiveJDBCTests.scala b/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/HiveMetadataTests.scala
similarity index 97%
rename from kyuubi-common/src/test/scala/org/apache/kyuubi/operation/HiveJDBCTests.scala
rename to kyuubi-common/src/test/scala/org/apache/kyuubi/operation/HiveMetadataTests.scala
index 236bfc6..4b23256 100644
--- a/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/HiveJDBCTests.scala
+++ b/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/HiveMetadataTests.scala
@@ -20,7 +20,8 @@ package org.apache.kyuubi.operation
 import org.apache.kyuubi.Utils
 import org.apache.kyuubi.operation.meta.ResultSetSchemaConstant._
 
-trait HiveJDBCTests extends BasicJDBCTests {
+// For `hive` external catalog only
+trait HiveMetadataTests extends SparkMetadataTests {
 
   test("get tables - hive catalog") {
     val table_test = "table_1_test"
diff --git a/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/BasicHudiJDBCTests.scala b/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/HudiMetadataTests.scala
similarity index 94%
rename from kyuubi-common/src/test/scala/org/apache/kyuubi/operation/BasicHudiJDBCTests.scala
rename to kyuubi-common/src/test/scala/org/apache/kyuubi/operation/HudiMetadataTests.scala
index 36ec2a0..9286668 100644
--- a/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/BasicHudiJDBCTests.scala
+++ b/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/HudiMetadataTests.scala
@@ -21,7 +21,7 @@ import org.apache.kyuubi.HudiSuiteMixin
 import org.apache.kyuubi.operation.meta.ResultSetSchemaConstant._
 
 
-trait BasicHudiJDBCTests extends JDBCTestUtils with HudiSuiteMixin {
+trait HudiMetadataTests extends HiveJDBCTestHelper with HudiSuiteMixin {
 
   test("get catalogs") {
     withJdbcStatement() { statement =>
@@ -114,7 +114,7 @@ trait BasicHudiJDBCTests extends JDBCTestUtils with HudiSuiteMixin {
     val tableName = "hudi_get_col_operation"
     val ddl =
       s"""
-         |CREATE TABLE IF NOT EXISTS $catalog.$dftSchema.$tableName (
+         |CREATE TABLE IF NOT EXISTS $catalog.$defaultSchema.$tableName (
          |  ${cols.map { case (cn, dt) => cn + " " + dt }.mkString(",\n")}
          |)
          |USING hudi""".stripMargin
@@ -125,7 +125,7 @@ trait BasicHudiJDBCTests extends JDBCTestUtils with HudiSuiteMixin {
       val metaData = statement.getConnection.getMetaData
 
       Seq("%", null, ".*", "c.*") foreach { columnPattern =>
-        val rowSet = metaData.getColumns(catalog, dftSchema, tableName, columnPattern)
+        val rowSet = metaData.getColumns(catalog, defaultSchema, tableName, columnPattern)
 
         import java.sql.Types._
         val expectedJavaTypes = Seq(BOOLEAN, INTEGER, BIGINT, FLOAT, DOUBLE, DECIMAL, DECIMAL,
@@ -134,7 +134,7 @@ trait BasicHudiJDBCTests extends JDBCTestUtils with HudiSuiteMixin {
         var pos = 0
         while (rowSet.next()) {
           assert(rowSet.getString(TABLE_CAT) === catalog)
-          assert(rowSet.getString(TABLE_SCHEM) === dftSchema)
+          assert(rowSet.getString(TABLE_SCHEM) === defaultSchema)
           assert(rowSet.getString(TABLE_NAME) === tableName)
           rowSet.getString(COLUMN_NAME) match {
             case name if reservedCols.contains(name) =>
diff --git a/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/BasicIcebergJDBCTests.scala b/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/IcebergMetadataTests.scala
similarity index 92%
rename from kyuubi-common/src/test/scala/org/apache/kyuubi/operation/BasicIcebergJDBCTests.scala
rename to kyuubi-common/src/test/scala/org/apache/kyuubi/operation/IcebergMetadataTests.scala
index ce54b60..12d3f6e 100644
--- a/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/BasicIcebergJDBCTests.scala
+++ b/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/IcebergMetadataTests.scala
@@ -20,7 +20,7 @@ package org.apache.kyuubi.operation
 import org.apache.kyuubi.IcebergSuiteMixin
 import org.apache.kyuubi.operation.meta.ResultSetSchemaConstant._
 
-trait BasicIcebergJDBCTests extends JDBCTestUtils with IcebergSuiteMixin {
+trait IcebergMetadataTests extends HiveJDBCTestHelper with IcebergSuiteMixin {
 
   test("get catalogs") {
     withJdbcStatement() { statement =>
@@ -43,12 +43,12 @@ trait BasicIcebergJDBCTests extends JDBCTestUtils with IcebergSuiteMixin {
 
 
       // The session catalog
-      patterns foreach { pattern =>
+      matchAllPatterns foreach { pattern =>
         checkGetSchemas(metaData.getSchemas("spark_catalog", pattern), dbDflts, "spark_catalog")
       }
 
       Seq(null, catalog).foreach { cg =>
-        patterns foreach { pattern =>
+        matchAllPatterns foreach { pattern =>
           checkGetSchemas(
             metaData.getSchemas(cg, pattern), dbs ++ Seq("global_temp"), catalog)
         }
@@ -82,7 +82,7 @@ trait BasicIcebergJDBCTests extends JDBCTestUtils with IcebergSuiteMixin {
       val metaData = statement.getConnection.getMetaData
 
       Seq(null, catalog).foreach { cg =>
-        patterns foreach { pattern =>
+        matchAllPatterns foreach { pattern =>
           checkGetSchemas(metaData.getSchemas(cg, pattern),
             dbs ++ Seq("global_temp", "a", "db1", "db1.db2"), catalog)
         }
@@ -143,7 +143,7 @@ trait BasicIcebergJDBCTests extends JDBCTestUtils with IcebergSuiteMixin {
 
     val ddl =
       s"""
-         |CREATE TABLE IF NOT EXISTS $catalog.$dftSchema.$tableName (
+         |CREATE TABLE IF NOT EXISTS $catalog.$defaultSchema.$tableName (
          |  ${cols.map { case (cn, dt) => cn + " " + dt }.mkString(",\n")}
          |)
          |USING iceberg""".stripMargin
@@ -155,7 +155,7 @@ trait BasicIcebergJDBCTests extends JDBCTestUtils with IcebergSuiteMixin {
       val metaData = statement.getConnection.getMetaData
 
       Seq("%", null, ".*", "c.*") foreach { columnPattern =>
-        val rowSet = metaData.getColumns(catalog, dftSchema, tableName, columnPattern)
+        val rowSet = metaData.getColumns(catalog, defaultSchema, tableName, columnPattern)
 
         import java.sql.Types._
         val expectedJavaTypes = Seq(BOOLEAN, INTEGER, BIGINT, FLOAT, DOUBLE,
@@ -166,7 +166,7 @@ trait BasicIcebergJDBCTests extends JDBCTestUtils with IcebergSuiteMixin {
 
         while (rowSet.next()) {
           assert(rowSet.getString(TABLE_CAT) === catalog)
-          assert(rowSet.getString(TABLE_SCHEM) === dftSchema)
+          assert(rowSet.getString(TABLE_SCHEM) === defaultSchema)
           assert(rowSet.getString(TABLE_NAME) === tableName)
           assert(rowSet.getString(COLUMN_NAME) === colNames(pos))
           assert(rowSet.getInt(DATA_TYPE) === expectedJavaTypes(pos))
diff --git a/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/BasicJDBCTests.scala b/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/SparkMetadataTests.scala
similarity index 99%
rename from kyuubi-common/src/test/scala/org/apache/kyuubi/operation/BasicJDBCTests.scala
rename to kyuubi-common/src/test/scala/org/apache/kyuubi/operation/SparkMetadataTests.scala
index c05078f..09f43ba 100644
--- a/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/BasicJDBCTests.scala
+++ b/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/SparkMetadataTests.scala
@@ -19,7 +19,8 @@ package org.apache.kyuubi.operation
 
 import org.apache.kyuubi.operation.meta.ResultSetSchemaConstant._
 
-trait BasicJDBCTests extends JDBCTestUtils {
+// For both `in-memory` and `hive` external catalog
+trait SparkMetadataTests extends HiveJDBCTestHelper {
   test("get catalogs") {
     withJdbcStatement() { statement =>
       val metaData = statement.getConnection.getMetaData
diff --git a/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/JDBCTests.scala b/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/SparkQueryTests.scala
similarity index 99%
rename from kyuubi-common/src/test/scala/org/apache/kyuubi/operation/JDBCTests.scala
rename to kyuubi-common/src/test/scala/org/apache/kyuubi/operation/SparkQueryTests.scala
index 6104b8b..384d1af 100644
--- a/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/JDBCTests.scala
+++ b/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/SparkQueryTests.scala
@@ -26,7 +26,7 @@ import org.apache.hive.service.rpc.thrift.{TExecuteStatementReq, TFetchResultsRe
 
 import org.apache.kyuubi.KYUUBI_VERSION
 
-trait JDBCTests extends BasicJDBCTests {
+trait SparkQueryTests extends HiveJDBCTestHelper {
 
   protected lazy val SPARK_ENGINE_MAJOR_MINOR_VERSION: (Int, Int) = sparkEngineMajorMinorVersion
 
diff --git a/kyuubi-server/src/test/scala/org/apache/kyuubi/engine/spark/InitializeSQLSuite.scala b/kyuubi-server/src/test/scala/org/apache/kyuubi/engine/spark/InitializeSQLSuite.scala
index c789270..f54eb55 100644
--- a/kyuubi-server/src/test/scala/org/apache/kyuubi/engine/spark/InitializeSQLSuite.scala
+++ b/kyuubi-server/src/test/scala/org/apache/kyuubi/engine/spark/InitializeSQLSuite.scala
@@ -20,9 +20,9 @@ package org.apache.kyuubi.engine.spark
 import org.apache.kyuubi.WithKyuubiServer
 import org.apache.kyuubi.config.KyuubiConf
 import org.apache.kyuubi.config.KyuubiConf.{ENGINE_INITIALIZE_SQL, ENGINE_SESSION_INITIALIZE_SQL}
-import org.apache.kyuubi.operation.JDBCTestUtils
+import org.apache.kyuubi.operation.HiveJDBCTestHelper
 
-class InitializeSQLSuite extends WithKyuubiServer with JDBCTestUtils {
+class InitializeSQLSuite extends WithKyuubiServer with HiveJDBCTestHelper {
   override protected val conf: KyuubiConf = {
     KyuubiConf()
       .set(ENGINE_INITIALIZE_SQL.key,
diff --git a/kyuubi-server/src/test/scala/org/apache/kyuubi/engine/spark/SparkSqlEngineSuite.scala b/kyuubi-server/src/test/scala/org/apache/kyuubi/engine/spark/SparkSqlEngineSuite.scala
index a695f63..0a577c6 100644
--- a/kyuubi-server/src/test/scala/org/apache/kyuubi/engine/spark/SparkSqlEngineSuite.scala
+++ b/kyuubi-server/src/test/scala/org/apache/kyuubi/engine/spark/SparkSqlEngineSuite.scala
@@ -20,9 +20,9 @@ package org.apache.kyuubi.engine.spark
 import org.apache.kyuubi.WithKyuubiServer
 import org.apache.kyuubi.config.KyuubiConf
 import org.apache.kyuubi.config.KyuubiConf._
-import org.apache.kyuubi.operation.JDBCTestUtils
+import org.apache.kyuubi.operation.HiveJDBCTestHelper
 
-class SparkSqlEngineSuite extends WithKyuubiServer with JDBCTestUtils {
+class SparkSqlEngineSuite extends WithKyuubiServer with HiveJDBCTestHelper {
   override protected val conf: KyuubiConf = {
     KyuubiConf()
       .set(SESSION_CONF_IGNORE_LIST.key, "kyuubi.abc.xyz,spark.sql.abc.xyz,spark.sql.abc.var")
diff --git a/kyuubi-server/src/test/scala/org/apache/kyuubi/events/EventLoggingServiceSuite.scala b/kyuubi-server/src/test/scala/org/apache/kyuubi/events/EventLoggingServiceSuite.scala
index a6938a4..59fcf37 100644
--- a/kyuubi-server/src/test/scala/org/apache/kyuubi/events/EventLoggingServiceSuite.scala
+++ b/kyuubi-server/src/test/scala/org/apache/kyuubi/events/EventLoggingServiceSuite.scala
@@ -26,10 +26,10 @@ import org.apache.hadoop.fs.{FileSystem, Path}
 
 import org.apache.kyuubi.{Utils, WithKyuubiServer}
 import org.apache.kyuubi.config.KyuubiConf
-import org.apache.kyuubi.operation.JDBCTestUtils
+import org.apache.kyuubi.operation.HiveJDBCTestHelper
 import org.apache.kyuubi.operation.OperationState._
 
-class EventLoggingServiceSuite extends WithKyuubiServer with JDBCTestUtils {
+class EventLoggingServiceSuite extends WithKyuubiServer with HiveJDBCTestHelper {
 
   private val engineLogRoot = "file://" + Utils.createTempDir().toString
   private val serverLogRoot = "file://" + Utils.createTempDir().toString
diff --git a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiIncrementCollectSuite.scala b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiIncrementCollectSuite.scala
index b7aa4f5..be7f0e8 100644
--- a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiIncrementCollectSuite.scala
+++ b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiIncrementCollectSuite.scala
@@ -26,7 +26,7 @@ import org.scalatest.time.SpanSugar.convertIntToGrainOfTime
 import org.apache.kyuubi.WithKyuubiServer
 import org.apache.kyuubi.config.KyuubiConf
 
-class KyuubiIncrementCollectSuite extends WithKyuubiServer with JDBCTestUtils {
+class KyuubiIncrementCollectSuite extends WithKyuubiServer with HiveJDBCTestHelper {
 
   override protected val conf: KyuubiConf = KyuubiConf()
     .set(KyuubiConf.OPERATION_INCREMENTAL_COLLECT, true)
diff --git a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiJdbcDriverHASuite.scala b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiJdbcDriverHASuite.scala
index 0994118..baa91e3 100644
--- a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiJdbcDriverHASuite.scala
+++ b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiJdbcDriverHASuite.scala
@@ -21,7 +21,7 @@ import org.apache.kyuubi.WithKyuubiServer
 import org.apache.kyuubi.config.KyuubiConf
 import org.apache.kyuubi.ha.HighAvailabilityConf
 
-class KyuubiJdbcDriverHASuite extends WithKyuubiServer with BasicJDBCTests {
+class KyuubiJdbcDriverHASuite extends WithKyuubiServer with SparkMetadataTests {
 
   override protected val conf: KyuubiConf = KyuubiConf()
 
diff --git a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationEnginePoolSuite.scala b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationEnginePoolSuite.scala
index b121dfd..777b6f8 100644
--- a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationEnginePoolSuite.scala
+++ b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationEnginePoolSuite.scala
@@ -22,7 +22,7 @@ import org.scalatest.time.SpanSugar._
 import org.apache.kyuubi.WithKyuubiServer
 import org.apache.kyuubi.config.KyuubiConf
 
-class KyuubiOperationEnginePoolSuite extends WithKyuubiServer with JDBCTestUtils {
+class KyuubiOperationEnginePoolSuite extends WithKyuubiServer with HiveJDBCTestHelper {
 
   override protected def jdbcUrl: String = getJdbcUrl
 
diff --git a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationHiveCatalogSuite.scala b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationHiveCatalogSuite.scala
index 41a7415..3e41505 100644
--- a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationHiveCatalogSuite.scala
+++ b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationHiveCatalogSuite.scala
@@ -22,7 +22,7 @@ import java.nio.file.Files
 import org.apache.kyuubi.{Utils, WithKyuubiServer}
 import org.apache.kyuubi.config.KyuubiConf
 
-class KyuubiOperationHiveCatalogSuite extends WithKyuubiServer with HiveJDBCTests {
+class KyuubiOperationHiveCatalogSuite extends WithKyuubiServer with HiveMetadataTests {
 
   private val metastore = {
     val dir = Utils.createTempDir()
diff --git a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationKerberosAndPlainAuthSuite.scala b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationKerberosAndPlainAuthSuite.scala
index 2e94d21..2c6347b 100644
--- a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationKerberosAndPlainAuthSuite.scala
+++ b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationKerberosAndPlainAuthSuite.scala
@@ -27,7 +27,7 @@ import org.apache.kyuubi.config.KyuubiConf
 import org.apache.kyuubi.service.authentication.{UserDefineAuthenticationProviderImpl, WithLdapServer}
 
 class KyuubiOperationKerberosAndPlainAuthSuite extends
-  WithKyuubiServer with KerberizedTestHelper with WithLdapServer with JDBCTestUtils {
+  WithKyuubiServer with KerberizedTestHelper with WithLdapServer with HiveJDBCTestHelper {
   private val customUser: String = "user"
   private val customPasswd: String = "password"
 
diff --git a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationManagerSuite.scala b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationManagerSuite.scala
index 601160c..4301f68 100644
--- a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationManagerSuite.scala
+++ b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationManagerSuite.scala
@@ -23,7 +23,7 @@ import org.apache.kyuubi.WithKyuubiServer
 import org.apache.kyuubi.config.KyuubiConf
 import org.apache.kyuubi.config.KyuubiConf.OPERATION_QUERY_TIMEOUT
 
-class KyuubiOperationManagerSuite extends WithKyuubiServer with JDBCTestUtils {
+class KyuubiOperationManagerSuite extends WithKyuubiServer with HiveJDBCTestHelper {
   override protected val conf: KyuubiConf = {
     KyuubiConf().set(OPERATION_QUERY_TIMEOUT.key, "PT1S")
   }
diff --git a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationPerConnectionSuite.scala b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationPerConnectionSuite.scala
index 993fc99..e0011b1 100644
--- a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationPerConnectionSuite.scala
+++ b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationPerConnectionSuite.scala
@@ -29,7 +29,7 @@ import org.apache.kyuubi.config.KyuubiConf
 /**
  * UT with Connection level engine shared cost much time, only run basic jdbc tests.
  */
-class KyuubiOperationPerConnectionSuite extends WithKyuubiServer with JDBCTestUtils {
+class KyuubiOperationPerConnectionSuite extends WithKyuubiServer with HiveJDBCTestHelper {
 
   override protected def jdbcUrl: String = getJdbcUrl
 
diff --git a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationGroupSuite.scala b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationPerGroupSuite.scala
similarity index 76%
rename from kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationGroupSuite.scala
rename to kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationPerGroupSuite.scala
index 209269b..6fb6b48 100644
--- a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationGroupSuite.scala
+++ b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationPerGroupSuite.scala
@@ -21,19 +21,26 @@ import org.apache.hadoop.security.UserGroupInformation
 
 import org.apache.kyuubi.WithKyuubiServer
 import org.apache.kyuubi.config.KyuubiConf
-import org.apache.kyuubi.util.KyuubiHadoopUtils
 
-class KyuubiOperationGroupSuite extends WithKyuubiServer with JDBCTests {
+class KyuubiOperationPerGroupSuite extends WithKyuubiServer with SparkQueryTests {
 
   override protected def jdbcUrl: String = getJdbcUrl
 
-  override protected val conf: KyuubiConf = {
-    val c = KyuubiConf().set(KyuubiConf.ENGINE_SHARE_LEVEL, "group")
-      .set("hadoop.user.group.static.mapping.overrides",
-        s"user1=testGG,group_tt;user2=testGG")
-    UserGroupInformation.setConfiguration(KyuubiHadoopUtils.newHadoopConf(c))
-    c.set(s"hadoop.proxyuser.$user.groups", "*")
-      .set(s"hadoop.proxyuser.$user.hosts", "*")
+  override protected lazy val conf: KyuubiConf = KyuubiConf()
+    .set(KyuubiConf.ENGINE_SHARE_LEVEL, "group")
+    .set("hadoop.user.group.static.mapping.overrides", s"user1=testGG,group_tt;user2=testGG")
+    .set(s"hadoop.proxyuser.$user.groups", "*")
+    .set(s"hadoop.proxyuser.$user.hosts", "*")
+
+  override def beforeAll(): Unit = {
+    UserGroupInformation.createUserForTesting("user1", Array("testGG", "group_tt"))
+    UserGroupInformation.createUserForTesting("user2", Array("testGG"))
+    super.beforeAll()
+  }
+
+  override def afterAll(): Unit = {
+    UserGroupInformation.reset()
+    super.afterAll()
   }
 
   test("ensure two connections in group mode share the same engine started by primary group") {
diff --git a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationPerServerSuite.scala b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationPerServerSuite.scala
index 18f10e6..4ffc62a 100644
--- a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationPerServerSuite.scala
+++ b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationPerServerSuite.scala
@@ -20,7 +20,7 @@ package org.apache.kyuubi.operation
 import org.apache.kyuubi.WithKyuubiServer
 import org.apache.kyuubi.config.KyuubiConf
 
-class KyuubiOperationPerServerSuite extends WithKyuubiServer with JDBCTests {
+class KyuubiOperationPerServerSuite extends WithKyuubiServer with SparkQueryTests {
 
   override protected def jdbcUrl: String = getJdbcUrl
 
diff --git a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationPerUserSuite.scala b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationPerUserSuite.scala
index 42b126d..a6aa3a3 100644
--- a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationPerUserSuite.scala
+++ b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationPerUserSuite.scala
@@ -22,7 +22,7 @@ import org.scalatest.time.SpanSugar._
 import org.apache.kyuubi.{Utils, WithKyuubiServer}
 import org.apache.kyuubi.config.KyuubiConf
 
-class KyuubiOperationPerUserSuite extends WithKyuubiServer with JDBCTests {
+class KyuubiOperationPerUserSuite extends WithKyuubiServer with SparkQueryTests {
 
   override protected def jdbcUrl: String = getJdbcUrl
 
diff --git a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationYarnClusterSuite.scala b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationYarnClusterSuite.scala
index ee0e766..604af7a 100644
--- a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationYarnClusterSuite.scala
+++ b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationYarnClusterSuite.scala
@@ -21,7 +21,7 @@ import org.apache.kyuubi.WithKyuubiServerOnYarn
 import org.apache.kyuubi.config.KyuubiConf
 import org.apache.kyuubi.config.KyuubiConf.ENGINE_INIT_TIMEOUT
 
-class KyuubiOperationYarnClusterSuite extends WithKyuubiServerOnYarn with JDBCTests {
+class KyuubiOperationYarnClusterSuite extends WithKyuubiServerOnYarn with SparkQueryTests {
 
   override protected def jdbcUrl: String = getJdbcUrl
 
diff --git a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/PlanOnlyOperationSuite.scala b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/PlanOnlyOperationSuite.scala
index 1c9529e..36af242 100644
--- a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/PlanOnlyOperationSuite.scala
+++ b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/PlanOnlyOperationSuite.scala
@@ -20,7 +20,7 @@ package org.apache.kyuubi.operation
 import org.apache.kyuubi.WithKyuubiServer
 import org.apache.kyuubi.config.KyuubiConf
 
-class PlanOnlyOperationSuite extends WithKyuubiServer with JDBCTestUtils {
+class PlanOnlyOperationSuite extends WithKyuubiServer with HiveJDBCTestHelper {
 
   override protected val conf: KyuubiConf = {
     KyuubiConf()
diff --git a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/datalake/DeltaOperationSuite.scala b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/datalake/DeltaOperationSuite.scala
index c1e2d8d..a9439d3 100644
--- a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/datalake/DeltaOperationSuite.scala
+++ b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/datalake/DeltaOperationSuite.scala
@@ -19,11 +19,11 @@ package org.apache.kyuubi.operation.datalake
 
 import org.apache.kyuubi.WithKyuubiServer
 import org.apache.kyuubi.config.KyuubiConf
-import org.apache.kyuubi.operation.BasicDeltaJDBCTests
+import org.apache.kyuubi.operation.DeltaMetadataTests
 import org.apache.kyuubi.tags.DeltaTest
 
 @DeltaTest
-class DeltaOperationSuite extends WithKyuubiServer with BasicDeltaJDBCTests {
+class DeltaOperationSuite extends WithKyuubiServer with DeltaMetadataTests {
   override protected val conf: KyuubiConf = {
     val kyuubiConf = KyuubiConf().set(KyuubiConf.ENGINE_IDLE_TIMEOUT, 20000L)
     extraConfigs.foreach { case (k, v) => kyuubiConf.set(k, v) }
diff --git a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/datalake/HudiOperationSuite.scala b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/datalake/HudiOperationSuite.scala
index ed90f26..0c50750 100644
--- a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/datalake/HudiOperationSuite.scala
+++ b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/datalake/HudiOperationSuite.scala
@@ -19,11 +19,11 @@ package org.apache.kyuubi.operation.datalake
 
 import org.apache.kyuubi.WithKyuubiServer
 import org.apache.kyuubi.config.KyuubiConf
-import org.apache.kyuubi.operation.BasicHudiJDBCTests
+import org.apache.kyuubi.operation.HudiMetadataTests
 import org.apache.kyuubi.tags.HudiTest
 
 @HudiTest
-class HudiOperationSuite extends WithKyuubiServer with BasicHudiJDBCTests {
+class HudiOperationSuite extends WithKyuubiServer with HudiMetadataTests {
   override protected val conf: KyuubiConf = {
     val kyuubiConf = KyuubiConf().set(KyuubiConf.ENGINE_IDLE_TIMEOUT, 20000L)
     extraConfigs.foreach { case (k, v) => kyuubiConf.set(k, v) }
diff --git a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/datalake/IcebergOperationSuite.scala b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/datalake/IcebergOperationSuite.scala
index fd6179d..b7cd78e 100644
--- a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/datalake/IcebergOperationSuite.scala
+++ b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/datalake/IcebergOperationSuite.scala
@@ -19,11 +19,11 @@ package org.apache.kyuubi.operation.datalake
 
 import org.apache.kyuubi.WithKyuubiServer
 import org.apache.kyuubi.config.KyuubiConf
-import org.apache.kyuubi.operation.BasicIcebergJDBCTests
+import org.apache.kyuubi.operation.IcebergMetadataTests
 import org.apache.kyuubi.tags.IcebergTest
 
 @IcebergTest
-class IcebergOperationSuite extends WithKyuubiServer with BasicIcebergJDBCTests {
+class IcebergOperationSuite extends WithKyuubiServer with IcebergMetadataTests {
   override protected val conf: KyuubiConf = {
     val kyuubiConf = KyuubiConf().set(KyuubiConf.ENGINE_IDLE_TIMEOUT, 20000L)
     extraConfigs.foreach { case (k, v) => kyuubiConf.set(k, v) }
diff --git a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/tpcds/DDLTPCDSSuite.scala b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/tpcds/DDLTPCDSSuite.scala
index bbc27a7..791fecc 100644
--- a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/tpcds/DDLTPCDSSuite.scala
+++ b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/tpcds/DDLTPCDSSuite.scala
@@ -19,13 +19,13 @@ package org.apache.kyuubi.operation.tpcds
 
 import org.apache.kyuubi.{DeltaSuiteMixin, WithKyuubiServer}
 import org.apache.kyuubi.config.KyuubiConf
-import org.apache.kyuubi.operation.JDBCTestUtils
+import org.apache.kyuubi.operation.HiveJDBCTestHelper
 import org.apache.kyuubi.tags.{DeltaTest, ExtendedSQLTest}
 
 @DeltaTest
 @ExtendedSQLTest
 class DDLTPCDSSuite extends WithKyuubiServer
-  with JDBCTestUtils
+  with HiveJDBCTestHelper
   with TPCDSHelper
   with DeltaSuiteMixin {
 
diff --git a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/tpcds/OutputSchemaTPCDSSuite.scala b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/tpcds/OutputSchemaTPCDSSuite.scala
index b00adb0..fa8a4a3 100644
--- a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/tpcds/OutputSchemaTPCDSSuite.scala
+++ b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/tpcds/OutputSchemaTPCDSSuite.scala
@@ -22,7 +22,7 @@ import java.nio.file.{Files, Path, Paths}
 
 import org.apache.kyuubi.{DeltaSuiteMixin, WithKyuubiServer}
 import org.apache.kyuubi.config.KyuubiConf
-import org.apache.kyuubi.operation.JDBCTestUtils
+import org.apache.kyuubi.operation.HiveJDBCTestHelper
 import org.apache.kyuubi.tags.{DeltaTest, ExtendedSQLTest}
 
 // scalastyle:off line.size.limit
@@ -41,7 +41,7 @@ import org.apache.kyuubi.tags.{DeltaTest, ExtendedSQLTest}
 @DeltaTest
 @ExtendedSQLTest
 class OutputSchemaTPCDSSuite extends WithKyuubiServer
-  with JDBCTestUtils
+  with HiveJDBCTestHelper
   with TPCDSHelper
   with DeltaSuiteMixin {