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 <impala-public-jenkins@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
This commit is contained in:
stiga-huang
2025-09-16 15:47:44 +08:00
committed by Impala Public Jenkins
parent 46525bcd7c
commit 3c38888dfb
2 changed files with 14 additions and 3 deletions

View File

@@ -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
@SkipIfApacheHive.feature_not_supported
class TestMetastoreService(CustomClusterTestSuite):
"""
Tests for the Catalog Metastore service. Each test in this class should

View File

@@ -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