HIVE-20431 : txn stats write ID check triggers on set location (Sergey 
Shelukhin, reviewed by Eugene Koifman)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/ec965fa3
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/ec965fa3
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/ec965fa3

Branch: refs/heads/master
Commit: ec965fa32dbd7146dba4aec1e12cad30240e8e1b
Parents: 5c3ed06
Author: sergey <ser...@apache.org>
Authored: Thu Aug 23 12:12:26 2018 -0700
Committer: sergey <ser...@apache.org>
Committed: Thu Aug 23 12:12:26 2018 -0700

----------------------------------------------------------------------
 .../hive/ql/parse/DDLSemanticAnalyzer.java      |   9 +-
 .../hadoop/hive/ql/plan/AlterTableDesc.java     |  20 +-
 .../test/queries/clientpositive/acid_stats4.q   |  34 +-
 .../results/clientpositive/acid_stats4.q.out    | 381 ++++++++++++++++++-
 4 files changed, 431 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/ec965fa3/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java
----------------------------------------------------------------------
diff --git 
a/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java 
b/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java
index 2b9f763..273fccb 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java
@@ -1992,7 +1992,10 @@ public class DDLSemanticAnalyzer extends 
BaseSemanticAnalyzer {
     }
     addLocationToOutputs(newLocation);
     AlterTableDesc alterTblDesc = new AlterTableDesc(tableName, newLocation, 
partSpec);
-
+    Table tbl = getTable(tableName);
+    if (AcidUtils.isTransactionalTable(tbl)) {
+      setAcidDdlDesc(alterTblDesc);
+    }
     addInputsOutputsAlterTable(tableName, partSpec, alterTblDesc);
     rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(),
         alterTblDesc)));
@@ -2277,6 +2280,10 @@ public class DDLSemanticAnalyzer extends 
BaseSemanticAnalyzer {
     alterTblDesc.setOldName(tableName);
     alterTblDesc.setIsCascade(isCascade);
     alterTblDesc.setPartSpec(partSpec);
+    Table tbl = getTable(tableName);
+    if (AcidUtils.isTransactionalTable(tbl)) {
+      setAcidDdlDesc(alterTblDesc);
+    }
 
     rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(),
             alterTblDesc), conf));

