You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by jd...@apache.org on 2018/06/04 23:04:45 UTC
hive git commit: HIVE-19096: query result cache interferes with
explain analyze (Jason Dere, reviewed by Zoltan Haindrich)
Repository: hive
Updated Branches:
refs/heads/master 5667af34c -> bf70bd270
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/bf70bd27
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/bf70bd27
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/bf70bd27
Branch: refs/heads/master
Commit: bf70bd27047a186e4360226ac65782a735a7929d
Parents: 5667af3
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:04:09 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/bf70bd27/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/bf70bd27/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 d939b8e..bc8965a 100644
--- a/ql/src/test/queries/clientpositive/results_cache_2.q
+++ b/ql/src/test/queries/clientpositive/results_cache_2.q
@@ -41,3 +41,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/bf70bd27/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
+