You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by bi...@apache.org on 2018/10/09 23:18:19 UTC

[3/8] impala git commit: IMPALA-7647: Add HS2/Impyla dimension to TestQueries

http://git-wip-us.apache.org/repos/asf/impala/blob/d05f73f4/tests/query_test/test_chars.py
----------------------------------------------------------------------
diff --git a/tests/query_test/test_chars.py b/tests/query_test/test_chars.py
index 86ec095..939e07e 100644
--- a/tests/query_test/test_chars.py
+++ b/tests/query_test/test_chars.py
@@ -18,7 +18,8 @@
 import pytest
 
 from tests.common.impala_test_suite import ImpalaTestSuite
-from tests.common.test_dimensions import create_exec_option_dimension
+from tests.common.test_dimensions import (create_exec_option_dimension,
+    create_beeswax_hs2_dimension, hs2_parquet_constraint, hs2_text_constraint)
 from tests.util.filesystem_utils import get_fs_path
 
 class TestStringQueries(ImpalaTestSuite):
@@ -34,11 +35,17 @@ class TestStringQueries(ImpalaTestSuite):
     cls.ImpalaTestMatrix.add_constraint(lambda v:\
         v.get_value('table_format').file_format in ['text'] and
         v.get_value('table_format').compression_codec in ['none'])
+    # Run these queries through both beeswax and HS2 to get coverage of CHAR/VARCHAR
+    # returned via both protocols.
+    cls.ImpalaTestMatrix.add_dimension(create_beeswax_hs2_dimension())
+    cls.ImpalaTestMatrix.add_constraint(hs2_text_constraint)
 
   def test_chars(self, vector):
     self.run_test_case('QueryTest/chars', vector)
 
   def test_chars_tmp_tables(self, vector, unique_database):
+    if vector.get_value('protocol') == 'hs2':
+      pytest.skip("HS2 does not return row counts for inserts")
     # Tests that create temporary tables and require a unique database.
     self.run_test_case('QueryTest/chars-tmp-tables', vector, unique_database)
 
@@ -59,6 +66,10 @@ class TestCharFormats(ImpalaTestSuite):
         v.get_value('table_format').file_format in ['orc'] or
         (v.get_value('table_format').file_format in ['text'] and
         v.get_value('table_format').compression_codec in ['none']))
+    # Run these queries through both beeswax and HS2 to get coverage of CHAR/VARCHAR
+    # returned via both protocols.
+    cls.ImpalaTestMatrix.add_dimension(create_beeswax_hs2_dimension())
+    cls.ImpalaTestMatrix.add_constraint(hs2_parquet_constraint)
 
   def test_char_format(self, vector):
     self.run_test_case('QueryTest/chars-formats', vector)

http://git-wip-us.apache.org/repos/asf/impala/blob/d05f73f4/tests/query_test/test_decimal_queries.py
----------------------------------------------------------------------
diff --git a/tests/query_test/test_decimal_queries.py b/tests/query_test/test_decimal_queries.py
index 45a702d..a156321 100644
--- a/tests/query_test/test_decimal_queries.py
+++ b/tests/query_test/test_decimal_queries.py
@@ -20,7 +20,8 @@
 from copy import copy
 
 from tests.common.impala_test_suite import ImpalaTestSuite
-from tests.common.test_dimensions import create_exec_option_dimension_from_dict
+from tests.common.test_dimensions import (create_exec_option_dimension_from_dict,
+    create_beeswax_hs2_dimension, hs2_parquet_constraint)
 from tests.common.test_vector import ImpalaTestDimension
 
 class TestDecimalQueries(ImpalaTestSuite):
@@ -45,6 +46,11 @@ class TestDecimalQueries(ImpalaTestSuite):
          v.get_value('table_format').compression_codec == 'none') or
          v.get_value('table_format').file_format in ['parquet', 'orc', 'kudu'])
 
+    # Run these queries through both beeswax and HS2 to get coverage of decimals returned
+    # via both protocols.
+    cls.ImpalaTestMatrix.add_dimension(create_beeswax_hs2_dimension())
+    cls.ImpalaTestMatrix.add_constraint(hs2_parquet_constraint)
+
   def test_queries(self, vector):
     self.run_test_case('QueryTest/decimal', vector)
 

http://git-wip-us.apache.org/repos/asf/impala/blob/d05f73f4/tests/query_test/test_insert.py
----------------------------------------------------------------------
diff --git a/tests/query_test/test_insert.py b/tests/query_test/test_insert.py
index 20fee41..46d5249 100644
--- a/tests/query_test/test_insert.py
+++ b/tests/query_test/test_insert.py
@@ -27,8 +27,6 @@ from tests.common.test_dimensions import (
     create_exec_option_dimension,
     create_uncompressed_text_dimension)
 from tests.common.test_result_verifier import (
-    parse_column_types,
-    parse_column_labels,
     QueryTestResult,
     parse_result_rows)
 from tests.common.test_vector import ImpalaTestDimension
