HIVE-10273: Union with partition tables which have no data fails with NPE 
(Vikram Dixit K, reviewed by Gunther Hagleitner)


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

Branch: refs/heads/branch-1.0
Commit: 095f96b9227571243864f663cf1ac878ad6bf143
Parents: b4983d4
Author: vikram <[email protected]>
Authored: Mon May 18 14:46:22 2015 -0700
Committer: vikram <[email protected]>
Committed: Mon Jun 15 10:31:06 2015 -0700

----------------------------------------------------------------------
 .../test/resources/testconfiguration.properties |    1 +
 .../hive/ql/optimizer/physical/Vectorizer.java  |   11 +
 .../org/apache/hadoop/hive/ql/plan/MapWork.java |   12 +-
 ql/src/test/queries/clientpositive/tez_union.q  |   18 +
 .../results/clientpositive/auto_join32.q.out    |   29 +
 .../results/clientpositive/bucketmapjoin1.q.out |   94 ++
 .../results/clientpositive/groupby_sort_6.q.out |  Bin 19123 -> 21751 bytes
 .../test/results/clientpositive/input26.q.out   |   18 +
 .../test/results/clientpositive/join_view.q.out |   25 +
 .../results/clientpositive/metadataonly1.q.out  |  Bin 81181 -> 82091 bytes
 .../results/clientpositive/nullgroup5.q.out     |   23 +
 .../clientpositive/optimize_nullscan.q.out      |  Bin 89364 -> 91380 bytes
 .../clientpositive/partition_boolexpr.q.out     |   36 +
 .../results/clientpositive/ppd_union_view.q.out |   72 ++
 .../clientpositive/reduce_deduplicate.q.out     |  Bin 18583 -> 20598 bytes
 .../test/results/clientpositive/sample6.q.out   |  Bin 74710 -> 75664 bytes
 .../results/clientpositive/smb_mapjoin9.q.out   |   86 ++
 .../tez/dynamic_partition_pruning.q.out         |   38 +
 .../clientpositive/tez/metadataonly1.q.out      |  Bin 86971 -> 88001 bytes
 .../clientpositive/tez/optimize_nullscan.q.out  |  Bin 84800 -> 87097 bytes
 .../results/clientpositive/tez/tez_union.q.out  |   65 ++
 .../clientpositive/tez/tez_union_group_by.q.out |   76 ++
 .../results/clientpositive/tez/union_view.q.out | 1004 ++++++++++++++++++
 .../vectorized_dynamic_partition_pruning.q.out  |   38 +
 .../results/clientpositive/union_view.q.out     |  368 +++++++
 25 files changed, 2004 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/095f96b9/itests/src/test/resources/testconfiguration.properties
----------------------------------------------------------------------
diff --git a/itests/src/test/resources/testconfiguration.properties 
b/itests/src/test/resources/testconfiguration.properties
index 8f96826..3690e5c 100644
--- a/itests/src/test/resources/testconfiguration.properties
+++ b/itests/src/test/resources/testconfiguration.properties
@@ -279,6 +279,7 @@ minitez.query.files=bucket_map_join_tez1.q,\
   tez_schema_evolution.q,\
   tez_union.q,\
   tez_union2.q,\
+  tez_union_view.q,\
   tez_union_decimal.q,\
   tez_union_group_by.q,\
   tez_smb_main.q,\

