You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by st...@apache.org on 2021/05/26 06:40:26 UTC

[impala] 02/03: IMPALA-10613: (addendum) Fix test on S3 builds

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 8087c75f62504f177b0a1c9f02eecc4eb81e00fc
Author: Vihang Karajgaonkar <vi...@apache.org>
AuthorDate: Fri May 21 13:13:33 2021 -0700

    IMPALA-10613: (addendum) Fix test on S3 builds
    
    The test_metastore_service.py fails on S3 builds because it expects
    the filemetadata's object dictionary to be present. However, if the
    table is located on S3 then there are no file-blocks in the returned
    file-metadata and hence the length of obj_dict will be 0.
    
    This patch fixes the test in S3 builds by not asserting the check
    on S3, ADLS, GCS builds.
    
    Testing Done:
    1. Ran the test locally to confirm it is working.
    2. [WIP] Ran the test on a S3 environment where tables are created
    on S3.
    
    Change-Id: I6ac291529dc0661abdfc2d4f48924a2c4b807c40
    Reviewed-on: http://gerrit.cloudera.org:8080/17483
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
    Reviewed-by: Vihang Karajgaonkar <vi...@cloudera.com>
---
 tests/custom_cluster/test_metastore_service.py | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/tests/custom_cluster/test_metastore_service.py b/tests/custom_cluster/test_metastore_service.py
index c60fedf..daf8e45 100644
--- a/tests/custom_cluster/test_metastore_service.py
+++ b/tests/custom_cluster/test_metastore_service.py
@@ -27,6 +27,7 @@ from hive_metastore.ttypes import SerDeInfo
 from tests.util.event_processor_utils import EventProcessorUtils
 from tests.common.custom_cluster_test_suite import CustomClusterTestSuite
 from tests.common.impala_test_suite import ImpalaTestSuite
+from tests.util.filesystem_utils import (IS_S3, IS_ADLS, IS_GCS)
 
 
 class TestMetastoreService(CustomClusterTestSuite):
@@ -596,7 +597,10 @@ class TestMetastoreService(CustomClusterTestSuite):
       test_part_names = list(part_names)
       if expect_files:
         assert get_parts_by_names_result.dictionary is not None
-        assert len(get_parts_by_names_result.dictionary.values) > 0
+        # obj_dict will only be populated when the table is on HDFS
+        # where block locations are available.
+        if not IS_S3 and not IS_GCS and not IS_ADLS:
+          assert len(get_parts_by_names_result.dictionary.values) > 0
       else:
         assert get_parts_by_names_result.dictionary is None
       partitions = get_parts_by_names_result.partitions
@@ -621,7 +625,10 @@ class TestMetastoreService(CustomClusterTestSuite):
       assert filemetadata is not None
       assert filemetadata.data is not None
       assert obj_dict is not None
-      assert len(obj_dict.values) > 0
+      # obj_dict will only be populated when the table is on HDFS
+      # where block locations are available.
+      if not IS_S3 and not IS_GCS and not IS_ADLS:
+        assert len(obj_dict.values) > 0
 
     def __assert_no_filemd(self, filemetadata, obj_dict):
       """