@@ -201,8 +199,8 @@ class TestInsertWideTable(ImpalaTestSuite):
     assert result.data == ["1"]
 
     result = self.client.execute("select * from " + table_name)
-    types = parse_column_types(result.schema)
-    labels = parse_column_labels(result.schema)
+    types = result.column_types
+    labels = result.column_labels
     expected = QueryTestResult([col_vals], types, labels, order_matters=False)
     actual = QueryTestResult(parse_result_rows(result), types, labels, order_matters=False)
     assert expected == actual

http://git-wip-us.apache.org/repos/asf/impala/blob/d05f73f4/tests/query_test/test_queries.py
----------------------------------------------------------------------
diff --git a/tests/query_test/test_queries.py b/tests/query_test/test_queries.py
index 90cb392..16a6d9f 100644
--- a/tests/query_test/test_queries.py
+++ b/tests/query_test/test_queries.py
@@ -23,7 +23,9 @@ import re
 
 from tests.common.impala_test_suite import ImpalaTestSuite
 from tests.common.skip import SkipIfEC
-from tests.common.test_dimensions import create_uncompressed_text_dimension, extend_exec_option_dimension
+from tests.common.test_dimensions import (
+    create_uncompressed_text_dimension, extend_exec_option_dimension,
+    create_beeswax_hs2_dimension, hs2_parquet_constraint)
 from tests.common.test_vector import ImpalaTestVector
 
 class TestQueries(ImpalaTestSuite):
@@ -33,6 +35,11 @@ class TestQueries(ImpalaTestSuite):
     if cls.exploration_strategy() == 'core':
       cls.ImpalaTestMatrix.add_constraint(lambda v:\
           v.get_value('table_format').file_format == 'parquet')
+    # Run these queries through both beeswax and HS2 to get coverage of both protocols.
+    # Don't run all combinations of table format and protocol - the dimensions should
+    # be orthogonal.
+    cls.ImpalaTestMatrix.add_dimension(create_beeswax_hs2_dimension())
+    cls.ImpalaTestMatrix.add_constraint(hs2_parquet_constraint)
 
     # Adding a test dimension here to test the small query opt in exhaustive.
     if cls.exploration_strategy() == 'exhaustive':

http://git-wip-us.apache.org/repos/asf/impala/blob/d05f73f4/tests/query_test/test_scanners.py
----------------------------------------------------------------------
diff --git a/tests/query_test/test_scanners.py b/tests/query_test/test_scanners.py
index ab724d2..0000867 100644
--- a/tests/query_test/test_scanners.py
+++ b/tests/query_test/test_scanners.py
@@ -48,8 +48,6 @@ from tests.common.file_utils import (
     create_table_from_parquet,
     create_table_and_copy_files)
 from tests.common.test_result_verifier import (
-    parse_column_types,
-    parse_column_labels,
     QueryTestResult,
     parse_result_rows)
 from tests.common.test_vector import ImpalaTestDimension
@@ -275,8 +273,8 @@ class TestWideTable(ImpalaTestSuite):
       assert len(result.data) == NUM_ROWS
       return
 
-    types = parse_column_types(result.schema)
-    labels = parse_column_labels(result.schema)
+    types = result.column_types
+    labels = result.column_labels
     expected = QueryTestResult(expected_result, types, labels, order_matters=False)
     actual = QueryTestResult(parse_result_rows(result), types, labels,
         order_matters=False)

http://git-wip-us.apache.org/repos/asf/impala/blob/d05f73f4/tests/util/test_file_parser.py
----------------------------------------------------------------------
diff --git a/tests/util/test_file_parser.py b/tests/util/test_file_parser.py
index 8d3c58a..ccd0af5 100644
--- a/tests/util/test_file_parser.py
+++ b/tests/util/test_file_parser.py
@@ -95,7 +95,7 @@ def parse_query_test_file(file_name, valid_section_names=None, encoding=None):
   section_names = valid_section_names
   if section_names is None:
     section_names = ['QUERY', 'RESULTS', 'TYPES', 'LABELS', 'SETUP', 'CATCH', 'ERRORS',
-        'USER', 'RUNTIME_PROFILE', 'SHELL', 'DML_RESULTS']
+        'USER', 'RUNTIME_PROFILE', 'SHELL', 'DML_RESULTS', 'DBAPI_RESULTS', 'HS2_TYPES']
   return parse_test_file(file_name, section_names, encoding=encoding,
       skip_unknown_sections=False)