Repository: hive Updated Branches: refs/heads/branch-3 ac5de3d45 -> ab1be561c
HIVE-19096: query result cache interferes with explain analyze (Jason Dere, reviewed by Zoltan Haindrich) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/ab1be561 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/ab1be561 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/ab1be561 Branch: refs/heads/branch-3 Commit: ab1be561cda65b8272dc70d6d4823f4a8626e31a Parents: ac5de3d Author: Jason Dere <jd...@hortonworks.com> Authored: Mon Jun 4 16:04:09 2018 -0700 Committer: Jason Dere <jd...@hortonworks.com> Committed: Mon Jun 4 16:05:12 2018 -0700 ---------------------------------------------------------------------- .../hadoop/hive/ql/parse/SemanticAnalyzer.java | 5 ++ .../queries/clientpositive/results_cache_2.q | 8 ++ .../clientpositive/llap/results_cache_2.q.out | 84 ++++++++++++++++++++ 3 files changed, 97 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/ab1be561/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java ---------------------------------------------------------------------- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java b/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java index 506dc39..f3eff0f 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java @@ -14683,6 +14683,11 @@ public class SemanticAnalyzer extends BaseSemanticAnalyzer { return false; } + // HIVE-19096 - disable for explain analyze + if (ctx.getExplainAnalyze() != null) { + return false; + } + return true; } http://git-wip-us.apache.org/repos/asf/hive/blob/ab1be561/ql/src/test/queries/clientpositive/results_cache_2.q ---------------------------------------------------------------------- diff --git a/ql/src/test/queries/clientpositive/results_cache_2.q b/ql/src/test/queries/clientpositive/results_cache_2.q index 034ec18..b5b0958 100644 --- a/ql/src/test/queries/clientpositive/results_cache_2.q +++ b/ql/src/test/queries/clientpositive/results_cache_2.q @@ -40,3 +40,11 @@ explain select c1, count(*) from (select current_timestamp c1, value from src where key < 10) q group by c1; + +-- Test 4: cache disabled for explain analyze +set test.comment=EXPLAIN ANALYZE should not use the cache. This query just previously used the cache in Test 2; +set test.comment; +explain analyze +select c1, count(*) +from (select sign(value) c1, value from src where key < 10) q +group by c1; http://git-wip-us.apache.org/repos/asf/hive/blob/ab1be561/ql/src/test/results/clientpositive/llap/results_cache_2.q.out ---------------------------------------------------------------------- diff --git a/ql/src/test/results/clientpositive/llap/results_cache_2.q.out b/ql/src/test/results/clientpositive/llap/results_cache_2.q.out index a1b2485..25b8dc3 100644 --- a/ql/src/test/results/clientpositive/llap/results_cache_2.q.out +++ b/ql/src/test/results/clientpositive/llap/results_cache_2.q.out @@ -178,3 +178,87 @@ STAGE PLANS: Processor Tree: ListSink +test.comment=EXPLAIN ANALYZE should not use the cache. This query just previously used the cache in Test 2 +PREHOOK: query: select c1, count(*) +from (select sign(value) c1, value from src where key < 10) q +group by c1 +PREHOOK: type: QUERY +PREHOOK: Input: default@src +#### A masked pattern was here #### +POSTHOOK: query: select c1, count(*) +from (select sign(value) c1, value from src where key < 10) q +group by c1 +POSTHOOK: type: QUERY +POSTHOOK: Input: default@src +#### A masked pattern was here #### +PREHOOK: query: explain analyze +select c1, count(*) +from (select sign(value) c1, value from src where key < 10) q +group by c1 +PREHOOK: type: QUERY +POSTHOOK: query: explain analyze +select c1, count(*) +from (select sign(value) c1, value from src where key < 10) q +group by c1 +POSTHOOK: type: QUERY +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: src + Statistics: Num rows: 500/500 Data size: 89000 Basic stats: COMPLETE Column stats: COMPLETE + Filter Operator + predicate: (UDFToDouble(key) < 10.0D) (type: boolean) + Statistics: Num rows: 166/10 Data size: 29548 Basic stats: COMPLETE Column stats: COMPLETE + Select Operator + expressions: sign(value) (type: double) + outputColumnNames: _col0 + Statistics: Num rows: 166/10 Data size: 29548 Basic stats: COMPLETE Column stats: COMPLETE + Group By Operator + aggregations: count() + keys: _col0 (type: double) + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 83/1 Data size: 1328 Basic stats: COMPLETE Column stats: COMPLETE + Reduce Output Operator + key expressions: _col0 (type: double) + sort order: + + Map-reduce partition columns: _col0 (type: double) + Statistics: Num rows: 83/1 Data size: 1328 Basic stats: COMPLETE Column stats: COMPLETE + value expressions: _col1 (type: bigint) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: count(VALUE._col0) + keys: KEY._col0 (type: double) + mode: mergepartial + outputColumnNames: _col0, _col1 + Statistics: Num rows: 83/1 Data size: 1328 Basic stats: COMPLETE Column stats: COMPLETE + File Output Operator + compressed: false + Statistics: Num rows: 83/1 Data size: 1328 Basic stats: COMPLETE Column stats: COMPLETE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink +