You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by ta...@apache.org on 2020/03/24 05:58:02 UTC
[impala] 02/02: Fix test_fuzz_nested_types
This is an automated email from the ASF dual-hosted git repository.
tarmstrong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git
commit acf59ab882277b2359e2d69134307955ced59103
Author: Zoltan Borok-Nagy <bo...@cloudera.com>
AuthorDate: Mon Mar 23 13:19:52 2020 +0100
Fix test_fuzz_nested_types
test_fuzz_nested_types had queries that didn't parse successfully
because they had duplicated names in an inline view:
select count(*) from (
select ... a.pos, ... b.pos
from ...
);
We have 'a.pos' and 'b.pos' here but Impala still considers those as
duplicated names, hence I added aliases for the duplicated fields, e.g.:
a.pos as apos
Now that the queries pase successfully they start the scanners on
corrupted files which is the goal of this test.
Change-Id: I8e4cc231f38fe84ebea982b82021458621fe992f
Reviewed-on: http://gerrit.cloudera.org:8080/15528
Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
tests/query_test/test_scanners_fuzz.py | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/tests/query_test/test_scanners_fuzz.py b/tests/query_test/test_scanners_fuzz.py
index 943473b..5a52828 100644
--- a/tests/query_test/test_scanners_fuzz.py
+++ b/tests/query_test/test_scanners_fuzz.py
@@ -108,13 +108,13 @@ class TestScannersFuzzing(ImpalaTestSuite):
# Additional queries to scan the nested values.
custom_queries = [
"select count(*) from ("
- " select distinct t.id, a.pos, a.item, aa.pos, aa.item, m.key, m.value,"
- " ma.key, ma.value, t.nested_struct.* "
+ " select distinct t.id, a.pos as apos, a.item as aitem, aa.pos, aa.item, "
+ " m.key as mkey, m.value as mvalue, ma.key, ma.value, t.nested_struct.* "
" from complextypestbl t, t.int_array a, t.int_array_array.item aa, "
" t.int_map m, t.int_map_array.item ma) q",
"select count(*) from ("
- " select t.id, t.nested_struct.a, b.pos, b.item, i.e, i.f, m.key,"
+ " select t.id, t.nested_struct.a, b.pos as bpos, b.item as bitem, i.e, i.f, m.key,"
" arr.pos, arr.item "
" from complextypestbl t, t.nested_struct.b, t.nested_struct.c.d.item i,"
" t.nested_struct.g m, m.value.h.i arr) q",
@@ -221,6 +221,9 @@ class TestScannersFuzzing(ImpalaTestSuite):
result = self.execute_query(query, query_options = query_options)
LOG.info('\n'.join(result.log))
except Exception as e:
+ # We should only test queries that parse succesfully.
+ assert "AnalysisException" not in str(e)
+
if 'memory limit exceeded' in str(e).lower():
# Memory limit error should fail query.
continue