IMPALA-3334: Fix some bugs in query options' parsing.

This change fixes two problems:

1. The query options OPTIMIZE_PARTITION_KEY_SCANS and
   DISABLE_STREAMING_PREAGGREGATIONS are both boolean
   so they should accept 'true' and '1' as input values.
   Previously, these two options are treated as int and
   value such as 'true' doesn't work with them.

2. The break statement in the case statement of the option
   SCAN_NODE_CODEGEN_THRESHOLD was 'stolen' by the option
   DISABLE_STREAMING_PREAGGREGATIONS when it was added.
   This change adds the missing break statement back for
   SCAN_NODE_CODEGEN_THRESHOLD.

Change-Id: I5c74a1e5c49e3bda15a91b40740fc7310303207b
Reviewed-on: http://gerrit.cloudera.org:8080/2776
Reviewed-by: Tim Armstrong <tarmstrong@cloudera.com>
Reviewed-by: Dan Hecht <dhecht@cloudera.com>
Tested-by: Internal Jenkins
This commit is contained in:
Michael Ho
2016-04-13 00:22:48 -07:00
committed by Tim Armstrong
parent f8b5481830
commit cbcda93dfb
2 changed files with 96 additions and 2 deletions

View File

@@ -165,3 +165,94 @@ select count(string_col) from functional.alltypestiny
---- TYPES
BIGINT
====
---- QUERY
# IMPALA-3334: 'optimize_partition_key_scans' is a boolean query option
set explain_level=0;
set optimize_partition_key_scans=true;
explain select min(month), max(year), ndv(day) from functional.alltypesagg;
---- RESULTS: VERIFY_IS_SUBSET
'01:AGGREGATE [FINALIZE]'
'00:UNION'
' constant-operands=11'
====
---- QUERY
set explain_level=0;
set optimize_partition_key_scans=1;
explain select min(month), max(year), ndv(day) from functional.alltypesagg;
---- RESULTS: VERIFY_IS_SUBSET
'01:AGGREGATE [FINALIZE]'
'00:UNION'
' constant-operands=11'
====
---- QUERY
set explain_level=0;
set optimize_partition_key_scans=false;
explain select min(month), max(year), ndv(day) from functional.alltypesagg;
---- RESULTS: VERIFY_IS_SUBSET
'03:AGGREGATE [FINALIZE]'
'02:EXCHANGE [UNPARTITIONED]'
'01:AGGREGATE'
'00:SCAN HDFS [functional.alltypesagg]'
====
---- QUERY
set explain_level=0;
set optimize_partition_key_scans=0;
explain select min(month), max(year), ndv(day) from functional.alltypesagg;
---- RESULTS: VERIFY_IS_SUBSET
'03:AGGREGATE [FINALIZE]'
'02:EXCHANGE [UNPARTITIONED]'
'01:AGGREGATE'
'00:SCAN HDFS [functional.alltypesagg]'
====
---- QUERY
set explain_level=0;
set disable_streaming_preaggregations=false;
explain select count(distinct double_col) from functional.alltypesagg;
---- RESULTS: VERIFY_IS_SUBSET
'06:AGGREGATE [FINALIZE]'
'05:EXCHANGE [UNPARTITIONED]'
'02:AGGREGATE'
'04:AGGREGATE'
'03:EXCHANGE [HASH(double_col)]'
'01:AGGREGATE [STREAMING]'
'00:SCAN HDFS [functional.alltypesagg]'
====
---- QUERY
set explain_level=0;
set disable_streaming_preaggregations=0;
explain select count(distinct double_col) from functional.alltypesagg;
---- RESULTS: VERIFY_IS_SUBSET
'06:AGGREGATE [FINALIZE]'
'05:EXCHANGE [UNPARTITIONED]'
'02:AGGREGATE'
'04:AGGREGATE'
'03:EXCHANGE [HASH(double_col)]'
'01:AGGREGATE [STREAMING]'
'00:SCAN HDFS [functional.alltypesagg]'
====
---- QUERY
set explain_level=0;
set disable_streaming_preaggregations=true;
explain select count(distinct double_col) from functional.alltypesagg;
---- RESULTS: VERIFY_IS_SUBSET
'06:AGGREGATE [FINALIZE]'
'05:EXCHANGE [UNPARTITIONED]'
'02:AGGREGATE'
'04:AGGREGATE'
'03:EXCHANGE [HASH(double_col)]'
'01:AGGREGATE'
'00:SCAN HDFS [functional.alltypesagg]'
====
---- QUERY
set explain_level=0;
set disable_streaming_preaggregations=1;
explain select count(distinct double_col) from functional.alltypesagg;
---- RESULTS: VERIFY_IS_SUBSET
'06:AGGREGATE [FINALIZE]'
'05:EXCHANGE [UNPARTITIONED]'
'02:AGGREGATE'
'04:AGGREGATE'
'03:EXCHANGE [HASH(double_col)]'
'01:AGGREGATE'
'00:SCAN HDFS [functional.alltypesagg]'
====