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

stigahuang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit 3c38888dfb10c462c97ba965b356fef63ba97078
Author: stiga-huang <[email protected]>
AuthorDate: Tue Sep 16 15:47:44 2025 +0800

    IMPALA-14441: Skip tests depending on unsupported HMS APIs for Apache Hive 3
    
    Some tests import new API objects that are missing in Apache Hive 3.
    This patch skips these import statements and related tests when running
    on Apache Hive 3.
    
    Change-Id: I9053b3b9d507a038a018f242628e344a528b5af0
    Reviewed-on: http://gerrit.cloudera.org:8080/23428
    Reviewed-by: Impala Public Jenkins <[email protected]>
    Tested-by: Impala Public Jenkins <[email protected]>
---
 tests/custom_cluster/test_metastore_service.py | 11 +++++++++--
 tests/util/acid_txn.py                         |  6 +++++-
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/tests/custom_cluster/test_metastore_service.py 
b/tests/custom_cluster/test_metastore_service.py
index f185db076..dcbfeb2bd 100644
--- a/tests/custom_cluster/test_metastore_service.py
+++ b/tests/custom_cluster/test_metastore_service.py
@@ -20,25 +20,32 @@ from __future__ import absolute_import, division, 
print_function
 from builtins import range
 import pytest
 
+from tests.common.environ import HIVE_MAJOR_VERSION, IS_APACHE_HIVE
 from impala_thrift_gen.hive_metastore.ttypes import (
     Database,
     FieldSchema,
-    FindNextCompactRequest,
-    GetPartitionsByNamesRequest,
     GetTableRequest,
     SerDeInfo,
     StorageDescriptor,
     Table,
+)
+# The following requests are missing in Apache Hive 3
+if not (IS_APACHE_HIVE and HIVE_MAJOR_VERSION <= 3):
+  from impala_thrift_gen.hive_metastore.ttypes import (
+    FindNextCompactRequest,
+    GetPartitionsByNamesRequest,
     TruncateTableRequest,
     UpdateTransactionalStatsRequest,
     WriteNotificationLogBatchRequest,
 )
 from tests.common.custom_cluster_test_suite import CustomClusterTestSuite
 from tests.common.impala_test_suite import ImpalaTestSuite
+from tests.common.skip import SkipIfApacheHive
 from tests.util.event_processor_utils import EventProcessorUtils
 from tests.util.filesystem_utils import IS_HDFS, IS_OZONE
 
 
[email protected]_not_supported
 class TestMetastoreService(CustomClusterTestSuite):
     """
     Tests for the Catalog Metastore service. Each test in this class should
diff --git a/tests/util/acid_txn.py b/tests/util/acid_txn.py
index 3e28598a7..3ba00143d 100644
--- a/tests/util/acid_txn.py
+++ b/tests/util/acid_txn.py
@@ -19,6 +19,7 @@ from __future__ import absolute_import, division, 
print_function
 
 from thrift.protocol import TBinaryProtocol
 
+from tests.common.environ import HIVE_MAJOR_VERSION, IS_APACHE_HIVE
 from impala_thrift_gen.hive_metastore import ThriftHiveMetastore
 from impala_thrift_gen.hive_metastore.ttypes import (
     AbortTxnRequest,
@@ -33,9 +34,12 @@ from impala_thrift_gen.hive_metastore.ttypes import (
     LockType,
     OpenTxnRequest,
     ShowLocksRequest,
-    TruncateTableRequest,
     UnlockRequest,
 )
+# TruncateTableRequest is missing in Apache Hive 3
+if not (IS_APACHE_HIVE and HIVE_MAJOR_VERSION <= 3):
+  from impala_thrift_gen.hive_metastore.ttypes import TruncateTableRequest
+
 from tests.util.thrift_util import create_transport
 
 # HMS config

Reply via email to