Riza Suminto created IMPALA-12518:
-------------------------------------
Summary: Combine all exec_option dimension in test_vector.py
Key: IMPALA-12518
URL: https://issues.apache.org/jira/browse/IMPALA-12518
Project: IMPALA
Issue Type: Improvement
Components: Infrastructure
Reporter: Riza Suminto
Assignee: Riza Suminto
Currently, when writing pytest that exercise custom query option values, we
need to declare it by making new test dimension, followed by deepcopying the
original vector, and inserting the selected dimension value into exec_option
into 'exec_option'. This this an example of testing mt_dop in
[TestRuntimeFilters.test_basic_filters|https://github.com/apache/impala/blob/b6bdf4c525acfe8b35928d43155cf3bea9be26cb/tests/query_test/test_runtime_filters.py#L76-L77]:
{code:java}
def add_test_dimensions(cls):
super(TestRuntimeFilters, cls).add_test_dimensions()
cls.ImpalaTestMatrix.add_dimension(ImpalaTestDimension('mt_dop', 0, 1))
def test_basic_filters(self, vector):
new_vector = deepcopy(vector)
new_vector.get_value('exec_option')['mt_dop'] =
vector.get_value('mt_dop'){code}
This is required to ensure pairwise and exhaustive combination is generated
correctly. On the other hand, this can be error prone and tedious when a pytest
class has many test methods. Such mistakes can be seen here where the test
methods forgot to append 'disable_optimized_iceberg_v2_read' dimension into
'exec_option' dictionary.
[https://github.com/apache/impala/blob/master/tests/query_test/test_iceberg.py#L1188-L1189]
Ideally, this 'exec_option' population should happen automatically in
test_vector.py during vector generation.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)