Riza Suminto has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/21707 )

Change subject: IMPALA-13319: Avoid duplicate exec option declaration in py.test
......................................................................

IMPALA-13319: Avoid duplicate exec option declaration in py.test

Before this patch, add_mandatory_exec_option() replace existing query
option values in 'exec_option' dimension and may cause unintended test
vector duplication. For example, the following declaration will create
two duplicate test vector, both with "disable_codegen=False":

    cls.ImpalaTestMatrix.add_dimension(create_exec_option_dimension(
      disable_codegen_options=[False, True]))
    add_mandatory_exec_option(cls, "disable_codegen", False)

add_exec_option_dimension() will create new test dimension for a 'key',
but does not insert it into 'exec_option' dimension until vector
generation later. It also does not validate if 'key' already exist in
'exec_option' dimension. This can confuse test writer when they need to
write constraint, because they might look for the value at
vector.get_value('exec_option')['key'] instead of
vector.get_value('key'), and vice versa.

This patch add assertion to check that no duplicate query option name is
declared through any helper function. It also assert that all query
option names are declared in lowercase.

Testing:
- Manually verify test vector generation in test files containing the
  helper functions by running:
  impala-py.test --exploration=exhaustive --collect-only <test_file>
- Adjust query option declaration that breaks after this change.

Change-Id: I8143e47f19090e20707cfb0a05c779f4d289f33c
Reviewed-on: http://gerrit.cloudera.org:8080/21707
Reviewed-by: Michael Smith <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
---
M tests/common/test_dimensions.py
M tests/common/test_vector.py
M tests/query_test/test_ext_data_sources.py
M tests/query_test/test_join_queries.py
M tests/query_test/test_kudu.py
M tests/query_test/test_limit_pushdown_analytic.py
M tests/query_test/test_nested_types.py
M tests/query_test/test_queries.py
M tests/query_test/test_runtime_filters.py
M tests/query_test/test_scanners.py
10 files changed, 77 insertions(+), 36 deletions(-)

Approvals:
  Michael Smith: Looks good to me, approved
  Impala Public Jenkins: Verified

--
To view, visit http://gerrit.cloudera.org:8080/21707
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I8143e47f19090e20707cfb0a05c779f4d289f33c
Gerrit-Change-Number: 21707
Gerrit-PatchSet: 5
Gerrit-Owner: Riza Suminto <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Jason Fehr <[email protected]>
Gerrit-Reviewer: Michael Smith <[email protected]>
Gerrit-Reviewer: Riza Suminto <[email protected]>

Reply via email to