From 847e39ea3e5ee290ed7a0d2147d2f9e64e7d93a2 Mon Sep 17 00:00:00 2001 From: Cheng Pan Date: Thu, 23 Nov 2023 14:06:57 +0800 Subject: [PATCH] fix --- .../scala/org/apache/kyuubi/HiveEngineTests.scala | 14 +++++++++----- .../engine/hive/HiveProcessBuilderSuite.scala | 4 ++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/kyuubi-common/src/test/scala/org/apache/kyuubi/HiveEngineTests.scala b/kyuubi-common/src/test/scala/org/apache/kyuubi/HiveEngineTests.scala index 028f755f6c8..d24826cb7e5 100644 --- a/kyuubi-common/src/test/scala/org/apache/kyuubi/HiveEngineTests.scala +++ b/kyuubi-common/src/test/scala/org/apache/kyuubi/HiveEngineTests.scala @@ -229,14 +229,16 @@ trait HiveEngineTests extends HiveJDBCTestHelper { assume(SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_8)) withJdbcStatement() { statement => val resultSet = statement.getConnection.getMetaData.getTableTypes - val expected = Set("TABLE", "VIEW", "MATERIALIZED_VIEW") + // Hive3 removes support for INDEX_TABLE + val expected = Set("TABLE", "VIEW", "MATERIALIZED_VIEW", "INDEX_TABLE") var tableTypes = Set[String]() while (resultSet.next()) { assert(expected.contains(resultSet.getString(TABLE_TYPE))) tableTypes += resultSet.getString(TABLE_TYPE) } assert(!resultSet.next()) - assert(expected.size === tableTypes.size) + // Hive3 removes support for INDEX_TABLE + assert(expected.dropWhile(_ == "INDEX_TABLE").size === tableTypes.size) } } @@ -387,10 +389,12 @@ trait HiveEngineTests extends HiveJDBCTestHelper { assert(typeInfo.getInt(DATA_TYPE) === java.sql.Types.TIMESTAMP) typeInfo.next() - assert(typeInfo.getString(TYPE_NAME) === "TIMESTAMP WITH LOCAL TIME ZONE") - assert(typeInfo.getInt(DATA_TYPE) === java.sql.Types.OTHER) + // Hive3 supports TIMESTAMP WITH LOCAL TIME ZONE + if (typeInfo.getString(TYPE_NAME) === "TIMESTAMP WITH LOCAL TIME ZONE") { + assert(typeInfo.getInt(DATA_TYPE) === java.sql.Types.OTHER) + typeInfo.next() + } - typeInfo.next() assert(typeInfo.getString(TYPE_NAME) === "INTERVAL_YEAR_MONTH") assert(typeInfo.getInt(DATA_TYPE) === java.sql.Types.OTHER) diff --git a/kyuubi-server/src/test/scala/org/apache/kyuubi/engine/hive/HiveProcessBuilderSuite.scala b/kyuubi-server/src/test/scala/org/apache/kyuubi/engine/hive/HiveProcessBuilderSuite.scala index bb9884dfa4b..e4fa0d8b976 100644 --- a/kyuubi-server/src/test/scala/org/apache/kyuubi/engine/hive/HiveProcessBuilderSuite.scala +++ b/kyuubi-server/src/test/scala/org/apache/kyuubi/engine/hive/HiveProcessBuilderSuite.scala @@ -31,9 +31,9 @@ class HiveProcessBuilderSuite extends KyuubiFunSuite { } val commands = builder.toString.split('\n') assert(commands.head.endsWith("bin/java"), "wrong exec") - assert(builder.toString.contains("--conf\nkyuubi.session.user=kyuubi")) + assert(builder.toString.contains("--conf kyuubi.session.user=kyuubi")) assert(commands.exists(ss => ss.contains("kyuubi-hive-sql-engine")), "wrong classpath") - assert(builder.toString.contains("--conf\nkyuubi.on=off")) + assert(builder.toString.contains("--conf kyuubi.on=off")) } test("default engine memory") {