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 2022/03/11 10:36:27 UTC

[impala] branch master updated: IMPALA-11156: TestHmsIntegration.test_desc_json_table failed in exhaustive build

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


The following commit(s) were added to refs/heads/master by this push:
     new 80307d3  IMPALA-11156: TestHmsIntegration.test_desc_json_table failed in exhaustive build
80307d3 is described below

commit 80307d39976c27a7ada11e7cd776a30b09a3abdc
Author: pranav.lodha <pr...@cloudera.com>
AuthorDate: Wed Mar 9 17:47:17 2022 +0530

    IMPALA-11156: TestHmsIntegration.test_desc_json_table failed in exhaustive build
    
    The test was getting skipped as it was not in exhaustive strategy,
    to fix that its been moved to TestHmsIntegrationSanity(ImpalaTestSuite)
    class. Now there are two tests, test_desc_json_tbl and
    test_desc_json_tbl_hive to check whether JSON tables created in
    impala can be described in hive and vice versa.
    Change-Id: I4ddd983aeb82817eb355ca94dcf4a6875986f8e1
    Reviewed-on: http://gerrit.cloudera.org:8080/18299
    Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 tests/metadata/test_hms_integration.py | 44 +++++++++++++++++++---------------
 1 file changed, 25 insertions(+), 19 deletions(-)

diff --git a/tests/metadata/test_hms_integration.py b/tests/metadata/test_hms_integration.py
index a8b6bf7..1eab56f 100644
--- a/tests/metadata/test_hms_integration.py
+++ b/tests/metadata/test_hms_integration.py
@@ -104,6 +104,31 @@ class TestHmsIntegrationSanity(ImpalaTestSuite):
       self.client.execute("invalidate metadata hms_sanity_db.test_tbl")
     assert 'test_tbl' in self.client.execute("show tables in hms_sanity_db").data
 
+  def test_desc_json_tbl(self, unique_database):
+    """
+    This function tests if JSON tables created in impala can be
+    described in hive.
+    """
+    self.client.execute("create table {0}.json_tbl (x int) stored as jsonfile"
+                        .format(unique_database))
+    assert "col_name,data_type,comment\nx,int,from deserializer\n"\
+           == self.run_stmt_in_hive("DESCRIBE {0}.json_tbl"
+                                    .format(unique_database))
+
+  def test_desc_json_tbl_hive(self, unique_database):
+    """
+    This function tests if JSON tables created in hive can be
+    described in impala.
+    """
+    self.run_stmt_in_hive("create table {0}.json_tbl (x int) stored as jsonfile"
+                          .format(unique_database))
+    self.client.execute("INVALIDATE METADATA {0}.json_tbl"
+                        .format(unique_database))
+    # If the below query runs without throwing exception, then
+    # JSON tables created in hive can be described in impala.
+    self.client.execute("DESCRIBE {0}.json_tbl"
+                        .format(unique_database))
+
 @SkipIfS3.hive
 @SkipIfGCS.hive
 @SkipIfCOS.hive
@@ -672,25 +697,6 @@ class TestHmsIntegration(ImpalaTestSuite):
         assert expected == self.hive_columns(table_name)
         assert expected == self.impala_columns(table_name)
 
-  def test_desc_json_table(self, vector):
-    """
-    This is to test whether json tables created in impala be
-     described in hive nad vice versa.
-    """
-
-    with self.ImpalaDbWrapper(self, self.unique_string()) as db_name:
-      with self.ImpalaTableWrapper(self, db_name + '.' + self.unique_string(),
-                                   '(x int) stored as jsonfile') as table_name:
-        expected = self.client.execute('DESC %s' % table_name)
-        assert expected == self.run_stmt_in_hive('DESC %s' % table_name)
-
-    with self.HiveDbWrapper(self, self.unique_string()) as db_name:
-      with self.HiveTableWrapper(self, db_name + '.' + self.unique_string(),
-                                 '(x int) stored as jsonfile') as table_name:
-        expected = self.run_stmt_in_hive('DESC %s' % table_name)
-        self.client.execute('INVALIDATE METADATA %s' % table_name)
-        assert expected == self.client.execute('DESC %s' % table_name)
-
   @pytest.mark.execute_serially
   def test_drop_database(self, vector):
     """