http://git-wip-us.apache.org/repos/asf/hive/blob/ec965fa3/ql/src/java/org/apache/hadoop/hive/ql/plan/AlterTableDesc.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/plan/AlterTableDesc.java 
b/ql/src/java/org/apache/hadoop/hive/ql/plan/AlterTableDesc.java
index 680e029..423ca2a 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/plan/AlterTableDesc.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/plan/AlterTableDesc.java
@@ -62,11 +62,15 @@ public class AlterTableDesc extends DDLDesc implements 
Serializable, DDLDesc.DDL
     ADDFILEFORMAT("add fileformat"), ADDCLUSTERSORTCOLUMN("add cluster sort 
column"),
     RENAMECOLUMN("rename column"), ADDPARTITION("add partition"), 
TOUCH("touch"), ARCHIVE("archieve"),
     UNARCHIVE("unarchieve"), ALTERLOCATION("alter location"),
-    DROPPARTITION("drop partition"), RENAMEPARTITION("rename partition"), 
ADDSKEWEDBY("add skew column"),
+    DROPPARTITION("drop partition"),
+    RENAMEPARTITION("rename partition"), // Note: used in RenamePartitionDesc, 
not here.
+    ADDSKEWEDBY("add skew column"),
     ALTERSKEWEDLOCATION("alter skew location"), ALTERBUCKETNUM("alter bucket 
number"),
-    ALTERPARTITION("alter partition"), COMPACT("compact"),
+    ALTERPARTITION("alter partition"), // Note: this is never used in 
AlterTableDesc.
+    COMPACT("compact"),
     TRUNCATE("truncate"), MERGEFILES("merge files"), DROPCONSTRAINT("drop 
constraint"), ADDCONSTRAINT("add constraint"),
-    UPDATECOLUMNS("update columns"), OWNER("set owner"), UPDATESTATS("update 
stats");
+    UPDATECOLUMNS("update columns"), OWNER("set owner"),
+    UPDATESTATS("update stats"); // Note: used in ColumnStatsUpdateWork, not 
here.
     ;
 
     private final String name;
@@ -969,10 +973,12 @@ public class AlterTableDesc extends DDLDesc implements 
Serializable, DDLDesc.DDL
     case DROPPROPS: return isExplicitStatsUpdate;
     // The check for the following ones is performed before setting 
AlterTableDesc into the acid field.
     // These need write ID and stuff because they invalidate column stats.
-    case RENAMECOLUMN: return true;
-    case RENAME: return true;
-    case REPLACECOLS: return true;
-    case ADDCOLS: return true;
+    case RENAMECOLUMN:
+    case RENAME:
+    case REPLACECOLS:
+    case ADDCOLS:
+    case ALTERLOCATION:
+    case UPDATECOLUMNS: return true;
     // RENAMEPARTITION is handled in RenamePartitionDesc
     default: return false;
     }

http://git-wip-us.apache.org/repos/asf/hive/blob/ec965fa3/ql/src/test/queries/clientpositive/acid_stats4.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/acid_stats4.q 
b/ql/src/test/queries/clientpositive/acid_stats4.q
index 20d1159..9dca3c3 100644
--- a/ql/src/test/queries/clientpositive/acid_stats4.q
+++ b/ql/src/test/queries/clientpositive/acid_stats4.q
@@ -25,17 +25,36 @@ explain select count(key) from stats_nonpart;
 ALTER TABLE stats_nonpart CHANGE COLUMN key key2 int;
 explain select count(key2) from stats_nonpart;
 explain select count(value) from stats_nonpart;
-
 analyze table stats_nonpart compute statistics for columns;
 explain select count(key2) from stats_nonpart;
 
 alter table stats_nonpart rename to stats_nonpart2;
 explain select count(key2) from stats_nonpart2;
-
 analyze table stats_nonpart2 compute statistics for columns;
 explain select count(key2) from stats_nonpart2;
 
-drop table stats_nonpart;
+alter table stats_nonpart2 set serde 
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe';
+alter table stats_nonpart2 set serdeproperties ("foo"="bar");
+alter table stats_nonpart2 set fileformat rcfile;
+explain select count(key2) from stats_nonpart2;
+
+alter table stats_nonpart2 set location 
'file:${system:test.tmp.dir}/stats_nonpart_zzz';
+explain select count(key2) from stats_nonpart2;
+
+insert overwrite table stats_nonpart2 values (1, "foo");
+explain select count(key2) from stats_nonpart2;
+
+alter table stats_nonpart2 add constraint primary_key primary key (key2) 
disable novalidate rely;
+alter table stats_nonpart2 drop constraint primary_key;
+explain select count(key2) from stats_nonpart2;
+
+alter table stats_nonpart2 clustered by (key2) INTO 2 BUCKETS;
+explain select count(key2) from stats_nonpart2;
+insert into table stats_nonpart2 values (2, "foo");
+explain select count(key2) from stats_nonpart2;
+
+
+drop table stats_nonpart2;
 
 
 create table stats_part(key int,value string) partitioned by (p int) 
tblproperties ("transactional"="true", 
"transactional_properties"="insert_only");
@@ -63,6 +82,15 @@ explain select count(value) from stats_part;
 analyze table stats_part partition(p) compute statistics for columns;
 explain select count(key2) from stats_part;
 
+alter table stats_part add partition(p=105);
+explain select count(key2) from stats_part;
+analyze table stats_part partition(p) compute statistics for columns;
+explain select count(key2) from stats_part;
+
+alter table stats_part drop partition(p=104);
+explain select count(key2) from stats_part;
+
+
 
 drop table stats_part;
 

http://git-wip-us.apache.org/repos/asf/hive/blob/ec965fa3/ql/src/test/results/clientpositive/acid_stats4.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/acid_stats4.q.out 
b/ql/src/test/results/clientpositive/acid_stats4.q.out
index afd5adb..c22bf96 100644
--- a/ql/src/test/results/clientpositive/acid_stats4.q.out
+++ b/ql/src/test/results/clientpositive/acid_stats4.q.out
@@ -172,10 +172,202 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-PREHOOK: query: drop table stats_nonpart
+PREHOOK: query: alter table stats_nonpart2 set serde 
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
+PREHOOK: type: ALTERTABLE_SERIALIZER
+PREHOOK: Input: default@stats_nonpart2
+PREHOOK: Output: default@stats_nonpart2
+POSTHOOK: query: alter table stats_nonpart2 set serde 
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
+POSTHOOK: type: ALTERTABLE_SERIALIZER
+POSTHOOK: Input: default@stats_nonpart2
+POSTHOOK: Output: default@stats_nonpart2
+PREHOOK: query: alter table stats_nonpart2 set serdeproperties ("foo"="bar")
+PREHOOK: type: ALTERTABLE_SERDEPROPERTIES
+PREHOOK: Input: default@stats_nonpart2
+PREHOOK: Output: default@stats_nonpart2
+POSTHOOK: query: alter table stats_nonpart2 set serdeproperties ("foo"="bar")
+POSTHOOK: type: ALTERTABLE_SERDEPROPERTIES
+POSTHOOK: Input: default@stats_nonpart2
+POSTHOOK: Output: default@stats_nonpart2
+PREHOOK: query: alter table stats_nonpart2 set fileformat rcfile
+PREHOOK: type: ALTERTABLE_FILEFORMAT
+PREHOOK: Input: default@stats_nonpart2
+PREHOOK: Output: default@stats_nonpart2
+POSTHOOK: query: alter table stats_nonpart2 set fileformat rcfile
+POSTHOOK: type: ALTERTABLE_FILEFORMAT
+POSTHOOK: Input: default@stats_nonpart2
+POSTHOOK: Output: default@stats_nonpart2
+PREHOOK: query: explain select count(key2) from stats_nonpart2
+PREHOOK: type: QUERY
+POSTHOOK: query: explain select count(key2) from stats_nonpart2
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-0 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-0
+    Fetch Operator
+      limit: 1
+      Processor Tree:
+        ListSink
+
+#### A masked pattern was here ####
+PREHOOK: type: ALTERTABLE_LOCATION
+PREHOOK: Input: default@stats_nonpart2
+PREHOOK: Output: default@stats_nonpart2
+#### A masked pattern was here ####
+POSTHOOK: type: ALTERTABLE_LOCATION
+POSTHOOK: Input: default@stats_nonpart2
+POSTHOOK: Output: default@stats_nonpart2
+#### A masked pattern was here ####
+PREHOOK: query: explain select count(key2) from stats_nonpart2
+PREHOOK: type: QUERY
+POSTHOOK: query: explain select count(key2) from stats_nonpart2
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            alias: stats_nonpart2
+            Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column 
stats: NONE
+            Select Operator
+              expressions: key2 (type: int)
+              outputColumnNames: key2
+              Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE 
Column stats: NONE
+              Group By Operator
+                aggregations: count(key2)
+                mode: hash
+                outputColumnNames: _col0
+                Statistics: Num rows: 1 Data size: 12 Basic stats: COMPLETE 
Column stats: NONE
+                Reduce Output Operator
+                  sort order: 
+                  Statistics: Num rows: 1 Data size: 12 Basic stats: COMPLETE 
Column stats: NONE
+                  value expressions: _col0 (type: bigint)
+      Execution mode: vectorized
+      Reduce Operator Tree:
+        Group By Operator
+          aggregations: count(VALUE._col0)
+          mode: mergepartial
+          outputColumnNames: _col0
+          Statistics: Num rows: 1 Data size: 12 Basic stats: COMPLETE Column 
stats: NONE
+          File Output Operator
+            compressed: false
+            Statistics: Num rows: 1 Data size: 12 Basic stats: COMPLETE Column 
stats: NONE
+            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
+
+PREHOOK: query: insert overwrite table stats_nonpart2 values (1, "foo")
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+PREHOOK: Output: default@stats_nonpart2
+POSTHOOK: query: insert overwrite table stats_nonpart2 values (1, "foo")
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+POSTHOOK: Output: default@stats_nonpart2
+POSTHOOK: Lineage: stats_nonpart2.key2 SCRIPT []
+POSTHOOK: Lineage: stats_nonpart2.value SCRIPT []
+PREHOOK: query: explain select count(key2) from stats_nonpart2
+PREHOOK: type: QUERY
+POSTHOOK: query: explain select count(key2) from stats_nonpart2
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-0 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-0
+    Fetch Operator
+      limit: 1
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: alter table stats_nonpart2 add constraint primary_key primary 
key (key2) disable novalidate rely
+PREHOOK: type: ALTERTABLE_ADDCONSTRAINT
+POSTHOOK: query: alter table stats_nonpart2 add constraint primary_key primary 
key (key2) disable novalidate rely
+POSTHOOK: type: ALTERTABLE_ADDCONSTRAINT
+PREHOOK: query: alter table stats_nonpart2 drop constraint primary_key
+PREHOOK: type: ALTERTABLE_DROPCONSTRAINT
+POSTHOOK: query: alter table stats_nonpart2 drop constraint primary_key
+POSTHOOK: type: ALTERTABLE_DROPCONSTRAINT
+PREHOOK: query: explain select count(key2) from stats_nonpart2
+PREHOOK: type: QUERY
+POSTHOOK: query: explain select count(key2) from stats_nonpart2
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-0 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-0
+    Fetch Operator
+      limit: 1
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: alter table stats_nonpart2 clustered by (key2) INTO 2 BUCKETS
+PREHOOK: type: ALTERTABLE_CLUSTER_SORT
+PREHOOK: Input: default@stats_nonpart2
+PREHOOK: Output: default@stats_nonpart2
+POSTHOOK: query: alter table stats_nonpart2 clustered by (key2) INTO 2 BUCKETS
+POSTHOOK: type: ALTERTABLE_CLUSTER_SORT
+POSTHOOK: Input: default@stats_nonpart2
+POSTHOOK: Output: default@stats_nonpart2
+PREHOOK: query: explain select count(key2) from stats_nonpart2
+PREHOOK: type: QUERY
+POSTHOOK: query: explain select count(key2) from stats_nonpart2
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-0 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-0
+    Fetch Operator
+      limit: 1
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: insert into table stats_nonpart2 values (2, "foo")
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+PREHOOK: Output: default@stats_nonpart2
+POSTHOOK: query: insert into table stats_nonpart2 values (2, "foo")
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+POSTHOOK: Output: default@stats_nonpart2
+POSTHOOK: Lineage: stats_nonpart2.key2 SCRIPT []
+POSTHOOK: Lineage: stats_nonpart2.value SCRIPT []
+PREHOOK: query: explain select count(key2) from stats_nonpart2
+PREHOOK: type: QUERY
+POSTHOOK: query: explain select count(key2) from stats_nonpart2
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-0 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-0
+    Fetch Operator
+      limit: 1
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: drop table stats_nonpart2
 PREHOOK: type: DROPTABLE
-POSTHOOK: query: drop table stats_nonpart
+PREHOOK: Input: default@stats_nonpart2
+PREHOOK: Output: default@stats_nonpart2
+POSTHOOK: query: drop table stats_nonpart2
 POSTHOOK: type: DROPTABLE
+POSTHOOK: Input: default@stats_nonpart2
+POSTHOOK: Output: default@stats_nonpart2
 PREHOOK: query: create table stats_part(key int,value string) partitioned by 
(p int) tblproperties ("transactional"="true", 
"transactional_properties"="insert_only")
 PREHOOK: type: CREATETABLE
 PREHOOK: Output: database:default
@@ -451,6 +643,191 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
+PREHOOK: query: alter table stats_part add partition(p=105)
+PREHOOK: type: ALTERTABLE_ADDPARTS
+PREHOOK: Output: default@stats_part
+POSTHOOK: query: alter table stats_part add partition(p=105)
+POSTHOOK: type: ALTERTABLE_ADDPARTS
+POSTHOOK: Output: default@stats_part
+POSTHOOK: Output: default@stats_part@p=105
+PREHOOK: query: explain select count(key2) from stats_part
+PREHOOK: type: QUERY
+POSTHOOK: query: explain select count(key2) from stats_part
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            alias: stats_part
+            Statistics: Num rows: 3 Data size: 12 Basic stats: PARTIAL Column 
stats: PARTIAL
+            Select Operator
+              expressions: key2 (type: int)
+              outputColumnNames: key2
+              Statistics: Num rows: 3 Data size: 12 Basic stats: PARTIAL 
Column stats: PARTIAL
+              Group By Operator
+                aggregations: count(key2)
+                mode: hash
+                outputColumnNames: _col0
+                Statistics: Num rows: 1 Data size: 12 Basic stats: PARTIAL 
Column stats: PARTIAL
+                Reduce Output Operator
+                  sort order: 
+                  Statistics: Num rows: 1 Data size: 12 Basic stats: PARTIAL 
Column stats: PARTIAL
+                  value expressions: _col0 (type: bigint)
+      Reduce Operator Tree:
+        Group By Operator
+          aggregations: count(VALUE._col0)
+          mode: mergepartial
+          outputColumnNames: _col0
+          Statistics: Num rows: 1 Data size: 12 Basic stats: PARTIAL Column 
stats: PARTIAL
+          File Output Operator
+            compressed: false
+            Statistics: Num rows: 1 Data size: 12 Basic stats: PARTIAL Column 
stats: PARTIAL
+            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
+
+PREHOOK: query: analyze table stats_part partition(p) compute statistics for 
columns
+PREHOOK: type: ANALYZE_TABLE
+PREHOOK: Input: default@stats_part
+PREHOOK: Input: default@stats_part@p=101
+PREHOOK: Input: default@stats_part@p=103
+PREHOOK: Input: default@stats_part@p=104
+PREHOOK: Input: default@stats_part@p=105
+PREHOOK: Output: default@stats_part
+PREHOOK: Output: default@stats_part@p=101
+PREHOOK: Output: default@stats_part@p=103
+PREHOOK: Output: default@stats_part@p=104
+PREHOOK: Output: default@stats_part@p=105
+#### A masked pattern was here ####
+POSTHOOK: query: analyze table stats_part partition(p) compute statistics for 
columns
+POSTHOOK: type: ANALYZE_TABLE
+POSTHOOK: Input: default@stats_part
+POSTHOOK: Input: default@stats_part@p=101
+POSTHOOK: Input: default@stats_part@p=103
+POSTHOOK: Input: default@stats_part@p=104
+POSTHOOK: Input: default@stats_part@p=105
+POSTHOOK: Output: default@stats_part
+POSTHOOK: Output: default@stats_part@p=101
+POSTHOOK: Output: default@stats_part@p=103
+POSTHOOK: Output: default@stats_part@p=104
+POSTHOOK: Output: default@stats_part@p=105
+#### A masked pattern was here ####
+PREHOOK: query: explain select count(key2) from stats_part
+PREHOOK: type: QUERY
+POSTHOOK: query: explain select count(key2) from stats_part
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            alias: stats_part
+            Statistics: Num rows: 3 Data size: 12 Basic stats: PARTIAL Column 
stats: PARTIAL
+            Select Operator
+              expressions: key2 (type: int)
+              outputColumnNames: key2
+              Statistics: Num rows: 3 Data size: 12 Basic stats: PARTIAL 
Column stats: PARTIAL
+              Group By Operator
+                aggregations: count(key2)
+                mode: hash
+                outputColumnNames: _col0
+                Statistics: Num rows: 1 Data size: 12 Basic stats: PARTIAL 
Column stats: PARTIAL
+                Reduce Output Operator
+                  sort order: 
+                  Statistics: Num rows: 1 Data size: 12 Basic stats: PARTIAL 
Column stats: PARTIAL
+                  value expressions: _col0 (type: bigint)
+      Reduce Operator Tree:
+        Group By Operator
+          aggregations: count(VALUE._col0)
+          mode: mergepartial
+          outputColumnNames: _col0
+          Statistics: Num rows: 1 Data size: 12 Basic stats: PARTIAL Column 
stats: PARTIAL
+          File Output Operator
+            compressed: false
+            Statistics: Num rows: 1 Data size: 12 Basic stats: PARTIAL Column 
stats: PARTIAL
+            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
+
+PREHOOK: query: alter table stats_part drop partition(p=104)
+PREHOOK: type: ALTERTABLE_DROPPARTS
+PREHOOK: Input: default@stats_part
+PREHOOK: Output: default@stats_part@p=104
+POSTHOOK: query: alter table stats_part drop partition(p=104)
+POSTHOOK: type: ALTERTABLE_DROPPARTS
+POSTHOOK: Input: default@stats_part
+POSTHOOK: Output: default@stats_part@p=104
+PREHOOK: query: explain select count(key2) from stats_part
+PREHOOK: type: QUERY
+POSTHOOK: query: explain select count(key2) from stats_part
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            alias: stats_part
+            Statistics: Num rows: 2 Data size: 8 Basic stats: PARTIAL Column 
stats: COMPLETE
+            Select Operator
+              expressions: key2 (type: int)
+              outputColumnNames: key2
+              Statistics: Num rows: 2 Data size: 8 Basic stats: PARTIAL Column 
stats: COMPLETE
+              Group By Operator
+                aggregations: count(key2)
+                mode: hash
+                outputColumnNames: _col0
+                Statistics: Num rows: 1 Data size: 12 Basic stats: PARTIAL 
Column stats: COMPLETE
+                Reduce Output Operator
+                  sort order: 
+                  Statistics: Num rows: 1 Data size: 12 Basic stats: PARTIAL 
Column stats: COMPLETE
+                  value expressions: _col0 (type: bigint)
+      Reduce Operator Tree:
+        Group By Operator
+          aggregations: count(VALUE._col0)
+          mode: mergepartial
+          outputColumnNames: _col0
+          Statistics: Num rows: 1 Data size: 12 Basic stats: PARTIAL Column 
stats: COMPLETE
+          File Output Operator
+            compressed: false
+            Statistics: Num rows: 1 Data size: 12 Basic stats: PARTIAL 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
+
 PREHOOK: query: drop table stats_part
 PREHOOK: type: DROPTABLE
 PREHOOK: Input: default@stats_part

Reply via email to