impala-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tarmstr...@apache.org
Subject [49/50] [abbrv] incubator-impala git commit: Run MT_DOP tests on all file formats.
Date Thu, 17 Nov 2016 16:10:00 GMT
Run MT_DOP tests on all file formats.

Change-Id: I28d5bcc48bbe32fb970b41daa919096061a05beb
Reviewed-on: http://gerrit.cloudera.org:8080/5025
Reviewed-by: Alex Behm <alex.behm@cloudera.com>
Tested-by: Internal Jenkins


Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/0a654b31
Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/0a654b31
Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/0a654b31

Branch: refs/heads/hadoop-next
Commit: 0a654b31869c77d667cd692a5f36cf0748b31c64
Parents: 9434e38
Author: Alex Behm <alex.behm@cloudera.com>
Authored: Wed Nov 9 12:06:26 2016 -0800
Committer: Internal Jenkins <cloudera-hudson@gerrit.cloudera.org>
Committed: Tue Nov 15 23:47:40 2016 +0000

----------------------------------------------------------------------
 tests/query_test/test_mt_dop.py | 44 ++++++++++++++++++++++++------------
 1 file changed, 30 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/0a654b31/tests/query_test/test_mt_dop.py
----------------------------------------------------------------------
diff --git a/tests/query_test/test_mt_dop.py b/tests/query_test/test_mt_dop.py
index 4bc5179..d05d6b4 100644
--- a/tests/query_test/test_mt_dop.py
+++ b/tests/query_test/test_mt_dop.py
@@ -31,11 +31,6 @@ class TestMtDop(ImpalaTestSuite):
   def add_test_dimensions(cls):
     super(TestMtDop, cls).add_test_dimensions()
     cls.TestMatrix.add_dimension(TestDimension('mt_dop', *MT_DOP_VALUES))
-    # IMPALA-4332: The MT scheduler does not work for Kudu or HBase tables.
-    cls.TestMatrix.add_constraint(\
-        lambda v: v.get_value('table_format').file_format != 'hbase')
-    cls.TestMatrix.add_constraint(\
-        lambda v: v.get_value('table_format').file_format != 'kudu')
 
   @classmethod
   def get_workload(cls):
@@ -46,16 +41,37 @@ class TestMtDop(ImpalaTestSuite):
     self.run_test_case('QueryTest/mt-dop', vector)
 
   def test_compute_stats(self, unique_database, vector):
-    table_loc = self._get_table_location("alltypes", vector)
-    # Create a second table in the same format pointing to the same data files.
-    # This function switches to the format-specific DB in vector.
-    self.execute_query_using_client(self.client,
-      "create external table %s.mt_dop like alltypes location '%s'"
-      % (unique_database, table_loc), vector)
-    self.execute_query_using_client(self.client,
-      "alter table %s.mt_dop recover partitions" % unique_database, vector)
     vector.get_value('exec_option')['mt_dop'] = vector.get_value('mt_dop')
-    self.run_test_case('QueryTest/mt-dop-compute-stats', vector, unique_database)
+    file_format = vector.get_value('table_format').file_format
+    fq_table_name = "%s.mt_dop" % unique_database
+
+    # Different formats need different DDL for creating a test table, and also
+    # have different expected results for compute stats.
+    expected_results = None
+    if file_format == 'kudu':
+      # CREATE TABLE LIKE is currently not supported for Kudu tables.
+      self.execute_query("create external table %s stored as kudu "
+        "tblproperties('kudu.table_name'='impala::functional_kudu.alltypes')"
+        % fq_table_name)
+      expected_results = "Updated 1 partition(s) and 13 column(s)."
+    elif file_format == 'hbase':
+      self.execute_query(
+        "create external table %s like functional_hbase.alltypes" % fq_table_name)
+      expected_results = "Updated 1 partition(s) and 13 column(s)."
+    else:
+      # Create a second table in the same format pointing to the same data files.
+      # This function switches to the format-specific DB in 'vector'.
+      table_loc = self._get_table_location("alltypes", vector)
+      self.execute_query_using_client(self.client,
+        "create external table %s like alltypes location '%s'"
+        % (fq_table_name, table_loc), vector)
+      # Recover partitions for HDFS tables.
+      self.execute_query("alter table %s recover partitions" % fq_table_name)
+      expected_results = "Updated 24 partition(s) and 11 column(s)."
+
+    results = self.execute_query("compute stats %s" % fq_table_name,
+      vector.get_value('exec_option'))
+    assert expected_results in results.data
 
 class TestMtDopParquet(ImpalaTestSuite):
   @classmethod


Mime
View raw message