IMPALA-2824: Restore query options after each test.

A failed test case inside a test file will leave the rest of
the test cases in the file unexecuted. Some test cases may
modify some query options such as memory limit and then
restore them in the subsequent test cases in the same file.
The failure of those test cases will leave the query options
modified, causing cascading failures to other test cases
which aren't expected to be run with the modified query
options (e.g. lowered memory limit). This problem may lead
to broken builds which are recorded in IMPALA-2724 and
IMPALA-2824.

This change fixes the problem above by checking if a test
case modifies any query option and if so, restore those
modified query options to their default values. This change
makes the assumption that a test should not modify an option
specified in its test vector so it's safe to restore the
modified query options to their default values.

Change-Id: Ib88d1dcb6a65183e1afc8eef0c764179a9f6a8ce
Reviewed-on: http://gerrit.cloudera.org:8080/1774
Reviewed-by: Michael Ho <kwho@cloudera.com>
Tested-by: Internal Jenkins
This commit is contained in:
Michael Ho
2016-01-12 14:37:00 -08:00
committed by Internal Jenkins
parent b948973d19
commit 968c61c940
13 changed files with 65 additions and 71 deletions

View File

@@ -1591,6 +1591,4 @@ FROM functional_parquet.alltypes t1 CROSS JOIN functional_parquet.alltypes t2 LI
---- CATCH
Memory limit exceeded
====
---- QUERY
set mem_limit=0
====

View File

@@ -360,13 +360,6 @@ from alltypesagg
bigint, bigint, bigint
====
---- QUERY
# Unset the query option from the previous test.
set appx_count_distinct=false
---- RESULTS
---- TYPES
string, string
====
---- QUERY
# Large (more than 1 regular batches) distinct with multiple group by keys.
SELECT COUNT(*) FROM
(SELECT COUNT(DISTINCT p_partkey)

View File

@@ -112,6 +112,3 @@ select l_comment from tpch_parquet.lineitem) a
---- CATCH
Memory limit exceeded
====
---- QUERY
set mem_limit=0
====

View File

@@ -536,13 +536,6 @@ where c_custkey = 67974;
bigint,bigint
====
---- QUERY
# Set the num_nodes query option back to its default value.
set num_nodes=0
---- RESULTS
---- TYPES
string,string
====
---- QUERY
# IMPALA-2289: Test nested-loop join with right anti join mode inside a subplan.
select count(*) from customer c left anti join c.c_orders
where c_custkey between 8000 and 10000

View File

@@ -162,9 +162,7 @@ BIGINT,BIGINT
---- QUERY
# IMPALA-2376
# Set memory limit low enough to get the below query to consistently fail.
set mem_limit=4m
====
---- QUERY
set mem_limit=4m;
select max(cnt) from customer c,
(select count(l_returnflag) cnt from c.c_orders.o_lineitems) v;
---- TYPES
@@ -174,14 +172,10 @@ Memory limit exceeded
Failed to allocate buffer for collection 'tpch_nested_parquet.customer.c_orders.item.o_lineitems'.
====
---- QUERY
set num_scanner_threads=1
====
---- QUERY
set mem_limit=1g
====
---- QUERY
# IMPALA-2473: Scan query with large row size leading to oversized batches.
# Should not OOM given single scanner thread and sufficient memory limit.
set num_scanner_threads=1;
set mem_limit=1g;
select *
from tpch_nested_parquet.customer c, c.c_orders o, o.o_lineitems
order by l_partkey desc, l_suppkey desc, l_linenumber desc, c_custkey
@@ -196,14 +190,10 @@ limit 5
bigint,string,string,smallint,string,decimal,string,string,bigint,string,decimal,string,string,string,int,string,bigint,bigint,int,decimal,decimal,decimal,decimal,string,string,string,string,string,string,string,string
====
---- QUERY
set num_scanner_threads=1
====
---- QUERY
set mem_limit=500m
====
---- QUERY
# IMPALA-2473: Highly selective scan query with large row size.
# Should not OOM given single scanner thread and sufficient memory limit.
set num_scanner_threads=1;
set mem_limit=500m;
select *
from tpch_nested_parquet.customer c, c.c_orders o, o.o_lineitems
where c_phone='20-968-632-1388' and l_partkey = 127499
@@ -212,9 +202,3 @@ where c_phone='20-968-632-1388' and l_partkey = 127499
---- TYPES
bigint,string,string,smallint,string,decimal,string,string,bigint,string,decimal,string,string,string,int,string,bigint,bigint,int,decimal,decimal,decimal,decimal,string,string,string,string,string,string,string,string
====
---- QUERY
set mem_limit=0
====
---- QUERY
set num_scanner_threads=0
====

View File

@@ -31,10 +31,8 @@ set
STRING, STRING
====
---- QUERY
set explain_level=3
====
---- QUERY
set
set explain_level=3;
set;
---- RESULTS: VERIFY_IS_SUBSET
'ABORT_ON_DEFAULT_LIMIT_EXCEEDED','0'
'ABORT_ON_ERROR','0'
@@ -65,10 +63,8 @@ set
STRING, STRING
====
---- QUERY
set explain_level='0'
====
---- QUERY
set
set explain_level='0';
set;
---- RESULTS: VERIFY_IS_SUBSET
'ABORT_ON_DEFAULT_LIMIT_EXCEEDED','0'
'ABORT_ON_ERROR','0'
@@ -100,10 +96,8 @@ STRING, STRING
====
---- QUERY
# IMPALA-1906: Test that SET changes PARQUET_FILE_SIZE only if it's less than 2GB.
set parquet_file_size='1.5g'
====
---- QUERY
set
set parquet_file_size='1.5g';
set;
---- RESULTS: VERIFY_IS_SUBSET
'ABORT_ON_DEFAULT_LIMIT_EXCEEDED','0'
'ABORT_ON_ERROR','0'
@@ -114,7 +108,7 @@ set
'DISABLE_CACHED_READS','0'
'DISABLE_CODEGEN','0'
'DISABLE_OUTERMOST_TOPN','0'
'EXPLAIN_LEVEL','0'
'EXPLAIN_LEVEL','1'
'HBASE_CACHE_BLOCKS','0'
'HBASE_CACHING','0'
'MAX_ERRORS','0'
@@ -157,18 +151,14 @@ select 1
====
---- QUERY
# Set mem_limit really small so that queries will fail.
set mem_limit=1
====
---- QUERY
set mem_limit=1;
select count(string_col) from functional.alltypestiny
---- CATCH
Memory limit exceeded
====
---- QUERY
# Set mem_limit back to unlimited and query should succeed again.
set mem_limit=0
====
---- QUERY
set mem_limit=0;
select count(string_col) from functional.alltypestiny
---- RESULTS
8

View File

@@ -1,9 +1,7 @@
====
---- QUERY
set mem_limit=200m
====
---- QUERY
# IMPALA-2207: Analytic eval node feeding into build side of nested loop join.
set mem_limit=200m;
select straight_join * from (values(1 id), (2), (3)) v1,
(select *, count(*) over() from tpch.lineitem where l_orderkey < 100000) v2
order by id, l_orderkey, l_partkey, l_suppkey, l_linenumber

View File

@@ -350,7 +350,3 @@ from lineitem
---- TYPES
BIGINT
====
---- QUERY
set mem_limit=0;
set num_nodes=0;
====