[ 
https://issues.apache.org/jira/browse/IMPALA-13319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17876193#comment-17876193
 ] 

ASF subversion and git services commented on IMPALA-13319:
----------------------------------------------------------

Commit be6f896d1066095c2fe21ec2d60758e99c5f9931 in impala's branch 
refs/heads/master from Riza Suminto
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=be6f896d1 ]

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 <michael.sm...@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com>


> Avoid duplicate exec option declaration in py.test
> --------------------------------------------------
>
>                 Key: IMPALA-13319
>                 URL: https://issues.apache.org/jira/browse/IMPALA-13319
>             Project: IMPALA
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: Impala 4.4.0
>            Reporter: Riza Suminto
>            Assignee: Riza Suminto
>            Priority: Minor
>             Fix For: Impala 4.5.0
>
>
> add_mandatory_exec_option() may replace existing 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":
> {code:java}
>     cls.ImpalaTestMatrix.add_dimension(create_exec_option_dimension(
>       disable_codegen_options=[False, True]))
>     add_mandatory_exec_option(cls, "disable_codegen", False){code}
>  
> 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 message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscr...@impala.apache.org
For additional commands, e-mail: issues-all-h...@impala.apache.org

Reply via email to