http://git-wip-us.apache.org/repos/asf/hive/blob/095f96b9/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/Vectorizer.java
----------------------------------------------------------------------
diff --git 
a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/Vectorizer.java 
b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/Vectorizer.java
index c8e6ef5..3459a61 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/Vectorizer.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/Vectorizer.java
@@ -346,6 +346,17 @@ public class Vectorizer implements PhysicalPlanResolver {
       addMapWorkRules(opRules, vnp);
       Dispatcher disp = new DefaultRuleDispatcher(vnp, opRules, null);
       GraphWalker ogw = new DefaultGraphWalker(disp);
+      if ((mapWork.getAliasToWork() == null) || 
(mapWork.getAliasToWork().size() == 0)) {
+        return false;
+      } else {
+        for (Operator<?> op : mapWork.getAliasToWork().values()) {
+          if (op == null) {
+            LOG.warn("Map work has invalid aliases to work with. Fail 
validation!");
+            return false;
+          }
+        }
+      }
+
       // iterator the mapper operator tree
       ArrayList<Node> topNodes = new ArrayList<Node>();
       topNodes.addAll(mapWork.getAliasToWork().values());

http://git-wip-us.apache.org/repos/asf/hive/blob/095f96b9/ql/src/java/org/apache/hadoop/hive/ql/plan/MapWork.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/plan/MapWork.java 
b/ql/src/java/org/apache/hadoop/hive/ql/plan/MapWork.java
index a808fc9..11f3f29 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/plan/MapWork.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/plan/MapWork.java
@@ -350,16 +350,8 @@ public class MapWork extends BaseWork {
   public Set<Operator<?>> getAllRootOperators() {
     Set<Operator<?>> opSet = new LinkedHashSet<Operator<?>>();
 
-    Map<String, ArrayList<String>> pa = getPathToAliases();
-    if (pa != null) {
-      for (List<String> ls : pa.values()) {
-        for (String a : ls) {
-          Operator<?> op = getAliasToWork().get(a);
-          if (op != null ) {
-            opSet.add(op);
-          }
-        }
-      }
+    for (Operator<?> op : getAliasToWork().values()) {
+      opSet.add(op);
     }
     return opSet;
   }

http://git-wip-us.apache.org/repos/asf/hive/blob/095f96b9/ql/src/test/queries/clientpositive/tez_union.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/tez_union.q 
b/ql/src/test/queries/clientpositive/tez_union.q
index f51559f..96f58b2 100644
--- a/ql/src/test/queries/clientpositive/tez_union.q
+++ b/ql/src/test/queries/clientpositive/tez_union.q
@@ -92,3 +92,21 @@ right outer join src s on u.key = s.key;
 
 select * from ut order by ukey, skey limit 20;
 drop table ut;
+
+set hive.vectorized.execution.enabled=true;
+
+create table TABLE1(EMP_NAME STRING, EMP_ID INT) ROW FORMAT DELIMITED FIELDS 
TERMINATED BY ',';
+
+create table table2 (EMP_NAME STRING) PARTITIONED BY (EMP_ID INT) ROW FORMAT 
DELIMITED FIELDS TERMINATED BY ',';
+
+CREATE OR REPLACE VIEW TABLE3 as select EMP_NAME, EMP_ID from TABLE1;
+
+explain formatted select count(*) from TABLE3;
+
+drop table table2;
+
+create table table2 (EMP_NAME STRING) PARTITIONED BY (EMP_ID INT) ROW FORMAT 
DELIMITED FIELDS TERMINATED BY ',';
+
+CREATE OR REPLACE VIEW TABLE3 as select EMP_NAME, EMP_ID from TABLE1 UNION ALL 
select EMP_NAME,EMP_ID from TABLE2;
+
+explain formatted select count(*) from TABLE3;

http://git-wip-us.apache.org/repos/asf/hive/blob/095f96b9/ql/src/test/results/clientpositive/auto_join32.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/auto_join32.q.out 
b/ql/src/test/results/clientpositive/auto_join32.q.out
index bc2d56c..022acc4 100644
--- a/ql/src/test/results/clientpositive/auto_join32.q.out
+++ b/ql/src/test/results/clientpositive/auto_join32.q.out
@@ -423,6 +423,35 @@ STAGE DEPENDENCIES:
 STAGE PLANS:
   Stage: Stage-1
     Map Reduce
+      Map Operator Tree:
+          TableScan
+            alias: s
+            Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+            Filter Operator
+              predicate: (name is not null and (p = 'bar')) (type: boolean)
+              Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+              Sorted Merge Bucket Map Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                condition expressions:
+                  0 {name}
+                  1 {registration}
+                keys:
+                  0 name (type: string)
+                  1 name (type: string)
+                outputColumnNames: _col0, _col9
+                Select Operator
+                  expressions: _col0 (type: string), _col9 (type: string)
+                  outputColumnNames: _col0, _col9
+                  Group By Operator
+                    aggregations: count(DISTINCT _col9)
+                    keys: _col0 (type: string), _col9 (type: string)
+                    mode: hash
+                    outputColumnNames: _col0, _col1, _col2
+                    Reduce Output Operator
+                      key expressions: _col0 (type: string), _col1 (type: 
string)
+                      sort order: ++
+                      Map-reduce partition columns: _col0 (type: string)
       Reduce Operator Tree:
         Group By Operator
           aggregations: count(DISTINCT KEY._col1:0._col0)

http://git-wip-us.apache.org/repos/asf/hive/blob/095f96b9/ql/src/test/results/clientpositive/bucketmapjoin1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/bucketmapjoin1.q.out 
b/ql/src/test/results/clientpositive/bucketmapjoin1.q.out
index 9a76f94..6ae92c0 100644
--- a/ql/src/test/results/clientpositive/bucketmapjoin1.q.out
+++ b/ql/src/test/results/clientpositive/bucketmapjoin1.q.out
@@ -128,6 +128,53 @@ STAGE PLANS:
 
   Stage: Stage-1
     Map Reduce
+      Map Operator Tree:
+          TableScan
+            alias: a
+            Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+            GatherStats: false
+            Filter Operator
+              isSamplingPred: false
+              predicate: key is not null (type: boolean)
+              Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+              Map Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                condition expressions:
+                  0 {key} {value}
+                  1 {value}
+                keys:
+                  0 key (type: int)
+                  1 key (type: int)
+                outputColumnNames: _col0, _col1, _col7
+                Position of Big Table: 0
+                Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+                BucketMapJoin: true
+                Select Operator
+                  expressions: _col0 (type: int), _col1 (type: string), _col7 
(type: string)
+                  outputColumnNames: _col0, _col1, _col2
+                  Statistics: Num rows: 0 Data size: 0 Basic stats: NONE 
Column stats: NONE
+                  File Output Operator
+                    compressed: false
+                    GlobalTableId: 0
+#### A masked pattern was here ####
+                    NumFilesPerFileSink: 1
+                    Statistics: Num rows: 0 Data size: 0 Basic stats: NONE 
Column stats: NONE
+#### A masked pattern was here ####
+                    table:
+                        input format: org.apache.hadoop.mapred.TextInputFormat
+                        output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                        properties:
+                          columns _col0,_col1,_col2
+                          columns.types int:string:string
+                          escape.delim \
+                          hive.serialization.extend.nesting.levels true
+                          serialization.format 1
+                          serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                        serde: 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    TotalFiles: 1
+                    GatherStats: false
+                    MultiFileSpray: false
       Local Work:
         Map Reduce Local Work
 
@@ -255,6 +302,53 @@ STAGE PLANS:
 
   Stage: Stage-1
     Map Reduce
+      Map Operator Tree:
+          TableScan
+            alias: b
+            Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+            GatherStats: false
+            Filter Operator
+              isSamplingPred: false
+              predicate: (key is not null and (ds = '2008-04-08')) (type: 
boolean)
+              Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+              Map Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                condition expressions:
+                  0 {key} {value}
+                  1 {value}
+                keys:
+                  0 key (type: int)
+                  1 key (type: int)
+                outputColumnNames: _col0, _col1, _col7
+                Position of Big Table: 1
+                Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+                BucketMapJoin: true
+                Select Operator
+                  expressions: _col0 (type: int), _col1 (type: string), _col7 
(type: string)
+                  outputColumnNames: _col0, _col1, _col2
+                  Statistics: Num rows: 0 Data size: 0 Basic stats: NONE 
Column stats: NONE
+                  File Output Operator
+                    compressed: false
+                    GlobalTableId: 0
+#### A masked pattern was here ####
+                    NumFilesPerFileSink: 1
+                    Statistics: Num rows: 0 Data size: 0 Basic stats: NONE 
Column stats: NONE
+#### A masked pattern was here ####
+                    table:
+                        input format: org.apache.hadoop.mapred.TextInputFormat
+                        output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                        properties:
+                          columns _col0,_col1,_col2
+                          columns.types int:string:string
+                          escape.delim \
+                          hive.serialization.extend.nesting.levels true
+                          serialization.format 1
+                          serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                        serde: 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    TotalFiles: 1
+                    GatherStats: false
+                    MultiFileSpray: false
       Local Work:
         Map Reduce Local Work
 

http://git-wip-us.apache.org/repos/asf/hive/blob/095f96b9/ql/src/test/results/clientpositive/groupby_sort_6.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/groupby_sort_6.q.out 
b/ql/src/test/results/clientpositive/groupby_sort_6.q.out
index 67dee46..5f3a3e2 100644
Binary files a/ql/src/test/results/clientpositive/groupby_sort_6.q.out and 
b/ql/src/test/results/clientpositive/groupby_sort_6.q.out differ

http://git-wip-us.apache.org/repos/asf/hive/blob/095f96b9/ql/src/test/results/clientpositive/input26.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/input26.q.out 
b/ql/src/test/results/clientpositive/input26.q.out
index 443c1c5..8c00882 100644
--- a/ql/src/test/results/clientpositive/input26.q.out
+++ b/ql/src/test/results/clientpositive/input26.q.out
@@ -83,6 +83,24 @@ STAGE PLANS:
 
   Stage: Stage-3
     Map Reduce
+      Map Operator Tree:
+          TableScan
+            alias: b
+            Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+            Filter Operator
+              predicate: ((ds = '2008-04-08') and (hr = '14')) (type: boolean)
+              Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+              Select Operator
+                expressions: key (type: string), value (type: string)
+                outputColumnNames: _col0, _col1
+                Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+                Limit
+                  Number of rows: 5
+                  Statistics: Num rows: 0 Data size: 0 Basic stats: NONE 
Column stats: NONE
+                  Reduce Output Operator
+                    sort order: 
+                    Statistics: Num rows: 0 Data size: 0 Basic stats: NONE 
Column stats: NONE
+                    value expressions: _col0 (type: string), _col1 (type: 
string)
       Reduce Operator Tree:
         Select Operator
           expressions: VALUE._col0 (type: string), VALUE._col1 (type: string), 
'14' (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/095f96b9/ql/src/test/results/clientpositive/join_view.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/join_view.q.out 
b/ql/src/test/results/clientpositive/join_view.q.out
index ef97996..ad3fbe2 100644
--- a/ql/src/test/results/clientpositive/join_view.q.out
+++ b/ql/src/test/results/clientpositive/join_view.q.out
@@ -49,6 +49,31 @@ STAGE DEPENDENCIES:
 STAGE PLANS:
   Stage: Stage-1
     Map Reduce
+      Map Operator Tree:
+          TableScan
+            alias: invites2
+            Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+            Filter Operator
+              predicate: (ds = '2011-09-01') (type: boolean)
+              Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+              Reduce Output Operator
+                key expressions: '2011-09-01' (type: string)
+                sort order: +
+                Map-reduce partition columns: '2011-09-01' (type: string)
+                Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+                value expressions: foo (type: int)
+          TableScan
+            alias: invites
+            Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+            Filter Operator
+              predicate: (ds = '2011-09-01') (type: boolean)
+              Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+              Reduce Output Operator
+                key expressions: '2011-09-01' (type: string)
+                sort order: +
+                Map-reduce partition columns: '2011-09-01' (type: string)
+                Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+                value expressions: bar (type: string)
       Reduce Operator Tree:
         Join Operator
           condition map:

http://git-wip-us.apache.org/repos/asf/hive/blob/095f96b9/ql/src/test/results/clientpositive/metadataonly1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/metadataonly1.q.out 
b/ql/src/test/results/clientpositive/metadataonly1.q.out
index 04549cb..189591a 100644
Binary files a/ql/src/test/results/clientpositive/metadataonly1.q.out and 
b/ql/src/test/results/clientpositive/metadataonly1.q.out differ

http://git-wip-us.apache.org/repos/asf/hive/blob/095f96b9/ql/src/test/results/clientpositive/nullgroup5.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/nullgroup5.q.out 
b/ql/src/test/results/clientpositive/nullgroup5.q.out
index f401380..cc61f0e 100644
--- a/ql/src/test/results/clientpositive/nullgroup5.q.out
+++ b/ql/src/test/results/clientpositive/nullgroup5.q.out
@@ -57,6 +57,29 @@ STAGE PLANS:
     Map Reduce
       Map Operator Tree:
           TableScan
+            alias: x
+            Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+            Filter Operator
+              predicate: (ds = '2009-04-05') (type: boolean)
+              Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+              Select Operator
+                expressions: key (type: string), value (type: string)
+                outputColumnNames: _col0, _col1
+                Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+                Union
+                  Statistics: Num rows: 29 Data size: 5812 Basic stats: 
COMPLETE Column stats: NONE
+                  Select Operator
+                    expressions: _col0 (type: string), _col1 (type: string)
+                    outputColumnNames: _col0, _col1
+                    Statistics: Num rows: 29 Data size: 5812 Basic stats: 
COMPLETE Column stats: NONE
+                    File Output Operator
+                      compressed: false
+                      Statistics: Num rows: 29 Data size: 5812 Basic stats: 
COMPLETE Column stats: NONE
+                      table:
+                          input format: 
org.apache.hadoop.mapred.TextInputFormat
+                          output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                          serde: 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+          TableScan
             alias: y
             Statistics: Num rows: 29 Data size: 5812 Basic stats: COMPLETE 
Column stats: NONE
             Select Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/095f96b9/ql/src/test/results/clientpositive/optimize_nullscan.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/optimize_nullscan.q.out 
b/ql/src/test/results/clientpositive/optimize_nullscan.q.out
index a31a7ea..b242c6b 100644
Binary files a/ql/src/test/results/clientpositive/optimize_nullscan.q.out and 
b/ql/src/test/results/clientpositive/optimize_nullscan.q.out differ

http://git-wip-us.apache.org/repos/asf/hive/blob/095f96b9/ql/src/test/results/clientpositive/partition_boolexpr.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/partition_boolexpr.q.out 
b/ql/src/test/results/clientpositive/partition_boolexpr.q.out
index 7d414ff..5e4bb8b 100644
--- a/ql/src/test/results/clientpositive/partition_boolexpr.q.out
+++ b/ql/src/test/results/clientpositive/partition_boolexpr.q.out
@@ -88,6 +88,24 @@ STAGE DEPENDENCIES:
 STAGE PLANS:
   Stage: Stage-1
     Map Reduce
+      Map Operator Tree:
+          TableScan
+            alias: srcpart
+            Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+            Filter Operator
+              predicate: false (type: boolean)
+              Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+              Select Operator
+                Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+                Group By Operator
+                  aggregations: count(1)
+                  mode: hash
+                  outputColumnNames: _col0
+                  Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
+                  Reduce Output Operator
+                    sort order: 
+                    Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
+                    value expressions: _col0 (type: bigint)
       Reduce Operator Tree:
         Group By Operator
           aggregations: count(VALUE._col0)
@@ -273,6 +291,24 @@ STAGE DEPENDENCIES:
 STAGE PLANS:
   Stage: Stage-1
     Map Reduce
+      Map Operator Tree:
+          TableScan
+            alias: srcpart
+            Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+            Filter Operator
+              predicate: false (type: boolean)
+              Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+              Select Operator
+                Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+                Group By Operator
+                  aggregations: count(1)
+                  mode: hash
+                  outputColumnNames: _col0
+                  Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
+                  Reduce Output Operator
+                    sort order: 
+                    Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
+                    value expressions: _col0 (type: bigint)
       Reduce Operator Tree:
         Group By Operator
           aggregations: count(VALUE._col0)

http://git-wip-us.apache.org/repos/asf/hive/blob/095f96b9/ql/src/test/results/clientpositive/ppd_union_view.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/ppd_union_view.q.out 
b/ql/src/test/results/clientpositive/ppd_union_view.q.out
index 26ba83e..af4111b 100644
--- a/ql/src/test/results/clientpositive/ppd_union_view.q.out
+++ b/ql/src/test/results/clientpositive/ppd_union_view.q.out
@@ -360,6 +360,45 @@ STAGE PLANS:
                   TotalFiles: 1
                   GatherStats: false
                   MultiFileSpray: false
+          TableScan
+            alias: t1_new
+            Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+            GatherStats: false
+            Filter Operator
+              isSamplingPred: false
+              predicate: (ds = '2011-10-13') (type: boolean)
+              Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+              Select Operator
+                expressions: key (type: string), value (type: string)
+                outputColumnNames: _col0, _col1
+                Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+                Union
+                  Statistics: Num rows: 1 Data size: 15 Basic stats: COMPLETE 
Column stats: NONE
+                  Select Operator
+                    expressions: _col0 (type: string), _col1 (type: string), 
'2011-10-13' (type: string)
+                    outputColumnNames: _col0, _col1, _col2
+                    Statistics: Num rows: 1 Data size: 15 Basic stats: 
COMPLETE Column stats: NONE
+                    File Output Operator
+                      compressed: false
+                      GlobalTableId: 0
+#### A masked pattern was here ####
+                      NumFilesPerFileSink: 1
+                      Statistics: Num rows: 1 Data size: 15 Basic stats: 
COMPLETE Column stats: NONE
+#### A masked pattern was here ####
+                      table:
+                          input format: 
org.apache.hadoop.mapred.TextInputFormat
+                          output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                          properties:
+                            columns _col0,_col1,_col2
+                            columns.types string:string:string
+                            escape.delim \
+                            hive.serialization.extend.nesting.levels true
+                            serialization.format 1
+                            serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                          serde: 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                      TotalFiles: 1
+                      GatherStats: false
+                      MultiFileSpray: false
       Path -> Alias:
 #### A masked pattern was here ####
       Path -> Partition:
@@ -465,6 +504,39 @@ STAGE DEPENDENCIES:
 STAGE PLANS:
   Stage: Stage-1
     Map Reduce
+      Map Operator Tree:
+          TableScan
+            alias: t1_mapping
+            Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+            GatherStats: false
+            Filter Operator
+              isSamplingPred: false
+              predicate: (keymap is not null and (ds = '2011-10-15')) (type: 
boolean)
+              Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+              Reduce Output Operator
+                key expressions: keymap (type: string), '2011-10-15' (type: 
string)
+                sort order: ++
+                Map-reduce partition columns: keymap (type: string), 
'2011-10-15' (type: string)
+                Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+                tag: 1
+                value expressions: key (type: string)
+                auto parallelism: false
+          TableScan
+            alias: t1_old
+            Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+            GatherStats: false
+            Filter Operator
+              isSamplingPred: false
+              predicate: (keymap is not null and (ds = '2011-10-15')) (type: 
boolean)
+              Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+              Reduce Output Operator
+                key expressions: keymap (type: string), '2011-10-15' (type: 
string)
+                sort order: ++
+                Map-reduce partition columns: keymap (type: string), 
'2011-10-15' (type: string)
+                Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+                tag: 0
+                value expressions: value (type: string)
+                auto parallelism: false
       Needs Tagging: true
       Reduce Operator Tree:
         Join Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/095f96b9/ql/src/test/results/clientpositive/reduce_deduplicate.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/reduce_deduplicate.q.out 
b/ql/src/test/results/clientpositive/reduce_deduplicate.q.out
index d4933e0..b861d43 100644
Binary files a/ql/src/test/results/clientpositive/reduce_deduplicate.q.out and 
b/ql/src/test/results/clientpositive/reduce_deduplicate.q.out differ

http://git-wip-us.apache.org/repos/asf/hive/blob/095f96b9/ql/src/test/results/clientpositive/sample6.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/sample6.q.out 
b/ql/src/test/results/clientpositive/sample6.q.out
index 2dd92dc..5a13db9 100644
Binary files a/ql/src/test/results/clientpositive/sample6.q.out and 
b/ql/src/test/results/clientpositive/sample6.q.out differ

http://git-wip-us.apache.org/repos/asf/hive/blob/095f96b9/ql/src/test/results/clientpositive/smb_mapjoin9.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/smb_mapjoin9.q.out 
b/ql/src/test/results/clientpositive/smb_mapjoin9.q.out
index e566384..6dbcfac 100644
--- a/ql/src/test/results/clientpositive/smb_mapjoin9.q.out
+++ b/ql/src/test/results/clientpositive/smb_mapjoin9.q.out
@@ -112,6 +112,49 @@ STAGE DEPENDENCIES:
 STAGE PLANS:
   Stage: Stage-1
     Map Reduce
+      Map Operator Tree:
+          TableScan
+            alias: a
+            Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+            GatherStats: false
+            Filter Operator
+              isSamplingPred: false
+              predicate: (key is not null and (ds = '2010-10-15')) (type: 
boolean)
+              Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+              Sorted Merge Bucket Map Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                condition expressions:
+                  0 {key}
+                  1 {key} {value}
+                keys:
+                  0 key (type: int)
+                  1 key (type: int)
+                outputColumnNames: _col0, _col6, _col7
+                Position of Big Table: 0
+                Select Operator
+                  expressions: _col6 (type: int), _col7 (type: string), 
'2010-10-15' (type: string), _col0 (type: int)
+                  outputColumnNames: _col0, _col1, _col2, _col3
+                  File Output Operator
+                    compressed: false
+                    GlobalTableId: 0
+#### A masked pattern was here ####
+                    NumFilesPerFileSink: 1
+#### A masked pattern was here ####
+                    table:
+                        input format: org.apache.hadoop.mapred.TextInputFormat
+                        output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                        properties:
+                          columns _col0,_col1,_col2,_col3
+                          columns.types int:string:string:int
+                          escape.delim \
+                          hive.serialization.extend.nesting.levels true
+                          serialization.format 1
+                          serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                        serde: 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    TotalFiles: 1
+                    GatherStats: false
+                    MultiFileSpray: false
 
   Stage: Stage-0
     Fetch Operator
@@ -231,6 +274,49 @@ STAGE DEPENDENCIES:
 STAGE PLANS:
   Stage: Stage-1
     Map Reduce
+      Map Operator Tree:
+          TableScan
+            alias: b
+            Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+            GatherStats: false
+            Filter Operator
+              isSamplingPred: false
+              predicate: (key is not null and (ds = '2010-10-15')) (type: 
boolean)
+              Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column 
stats: NONE
+              Sorted Merge Bucket Map Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                condition expressions:
+                  0 {key}
+                  1 {key} {value}
+                keys:
+                  0 key (type: int)
+                  1 key (type: int)
+                outputColumnNames: _col0, _col6, _col7
+                Position of Big Table: 1
+                Select Operator
+                  expressions: _col6 (type: int), _col7 (type: string), 
'2010-10-15' (type: string), _col0 (type: int)
+                  outputColumnNames: _col0, _col1, _col2, _col3
+                  File Output Operator
+                    compressed: false
+                    GlobalTableId: 0
+#### A masked pattern was here ####
+                    NumFilesPerFileSink: 1
+#### A masked pattern was here ####
+                    table:
+                        input format: org.apache.hadoop.mapred.TextInputFormat
+                        output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                        properties:
+                          columns _col0,_col1,_col2,_col3
+                          columns.types int:string:string:int
+                          escape.delim \
+                          hive.serialization.extend.nesting.levels true
+                          serialization.format 1
+                          serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                        serde: 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    TotalFiles: 1
+                    GatherStats: false
+                    MultiFileSpray: false
 
   Stage: Stage-0
     Fetch Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/095f96b9/ql/src/test/results/clientpositive/tez/dynamic_partition_pruning.q.out
----------------------------------------------------------------------
diff --git 
a/ql/src/test/results/clientpositive/tez/dynamic_partition_pruning.q.out 
b/ql/src/test/results/clientpositive/tez/dynamic_partition_pruning.q.out
index da7e10a..0277977 100644
--- a/ql/src/test/results/clientpositive/tez/dynamic_partition_pruning.q.out
+++ b/ql/src/test/results/clientpositive/tez/dynamic_partition_pruning.q.out
@@ -2721,6 +2721,19 @@ STAGE PLANS:
 #### A masked pattern was here ####
       Vertices:
         Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: srcpart
+                  filterExpr: ((ds is not null and hr is not null) and (hr = 
13)) (type: boolean)
+                  Statistics: Num rows: 0 Data size: 0 Basic stats: NONE 
Column stats: NONE
+                  Filter Operator
+                    predicate: ((ds is not null and hr is not null) and (hr = 
13)) (type: boolean)
+                    Statistics: Num rows: 0 Data size: 0 Basic stats: NONE 
Column stats: NONE
+                    Reduce Output Operator
+                      key expressions: ds (type: string)
+                      sort order: +
+                      Map-reduce partition columns: ds (type: string)
+                      Statistics: Num rows: 0 Data size: 0 Basic stats: NONE 
Column stats: NONE
         Map 5 
             Map Operator Tree:
                 TableScan
@@ -4903,6 +4916,31 @@ STAGE PLANS:
 #### A masked pattern was here ####
       Vertices:
         Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: srcpart
+                  filterExpr: ((ds is not null and hr is not null) and (hr = 
13)) (type: boolean)
+                  Statistics: Num rows: 0 Data size: 0 Basic stats: NONE 
Column stats: NONE
+                  Filter Operator
+                    predicate: ((ds is not null and hr is not null) and (hr = 
13)) (type: boolean)
+                    Statistics: Num rows: 0 Data size: 0 Basic stats: NONE 
Column stats: NONE
+                    Map Join Operator
+                      condition map:
+                           Inner Join 0 to 1
+                      condition expressions:
+                        0 
+                        1 
+                      keys:
+                        0 ds (type: string)
+                        1 ds (type: string)
+                      input vertices:
+                        1 Map 4
+                      Statistics: Num rows: 0 Data size: 0 Basic stats: NONE 
Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: '13' (type: string)
+                        sort order: +
+                        Map-reduce partition columns: '13' (type: string)
+                        Statistics: Num rows: 0 Data size: 0 Basic stats: NONE 
Column stats: NONE
         Map 2 
             Map Operator Tree:
                 TableScan

http://git-wip-us.apache.org/repos/asf/hive/blob/095f96b9/ql/src/test/results/clientpositive/tez/metadataonly1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/metadataonly1.q.out 
b/ql/src/test/results/clientpositive/tez/metadataonly1.q.out
index 8b90e42..8c3f1d6 100644
Binary files a/ql/src/test/results/clientpositive/tez/metadataonly1.q.out and 
b/ql/src/test/results/clientpositive/tez/metadataonly1.q.out differ

http://git-wip-us.apache.org/repos/asf/hive/blob/095f96b9/ql/src/test/results/clientpositive/tez/optimize_nullscan.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/optimize_nullscan.q.out 
b/ql/src/test/results/clientpositive/tez/optimize_nullscan.q.out
index 5f9480c..3e2c797 100644
Binary files a/ql/src/test/results/clientpositive/tez/optimize_nullscan.q.out 
and b/ql/src/test/results/clientpositive/tez/optimize_nullscan.q.out differ

http://git-wip-us.apache.org/repos/asf/hive/blob/095f96b9/ql/src/test/results/clientpositive/tez/tez_union.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/tez_union.q.out 
b/ql/src/test/results/clientpositive/tez/tez_union.q.out
index e1ea884..0858e83 100644
--- a/ql/src/test/results/clientpositive/tez/tez_union.q.out
+++ b/ql/src/test/results/clientpositive/tez/tez_union.q.out
@@ -1282,3 +1282,68 @@ POSTHOOK: query: drop table ut
 POSTHOOK: type: DROPTABLE
 POSTHOOK: Input: default@ut
 POSTHOOK: Output: default@ut
+PREHOOK: query: create table TABLE1(EMP_NAME STRING, EMP_ID INT) ROW FORMAT 
DELIMITED FIELDS TERMINATED BY ','
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@TABLE1
+POSTHOOK: query: create table TABLE1(EMP_NAME STRING, EMP_ID INT) ROW FORMAT 
DELIMITED FIELDS TERMINATED BY ','
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@TABLE1
+PREHOOK: query: create table table2 (EMP_NAME STRING) PARTITIONED BY (EMP_ID 
INT) ROW FORMAT DELIMITED FIELDS TERMINATED BY ','
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@table2
+POSTHOOK: query: create table table2 (EMP_NAME STRING) PARTITIONED BY (EMP_ID 
INT) ROW FORMAT DELIMITED FIELDS TERMINATED BY ','
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@table2
+PREHOOK: query: CREATE OR REPLACE VIEW TABLE3 as select EMP_NAME, EMP_ID from 
TABLE1
+PREHOOK: type: CREATEVIEW
+PREHOOK: Input: default@table1
+PREHOOK: Output: database:default
+PREHOOK: Output: default@TABLE3
+POSTHOOK: query: CREATE OR REPLACE VIEW TABLE3 as select EMP_NAME, EMP_ID from 
TABLE1
+POSTHOOK: type: CREATEVIEW
+POSTHOOK: Input: default@table1
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@TABLE3
+PREHOOK: query: explain formatted select count(*) from TABLE3
+PREHOOK: type: QUERY
+POSTHOOK: query: explain formatted select count(*) from TABLE3
+POSTHOOK: type: QUERY
+#### A masked pattern was here ####
+PREHOOK: query: drop table table2
+PREHOOK: type: DROPTABLE
+PREHOOK: Input: default@table2
+PREHOOK: Output: default@table2
+POSTHOOK: query: drop table table2
+POSTHOOK: type: DROPTABLE
+POSTHOOK: Input: default@table2
+POSTHOOK: Output: default@table2
+PREHOOK: query: create table table2 (EMP_NAME STRING) PARTITIONED BY (EMP_ID 
INT) ROW FORMAT DELIMITED FIELDS TERMINATED BY ','
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@table2
+POSTHOOK: query: create table table2 (EMP_NAME STRING) PARTITIONED BY (EMP_ID 
INT) ROW FORMAT DELIMITED FIELDS TERMINATED BY ','
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@table2
+PREHOOK: query: CREATE OR REPLACE VIEW TABLE3 as select EMP_NAME, EMP_ID from 
TABLE1 UNION ALL select EMP_NAME,EMP_ID from TABLE2
+PREHOOK: type: CREATEVIEW
+PREHOOK: Input: default@table1
+PREHOOK: Input: default@table2
+PREHOOK: Output: database:default
+PREHOOK: Output: default@TABLE3
+POSTHOOK: query: CREATE OR REPLACE VIEW TABLE3 as select EMP_NAME, EMP_ID from 
TABLE1 UNION ALL select EMP_NAME,EMP_ID from TABLE2
+POSTHOOK: type: CREATEVIEW
+POSTHOOK: Input: default@table1
+POSTHOOK: Input: default@table2
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@TABLE3
+POSTHOOK: Output: default@table3
+PREHOOK: query: explain formatted select count(*) from TABLE3
+PREHOOK: type: QUERY
+POSTHOOK: query: explain formatted select count(*) from TABLE3
+POSTHOOK: type: QUERY
+#### A masked pattern was here ####

http://git-wip-us.apache.org/repos/asf/hive/blob/095f96b9/ql/src/test/results/clientpositive/tez/tez_union_group_by.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/tez_union_group_by.q.out 
b/ql/src/test/results/clientpositive/tez/tez_union_group_by.q.out
index f5bad7f..d5ca1fe 100644
--- a/ql/src/test/results/clientpositive/tez/tez_union_group_by.q.out
+++ b/ql/src/test/results/clientpositive/tez/tez_union_group_by.q.out
@@ -169,9 +169,85 @@ STAGE PLANS:
                       Map-reduce partition columns: t (type: string), st 
(type: string)
                       Statistics: Num rows: 0 Data size: 0 Basic stats: NONE 
Column stats: NONE
         Map 10 
+            Map Operator Tree:
+                TableScan
+                  alias: x
+                  Filter Operator
+                    predicate: ((date < '2014-09-02') and (u <> 0)) (type: 
boolean)
+                    Select Operator
+                      expressions: u (type: bigint), date (type: string)
+                      outputColumnNames: _col0, _col1
+                      Select Operator
+                        expressions: _col0 (type: bigint), _col1 (type: string)
+                        outputColumnNames: _col0, _col1
+                        Group By Operator
+                          aggregations: min(_col1)
+                          keys: _col0 (type: bigint)
+                          mode: hash
+                          outputColumnNames: _col0, _col1
+                          Reduce Output Operator
+                            key expressions: _col0 (type: bigint)
+                            sort order: +
+                            Map-reduce partition columns: _col0 (type: bigint)
+                            value expressions: _col1 (type: string)
         Map 5 
+            Map Operator Tree:
+                TableScan
+                  alias: x
+                  Statistics: Num rows: 0 Data size: 0 Basic stats: NONE 
Column stats: NONE
+                  Filter Operator
+                    predicate: (((t is not null and (date >= '2014-03-04')) 
and (date < '2014-09-03')) and (u <> 0)) (type: boolean)
+                    Statistics: Num rows: 0 Data size: 0 Basic stats: NONE 
Column stats: NONE
+                    Reduce Output Operator
+                      key expressions: t (type: string), st (type: string)
+                      sort order: ++
+                      Map-reduce partition columns: t (type: string), st 
(type: string)
+                      Statistics: Num rows: 0 Data size: 0 Basic stats: NONE 
Column stats: NONE
+                      value expressions: u (type: bigint)
         Map 6 
+            Map Operator Tree:
+                TableScan
+                  alias: z
+                  Filter Operator
+                    predicate: ((date < '2014-09-02') and (u <> 0)) (type: 
boolean)
+                    Select Operator
+                      expressions: u (type: bigint), date (type: string)
+                      outputColumnNames: _col0, _col1
+                      Select Operator
+                        expressions: _col0 (type: bigint), _col1 (type: string)
+                        outputColumnNames: _col0, _col1
+                        Group By Operator
+                          aggregations: min(_col1)
+                          keys: _col0 (type: bigint)
+                          mode: hash
+                          outputColumnNames: _col0, _col1
+                          Reduce Output Operator
+                            key expressions: _col0 (type: bigint)
+                            sort order: +
+                            Map-reduce partition columns: _col0 (type: bigint)
+                            value expressions: _col1 (type: string)
         Map 9 
+            Map Operator Tree:
+                TableScan
+                  alias: y
+                  Filter Operator
+                    predicate: ((date < '2014-09-02') and (u <> 0)) (type: 
boolean)
+                    Select Operator
+                      expressions: u (type: bigint), date (type: string)
+                      outputColumnNames: _col0, _col1
+                      Select Operator
+                        expressions: _col0 (type: bigint), _col1 (type: string)
+                        outputColumnNames: _col0, _col1
+                        Group By Operator
+                          aggregations: min(_col1)
+                          keys: _col0 (type: bigint)
+                          mode: hash
+                          outputColumnNames: _col0, _col1
+                          Reduce Output Operator
+                            key expressions: _col0 (type: bigint)
+                            sort order: +
+                            Map-reduce partition columns: _col0 (type: bigint)
+                            value expressions: _col1 (type: string)
         Reducer 2 
             Reduce Operator Tree:
               Merge Join Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/095f96b9/ql/src/test/results/clientpositive/tez/union_view.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/union_view.q.out 
b/ql/src/test/results/clientpositive/tez/union_view.q.out
new file mode 100644
index 0000000..ae6d7c8
--- /dev/null
+++ b/ql/src/test/results/clientpositive/tez/union_view.q.out
@@ -0,0 +1,1004 @@
+PREHOOK: query: CREATE TABLE src_union_1 (key int, value string) PARTITIONED 
BY (ds string)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@src_union_1
+POSTHOOK: query: CREATE TABLE src_union_1 (key int, value string) PARTITIONED 
BY (ds string)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@src_union_1
+PREHOOK: query: CREATE INDEX src_union_1_key_idx ON TABLE src_union_1(key) AS 
'COMPACT' WITH DEFERRED REBUILD
+PREHOOK: type: CREATEINDEX
+PREHOOK: Input: default@src_union_1
+POSTHOOK: query: CREATE INDEX src_union_1_key_idx ON TABLE src_union_1(key) AS 
'COMPACT' WITH DEFERRED REBUILD
+POSTHOOK: type: CREATEINDEX
+POSTHOOK: Input: default@src_union_1
+POSTHOOK: Output: default@default__src_union_1_src_union_1_key_idx__
+PREHOOK: query: CREATE TABLE src_union_2 (key int, value string) PARTITIONED 
BY (ds string, part_1 string)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@src_union_2
+POSTHOOK: query: CREATE TABLE src_union_2 (key int, value string) PARTITIONED 
BY (ds string, part_1 string)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@src_union_2
+PREHOOK: query: CREATE INDEX src_union_2_key_idx ON TABLE src_union_2(key) AS 
'COMPACT' WITH DEFERRED REBUILD
+PREHOOK: type: CREATEINDEX
+PREHOOK: Input: default@src_union_2
+POSTHOOK: query: CREATE INDEX src_union_2_key_idx ON TABLE src_union_2(key) AS 
'COMPACT' WITH DEFERRED REBUILD
+POSTHOOK: type: CREATEINDEX
+POSTHOOK: Input: default@src_union_2
+POSTHOOK: Output: default@default__src_union_2_src_union_2_key_idx__
+PREHOOK: query: CREATE TABLE src_union_3(key int, value string) PARTITIONED BY 
(ds string, part_1 string, part_2 string)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@src_union_3
+POSTHOOK: query: CREATE TABLE src_union_3(key int, value string) PARTITIONED 
BY (ds string, part_1 string, part_2 string)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@src_union_3
+PREHOOK: query: CREATE INDEX src_union_3_key_idx ON TABLE src_union_3(key) AS 
'COMPACT' WITH DEFERRED REBUILD
+PREHOOK: type: CREATEINDEX
+PREHOOK: Input: default@src_union_3
+POSTHOOK: query: CREATE INDEX src_union_3_key_idx ON TABLE src_union_3(key) AS 
'COMPACT' WITH DEFERRED REBUILD
+POSTHOOK: type: CREATEINDEX
+POSTHOOK: Input: default@src_union_3
+POSTHOOK: Output: default@default__src_union_3_src_union_3_key_idx__
+STAGE DEPENDENCIES:
+  Stage-0 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        TableScan
+          alias: src_union_1
+          filterExpr: ((key = 86) and (ds = '1')) (type: boolean)
+          Filter Operator
+            predicate: (key = 86) (type: boolean)
+            Select Operator
+              expressions: 86 (type: int), value (type: string), '1' (type: 
string)
+              outputColumnNames: _col0, _col1, _col2
+              ListSink
+
+STAGE DEPENDENCIES:
+  Stage-0 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        TableScan
+          alias: src_union_2
+          filterExpr: ((key = 86) and (ds = '2')) (type: boolean)
+          Filter Operator
+            predicate: (key = 86) (type: boolean)
+            Select Operator
+              expressions: 86 (type: int), value (type: string), '2' (type: 
string)
+              outputColumnNames: _col0, _col1, _col2
+              ListSink
+
+STAGE DEPENDENCIES:
+  Stage-0 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        TableScan
+          alias: src_union_3
+          filterExpr: ((key = 86) and (ds = '3')) (type: boolean)
+          Filter Operator
+            predicate: (key = 86) (type: boolean)
+            Select Operator
+              expressions: 86 (type: int), value (type: string), '3' (type: 
string)
+              outputColumnNames: _col0, _col1, _col2
+              ListSink
+
+86     val_86  1
+86     val_86  2
+86     val_86  2
+86     val_86  3
+86     val_86  3
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-1
+    Tez
+      Edges:
+        Reducer 2 <- Map 1 (SIMPLE_EDGE)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: src_union_1
+                  filterExpr: (ds = '1') (type: boolean)
+                  Statistics: Num rows: 500 Data size: 5312 Basic stats: 
COMPLETE Column stats: NONE
+                  Select Operator
+                    Statistics: Num rows: 500 Data size: 5312 Basic stats: 
COMPLETE Column stats: NONE
+                    Group By Operator
+                      aggregations: count(1)
+                      mode: hash
+                      outputColumnNames: _col0
+                      Statistics: Num rows: 1 Data size: 8 Basic stats: 
COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        sort order: 
+                        Statistics: Num rows: 1 Data size: 8 Basic stats: 
COMPLETE Column stats: NONE
+                        value expressions: _col0 (type: bigint)
+        Reducer 2 
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: count(VALUE._col0)
+                mode: mergepartial
+                outputColumnNames: _col0
+                Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
+                File Output Operator
+                  compressed: false
+                  Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
+                  table:
+                      input format: org.apache.hadoop.mapred.TextInputFormat
+                      output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        ListSink
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-1
+    Tez
+      Edges:
+        Reducer 2 <- Map 1 (SIMPLE_EDGE)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: src_union_2
+                  filterExpr: (ds = '2') (type: boolean)
+                  Statistics: Num rows: 1000 Data size: 10624 Basic stats: 
COMPLETE Column stats: NONE
+                  Select Operator
+                    Statistics: Num rows: 1000 Data size: 10624 Basic stats: 
COMPLETE Column stats: NONE
+                    Group By Operator
+                      aggregations: count(1)
+                      mode: hash
+                      outputColumnNames: _col0
+                      Statistics: Num rows: 1 Data size: 8 Basic stats: 
COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        sort order: 
+                        Statistics: Num rows: 1 Data size: 8 Basic stats: 
COMPLETE Column stats: NONE
+                        value expressions: _col0 (type: bigint)
+        Reducer 2 
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: count(VALUE._col0)
+                mode: mergepartial
+                outputColumnNames: _col0
+                Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
+                File Output Operator
+                  compressed: false
+                  Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
+                  table:
+                      input format: org.apache.hadoop.mapred.TextInputFormat
+                      output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        ListSink
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-1
+    Tez
+      Edges:
+        Reducer 2 <- Map 1 (SIMPLE_EDGE)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: src_union_3
+                  filterExpr: (ds = '3') (type: boolean)
+                  Statistics: Num rows: 1000 Data size: 10624 Basic stats: 
COMPLETE Column stats: NONE
+                  Select Operator
+                    Statistics: Num rows: 1000 Data size: 10624 Basic stats: 
COMPLETE Column stats: NONE
+                    Group By Operator
+                      aggregations: count(1)
+                      mode: hash
+                      outputColumnNames: _col0
+                      Statistics: Num rows: 1 Data size: 8 Basic stats: 
COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        sort order: 
+                        Statistics: Num rows: 1 Data size: 8 Basic stats: 
COMPLETE Column stats: NONE
+                        value expressions: _col0 (type: bigint)
+        Reducer 2 
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: count(VALUE._col0)
+                mode: mergepartial
+                outputColumnNames: _col0
+                Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
+                File Output Operator
+                  compressed: false
+                  Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
+                  table:
+                      input format: org.apache.hadoop.mapred.TextInputFormat
+                      output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        ListSink
+
+500
+1000
+1000
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-1
+    Tez
+      Edges:
+        Map 1 <- Union 2 (CONTAINS)
+        Map 3 <- Union 2 (CONTAINS)
+        Map 4 <- Union 2 (CONTAINS)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: src_union_1
+                  filterExpr: ((key = 86) and (ds = '1')) (type: boolean)
+                  Filter Operator
+                    predicate: (key = 86) (type: boolean)
+                    Select Operator
+                      expressions: value (type: string)
+                      outputColumnNames: _col1
+                      Select Operator
+                        expressions: 86 (type: int), _col1 (type: string), '1' 
(type: string)
+                        outputColumnNames: _col0, _col1, _col2
+                        File Output Operator
+                          compressed: false
+                          table:
+                              input format: 
org.apache.hadoop.mapred.TextInputFormat
+                              output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                              serde: 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+        Map 3 
+            Map Operator Tree:
+                TableScan
+                  alias: src_union_2
+                  filterExpr: ((key = 86) and (ds = '1')) (type: boolean)
+                  Filter Operator
+                    predicate: ((key = 86) and (ds = '1')) (type: boolean)
+                    Select Operator
+                      expressions: value (type: string)
+                      outputColumnNames: _col1
+                      Select Operator
+                        expressions: 86 (type: int), _col1 (type: string), '1' 
(type: string)
+                        outputColumnNames: _col0, _col1, _col2
+                        File Output Operator
+                          compressed: false
+                          table:
+                              input format: 
org.apache.hadoop.mapred.TextInputFormat
+                              output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                              serde: 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+        Map 4 
+            Map Operator Tree:
+                TableScan
+                  alias: src_union_3
+                  filterExpr: ((key = 86) and (ds = '1')) (type: boolean)
+                  Filter Operator
+                    predicate: ((key = 86) and (ds = '1')) (type: boolean)
+                    Select Operator
+                      expressions: value (type: string)
+                      outputColumnNames: _col1
+                      Select Operator
+                        expressions: 86 (type: int), _col1 (type: string), '1' 
(type: string)
+                        outputColumnNames: _col0, _col1, _col2
+                        File Output Operator
+                          compressed: false
+                          table:
+                              input format: 
org.apache.hadoop.mapred.TextInputFormat
+                              output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                              serde: 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+        Union 2 
+            Vertex: Union 2
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        ListSink
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-1
+    Tez
+      Edges:
+        Map 1 <- Union 2 (CONTAINS)
+        Map 3 <- Union 2 (CONTAINS)
+        Map 4 <- Union 2 (CONTAINS)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: src_union_1
+                  filterExpr: ((key = 86) and (ds = '2')) (type: boolean)
+                  Filter Operator
+                    predicate: ((key = 86) and (ds = '2')) (type: boolean)
+                    Select Operator
+                      expressions: value (type: string)
+                      outputColumnNames: _col1
+                      Select Operator
+                        expressions: 86 (type: int), _col1 (type: string), '2' 
(type: string)
+                        outputColumnNames: _col0, _col1, _col2
+                        File Output Operator
+                          compressed: false
+                          table:
+                              input format: 
org.apache.hadoop.mapred.TextInputFormat
+                              output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                              serde: 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+        Map 3 
+            Map Operator Tree:
+                TableScan
+                  alias: src_union_2
+                  filterExpr: ((key = 86) and (ds = '2')) (type: boolean)
+                  Filter Operator
+                    predicate: (key = 86) (type: boolean)
+                    Select Operator
+                      expressions: value (type: string)
+                      outputColumnNames: _col1
+                      Select Operator
+                        expressions: 86 (type: int), _col1 (type: string), '2' 
(type: string)
+                        outputColumnNames: _col0, _col1, _col2
+                        File Output Operator
+                          compressed: false
+                          table:
+                              input format: 
org.apache.hadoop.mapred.TextInputFormat
+                              output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                              serde: 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+        Map 4 
+            Map Operator Tree:
+                TableScan
+                  alias: src_union_3
+                  filterExpr: ((key = 86) and (ds = '2')) (type: boolean)
+                  Filter Operator
+                    predicate: ((key = 86) and (ds = '2')) (type: boolean)
+                    Select Operator
+                      expressions: value (type: string)
+                      outputColumnNames: _col1
+                      Select Operator
+                        expressions: 86 (type: int), _col1 (type: string), '2' 
(type: string)
+                        outputColumnNames: _col0, _col1, _col2
+                        File Output Operator
+                          compressed: false
+                          table:
+                              input format: 
org.apache.hadoop.mapred.TextInputFormat
+                              output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                              serde: 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+        Union 2 
+            Vertex: Union 2
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        ListSink
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-1
+    Tez
+      Edges:
+        Map 1 <- Union 2 (CONTAINS)
+        Map 3 <- Union 2 (CONTAINS)
+        Map 4 <- Union 2 (CONTAINS)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: src_union_1
+                  filterExpr: ((key = 86) and (ds = '3')) (type: boolean)
+                  Filter Operator
+                    predicate: ((key = 86) and (ds = '3')) (type: boolean)
+                    Select Operator
+                      expressions: value (type: string)
+                      outputColumnNames: _col1
+                      Select Operator
+                        expressions: 86 (type: int), _col1 (type: string), '3' 
(type: string)
+                        outputColumnNames: _col0, _col1, _col2
+                        File Output Operator
+                          compressed: false
+                          table:
+                              input format: 
org.apache.hadoop.mapred.TextInputFormat
+                              output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                              serde: 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+        Map 3 
+            Map Operator Tree:
+                TableScan
+                  alias: src_union_2
+                  filterExpr: ((key = 86) and (ds = '3')) (type: boolean)
+                  Filter Operator
+                    predicate: ((key = 86) and (ds = '3')) (type: boolean)
+                    Select Operator
+                      expressions: value (type: string)
+                      outputColumnNames: _col1
+                      Select Operator
+                        expressions: 86 (type: int), _col1 (type: string), '3' 
(type: string)
+                        outputColumnNames: _col0, _col1, _col2
+                        File Output Operator
+                          compressed: false
+                          table:
+                              input format: 
org.apache.hadoop.mapred.TextInputFormat
+                              output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                              serde: 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+        Map 4 
+            Map Operator Tree:
+                TableScan
+                  alias: src_union_3
+                  filterExpr: ((key = 86) and (ds = '3')) (type: boolean)
+                  Filter Operator
+                    predicate: (key = 86) (type: boolean)
+                    Select Operator
+                      expressions: value (type: string)
+                      outputColumnNames: _col1
+                      Select Operator
+                        expressions: 86 (type: int), _col1 (type: string), '3' 
(type: string)
+                        outputColumnNames: _col0, _col1, _col2
+                        File Output Operator
+                          compressed: false
+                          table:
+                              input format: 
org.apache.hadoop.mapred.TextInputFormat
+                              output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                              serde: 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+        Union 2 
+            Vertex: Union 2
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        ListSink
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-1
+    Tez
+      Edges:
+        Map 1 <- Union 2 (CONTAINS)
+        Map 4 <- Union 2 (CONTAINS)
+        Map 5 <- Union 2 (CONTAINS)
+        Reducer 3 <- Union 2 (SIMPLE_EDGE)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: src_union_1
+                  filterExpr: ((key = 86) and ds is not null) (type: boolean)
+                  Filter Operator
+                    predicate: (key = 86) (type: boolean)
+                    Select Operator
+                      expressions: value (type: string), ds (type: string)
+                      outputColumnNames: _col1, _col2
+                      Select Operator
+                        expressions: _col1 (type: string), _col2 (type: string)
+                        outputColumnNames: _col1, _col2
+                        Reduce Output Operator
+                          key expressions: _col2 (type: string)
+                          sort order: +
+                          value expressions: _col1 (type: string)
+        Map 4 
+            Map Operator Tree:
+                TableScan
+                  alias: src_union_2
+                  filterExpr: ((key = 86) and ds is not null) (type: boolean)
+                  Filter Operator
+                    predicate: (key = 86) (type: boolean)
+                    Select Operator
+                      expressions: value (type: string), ds (type: string)
+                      outputColumnNames: _col1, _col2
+                      Select Operator
+                        expressions: _col1 (type: string), _col2 (type: string)
+                        outputColumnNames: _col1, _col2
+                        Reduce Output Operator
+                          key expressions: _col2 (type: string)
+                          sort order: +
+                          value expressions: _col1 (type: string)
+        Map 5 
+            Map Operator Tree:
+                TableScan
+                  alias: src_union_3
+                  filterExpr: ((key = 86) and ds is not null) (type: boolean)
+                  Filter Operator
+                    predicate: (key = 86) (type: boolean)
+                    Select Operator
+                      expressions: value (type: string), ds (type: string)
+                      outputColumnNames: _col1, _col2
+                      Select Operator
+                        expressions: _col1 (type: string), _col2 (type: string)
+                        outputColumnNames: _col1, _col2
+                        Reduce Output Operator
+                          key expressions: _col2 (type: string)
+                          sort order: +
+                          value expressions: _col1 (type: string)
+        Reducer 3 
+            Reduce Operator Tree:
+              Select Operator
+                expressions: 86 (type: int), VALUE._col1 (type: string), 
KEY.reducesinkkey0 (type: string)
+                outputColumnNames: _col0, _col1, _col2
+                Statistics: Num rows: 1250 Data size: 13280 Basic stats: 
COMPLETE Column stats: NONE
+                File Output Operator
+                  compressed: false
+                  Statistics: Num rows: 1250 Data size: 13280 Basic stats: 
COMPLETE Column stats: NONE
+                  table:
+                      input format: org.apache.hadoop.mapred.TextInputFormat
+                      output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+        Union 2 
+            Vertex: Union 2
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        ListSink
+
+86     val_86  1
+86     val_86  2
+86     val_86  2
+86     val_86  3
+86     val_86  3
+86     val_86  1
+86     val_86  2
+86     val_86  2
+86     val_86  3
+86     val_86  3
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-1
+    Tez
+      Edges:
+        Map 1 <- Union 2 (CONTAINS)
+        Map 4 <- Union 2 (CONTAINS)
+        Map 5 <- Union 2 (CONTAINS)
+        Reducer 3 <- Union 2 (SIMPLE_EDGE)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: src_union_1
+                  filterExpr: (ds = '1') (type: boolean)
+                  Select Operator
+                    Select Operator
+                      Group By Operator
+                        aggregations: count(1)
+                        mode: hash
+                        outputColumnNames: _col0
+                        Reduce Output Operator
+                          sort order: 
+                          value expressions: _col0 (type: bigint)
+        Map 4 
+            Map Operator Tree:
+                TableScan
+                  alias: src_union_2
+                  filterExpr: (ds = '1') (type: boolean)
+                  Filter Operator
+                    predicate: (ds = '1') (type: boolean)
+                    Select Operator
+                      Select Operator
+                        Group By Operator
+                          aggregations: count(1)
+                          mode: hash
+                          outputColumnNames: _col0
+                          Reduce Output Operator
+                            sort order: 
+                            value expressions: _col0 (type: bigint)
+        Map 5 
+            Map Operator Tree:
+                TableScan
+                  alias: src_union_3
+                  filterExpr: (ds = '1') (type: boolean)
+                  Filter Operator
+                    predicate: (ds = '1') (type: boolean)
+                    Select Operator
+                      Select Operator
+                        Group By Operator
+                          aggregations: count(1)
+                          mode: hash
+                          outputColumnNames: _col0
+                          Reduce Output Operator
+                            sort order: 
+                            value expressions: _col0 (type: bigint)
+        Reducer 3 
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: count(VALUE._col0)
+                mode: mergepartial
+                outputColumnNames: _col0
+                Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
+                File Output Operator
+                  compressed: false
+                  Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
+                  table:
+                      input format: org.apache.hadoop.mapred.TextInputFormat
+                      output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+        Union 2 
+            Vertex: Union 2
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        ListSink
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-1
+    Tez
+      Edges:
+        Map 1 <- Union 2 (CONTAINS)
+        Map 4 <- Union 2 (CONTAINS)
+        Map 5 <- Union 2 (CONTAINS)
+        Reducer 3 <- Union 2 (SIMPLE_EDGE)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: src_union_1
+                  filterExpr: (ds = '2') (type: boolean)
+                  Filter Operator
+                    predicate: (ds = '2') (type: boolean)
+                    Select Operator
+                      Select Operator
+                        Group By Operator
+                          aggregations: count(1)
+                          mode: hash
+                          outputColumnNames: _col0
+                          Reduce Output Operator
+                            sort order: 
+                            value expressions: _col0 (type: bigint)
+        Map 4 
+            Map Operator Tree:
+                TableScan
+                  alias: src_union_2
+                  filterExpr: (ds = '2') (type: boolean)
+                  Select Operator
+                    Select Operator
+                      Group By Operator
+                        aggregations: count(1)
+                        mode: hash
+                        outputColumnNames: _col0
+                        Reduce Output Operator
+                          sort order: 
+                          value expressions: _col0 (type: bigint)
+        Map 5 
+            Map Operator Tree:
+                TableScan
+                  alias: src_union_3
+                  filterExpr: (ds = '2') (type: boolean)
+                  Filter Operator
+                    predicate: (ds = '2') (type: boolean)
+                    Select Operator
+                      Select Operator
+                        Group By Operator
+                          aggregations: count(1)
+                          mode: hash
+                          outputColumnNames: _col0
+                          Reduce Output Operator
+                            sort order: 
+                            value expressions: _col0 (type: bigint)
+        Reducer 3 
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: count(VALUE._col0)
+                mode: mergepartial
+                outputColumnNames: _col0
+                Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
+                File Output Operator
+                  compressed: false
+                  Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
+                  table:
+                      input format: org.apache.hadoop.mapred.TextInputFormat
+                      output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+        Union 2 
+            Vertex: Union 2
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        ListSink
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-1
+    Tez
+      Edges:
+        Map 1 <- Union 2 (CONTAINS)
+        Map 4 <- Union 2 (CONTAINS)
+        Map 5 <- Union 2 (CONTAINS)
+        Reducer 3 <- Union 2 (SIMPLE_EDGE)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: src_union_1
+                  filterExpr: (ds = '3') (type: boolean)
+                  Filter Operator
+                    predicate: (ds = '3') (type: boolean)
+                    Select Operator
+                      Select Operator
+                        Group By Operator
+                          aggregations: count(1)
+                          mode: hash
+                          outputColumnNames: _col0
+                          Reduce Output Operator
+                            sort order: 
+                            value expressions: _col0 (type: bigint)
+        Map 4 
+            Map Operator Tree:
+                TableScan
+                  alias: src_union_2
+                  filterExpr: (ds = '3') (type: boolean)
+                  Filter Operator
+                    predicate: (ds = '3') (type: boolean)
+                    Select Operator
+                      Select Operator
+                        Group By Operator
+                          aggregations: count(1)
+                          mode: hash
+                          outputColumnNames: _col0
+                          Reduce Output Operator
+                            sort order: 
+                            value expressions: _col0 (type: bigint)
+        Map 5 
+            Map Operator Tree:
+                TableScan
+                  alias: src_union_3
+                  filterExpr: (ds = '3') (type: boolean)
+                  Select Operator
+                    Select Operator
+                      Group By Operator
+                        aggregations: count(1)
+                        mode: hash
+                        outputColumnNames: _col0
+                        Reduce Output Operator
+                          sort order: 
+                          value expressions: _col0 (type: bigint)
+        Reducer 3 
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: count(VALUE._col0)
+                mode: mergepartial
+                outputColumnNames: _col0
+                Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
+                File Output Operator
+                  compressed: false
+                  Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
+                  table:
+                      input format: org.apache.hadoop.mapred.TextInputFormat
+                      output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+        Union 2 
+            Vertex: Union 2
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        ListSink
+
+500
+1000
+1000
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-1
+    Tez
+      Edges:
+        Map 1 <- Union 2 (CONTAINS)
+        Map 3 <- Union 2 (CONTAINS)
+        Map 4 <- Union 2 (CONTAINS)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: src_union_1
+                  filterExpr: ((key = 86) and (ds = '4')) (type: boolean)
+                  Filter Operator
+                    predicate: ((key = 86) and (ds = '4')) (type: boolean)
+                    Select Operator
+                      expressions: value (type: string)
+                      outputColumnNames: _col1
+                      Select Operator
+                        expressions: 86 (type: int), _col1 (type: string), '4' 
(type: string)
+                        outputColumnNames: _col0, _col1, _col2
+                        File Output Operator
+                          compressed: false
+                          table:
+                              input format: 
org.apache.hadoop.mapred.TextInputFormat
+                              output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                              serde: 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+        Map 3 
+            Map Operator Tree:
+                TableScan
+                  alias: src_union_2
+                  filterExpr: ((key = 86) and (ds = '4')) (type: boolean)
+                  Filter Operator
+                    predicate: ((key = 86) and (ds = '4')) (type: boolean)
+                    Select Operator
+                      expressions: value (type: string)
+                      outputColumnNames: _col1
+                      Select Operator
+                        expressions: 86 (type: int), _col1 (type: string), '4' 
(type: string)
+                        outputColumnNames: _col0, _col1, _col2
+                        File Output Operator
+                          compressed: false
+                          table:
+                              input format: 
org.apache.hadoop.mapred.TextInputFormat
+                              output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                              serde: 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+        Map 4 
+            Map Operator Tree:
+                TableScan
+                  alias: src_union_3
+                  filterExpr: ((key = 86) and (ds = '4')) (type: boolean)
+                  Filter Operator
+                    predicate: (key = 86) (type: boolean)
+                    Select Operator
+                      expressions: value (type: string)
+                      outputColumnNames: _col1
+                      Select Operator
+                        expressions: 86 (type: int), _col1 (type: string), '4' 
(type: string)
+                        outputColumnNames: _col0, _col1, _col2
+                        File Output Operator
+                          compressed: false
+                          table:
+                              input format: 
org.apache.hadoop.mapred.TextInputFormat
+                              output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                              serde: 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+        Union 2 
+            Vertex: Union 2
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        ListSink
+
+86     val_86  4
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-1
+    Tez
+      Edges:
+        Map 1 <- Union 2 (CONTAINS)
+        Map 4 <- Union 2 (CONTAINS)
+        Map 5 <- Union 2 (CONTAINS)
+        Reducer 3 <- Union 2 (SIMPLE_EDGE)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: src_union_1
+                  filterExpr: (ds = '4') (type: boolean)
+                  Filter Operator
+                    predicate: (ds = '4') (type: boolean)
+                    Select Operator
+                      Select Operator
+                        Group By Operator
+                          aggregations: count(1)
+                          mode: hash
+                          outputColumnNames: _col0
+                          Reduce Output Operator
+                            sort order: 
+                            value expressions: _col0 (type: bigint)
+        Map 4 
+            Map Operator Tree:
+                TableScan
+                  alias: src_union_2
+                  filterExpr: (ds = '4') (type: boolean)
+                  Filter Operator
+                    predicate: (ds = '4') (type: boolean)
+                    Select Operator
+                      Select Operator
+                        Group By Operator
+                          aggregations: count(1)
+                          mode: hash
+                          outputColumnNames: _col0
+                          Reduce Output Operator
+                            sort order: 
+                            value expressions: _col0 (type: bigint)
+        Map 5 
+            Map Operator Tree:
+                TableScan
+                  alias: src_union_3
+                  filterExpr: (ds = '4') (type: boolean)
+                  Select Operator
+                    Select Operator
+                      Group By Operator
+                        aggregations: count(1)
+                        mode: hash
+                        outputColumnNames: _col0
+                        Reduce Output Operator
+                          sort order: 
+                          value expressions: _col0 (type: bigint)
+        Reducer 3 
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: count(VALUE._col0)
+                mode: mergepartial
+                outputColumnNames: _col0
+                Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
+                File Output Operator
+                  compressed: false
+                  Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
+                  table:
+                      input format: org.apache.hadoop.mapred.TextInputFormat
+                      output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+        Union 2 
+            Vertex: Union 2
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        ListSink
+
+500

Reply via email to