You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by vg...@apache.org on 2018/08/06 17:27:08 UTC

[4/7] hive git commit: HIVE-20292: Bad join ordering in tpcds query93 with primary constraint defined (Vineet Garg, reviewed by Ashutosh Chauhan)

http://git-wip-us.apache.org/repos/asf/hive/blob/30c17911/ql/src/test/results/clientpositive/mapjoin_subquery2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/mapjoin_subquery2.q.out b/ql/src/test/results/clientpositive/mapjoin_subquery2.q.out
index 50e7ce0..89aac8f 100644
--- a/ql/src/test/results/clientpositive/mapjoin_subquery2.q.out
+++ b/ql/src/test/results/clientpositive/mapjoin_subquery2.q.out
@@ -79,22 +79,22 @@ FROM
  JOIN z ON (subq.key1 = z.id)
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
-  Stage-7 is a root stage
-  Stage-5 depends on stages: Stage-7
-  Stage-0 depends on stages: Stage-5
+  Stage-5 is a root stage
+  Stage-4 depends on stages: Stage-5
+  Stage-0 depends on stages: Stage-4
 
 STAGE PLANS:
-  Stage: Stage-7
+  Stage: Stage-5
     Map Reduce Local Work
       Alias -> Map Local Tables:
-        $hdt$_0:$hdt$_0:y 
+        $hdt$_0:y 
           Fetch Operator
             limit: -1
-        $hdt$_1:z 
+        $hdt$_2:z 
           Fetch Operator
             limit: -1
       Alias -> Map Local Operator Tree:
-        $hdt$_0:$hdt$_0:y 
+        $hdt$_0:y 
           TableScan
             alias: y
             filterExpr: id is not null (type: boolean)
@@ -110,7 +110,8 @@ STAGE PLANS:
                   keys:
                     0 _col0 (type: int)
                     1 _col1 (type: int)
-        $hdt$_1:z 
+                    2 _col0 (type: int)
+        $hdt$_2:z 
           TableScan
             alias: z
             filterExpr: id is not null (type: boolean)
@@ -125,9 +126,10 @@ STAGE PLANS:
                 HashTable Sink Operator
                   keys:
                     0 _col0 (type: int)
-                    1 _col0 (type: int)
+                    1 _col1 (type: int)
+                    2 _col0 (type: int)
 
-  Stage: Stage-5
+  Stage: Stage-4
     Map Reduce
       Map Operator Tree:
           TableScan
@@ -144,30 +146,24 @@ STAGE PLANS:
                 Map Join Operator
                   condition map:
                        Inner Join 0 to 1
+                       Inner Join 1 to 2
                   keys:
                     0 _col0 (type: int)
                     1 _col1 (type: int)
-                  outputColumnNames: _col0, _col1, _col2, _col3
-                  Statistics: Num rows: 1 Data size: 66 Basic stats: COMPLETE Column stats: NONE
+                    2 _col0 (type: int)
+                  outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
+                  Statistics: Num rows: 2 Data size: 132 Basic stats: COMPLETE Column stats: NONE
                   Select Operator
-                    expressions: _col3 (type: int), _col2 (type: string), _col0 (type: int), _col1 (type: string)
-                    outputColumnNames: _col0, _col1, _col2, _col3
-                    Statistics: Num rows: 1 Data size: 66 Basic stats: COMPLETE Column stats: NONE
-                    Map Join Operator
-                      condition map:
-                           Inner Join 0 to 1
-                      keys:
-                        0 _col0 (type: int)
-                        1 _col0 (type: int)
-                      outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
-                      Statistics: Num rows: 1 Data size: 72 Basic stats: COMPLETE Column stats: NONE
-                      File Output Operator
-                        compressed: false
-                        Statistics: Num rows: 1 Data size: 72 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
+                    expressions: _col3 (type: int), _col2 (type: string), _col0 (type: int), _col1 (type: string), _col4 (type: int), _col5 (type: string)
+                    outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
+                    Statistics: Num rows: 2 Data size: 132 Basic stats: COMPLETE Column stats: NONE
+                    File Output Operator
+                      compressed: false
+                      Statistics: Num rows: 2 Data size: 132 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
       Execution mode: vectorized
       Local Work:
         Map Reduce Local Work

http://git-wip-us.apache.org/repos/asf/hive/blob/30c17911/ql/src/test/results/clientpositive/perf/spark/query2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query2.q.out b/ql/src/test/results/clientpositive/perf/spark/query2.q.out
index 105f2ee..f615661 100644
--- a/ql/src/test/results/clientpositive/perf/spark/query2.q.out
+++ b/ql/src/test/results/clientpositive/perf/spark/query2.q.out
@@ -124,14 +124,13 @@ STAGE PLANS:
   Stage: Stage-1
     Spark
       Edges:
-        Reducer 11 <- Map 10 (PARTITION-LEVEL SORT, 459), Map 14 (PARTITION-LEVEL SORT, 459), Map 15 (PARTITION-LEVEL SORT, 459)
-        Reducer 12 <- Reducer 11 (GROUP, 504)
-        Reducer 13 <- Map 16 (PARTITION-LEVEL SORT, 253), Reducer 12 (PARTITION-LEVEL SORT, 253)
-        Reducer 2 <- Map 1 (PARTITION-LEVEL SORT, 459), Map 7 (PARTITION-LEVEL SORT, 459), Map 8 (PARTITION-LEVEL SORT, 459)
+        Reducer 10 <- Map 13 (PARTITION-LEVEL SORT, 459), Map 14 (PARTITION-LEVEL SORT, 459), Map 9 (PARTITION-LEVEL SORT, 459)
+        Reducer 11 <- Reducer 10 (GROUP, 504)
+        Reducer 12 <- Map 15 (PARTITION-LEVEL SORT, 253), Reducer 11 (PARTITION-LEVEL SORT, 253)
+        Reducer 2 <- Map 1 (PARTITION-LEVEL SORT, 459), Map 6 (PARTITION-LEVEL SORT, 459), Map 7 (PARTITION-LEVEL SORT, 459)
         Reducer 3 <- Reducer 2 (GROUP, 504)
-        Reducer 4 <- Map 9 (PARTITION-LEVEL SORT, 253), Reducer 3 (PARTITION-LEVEL SORT, 253)
-        Reducer 5 <- Reducer 13 (PARTITION-LEVEL SORT, 554), Reducer 4 (PARTITION-LEVEL SORT, 554)
-        Reducer 6 <- Reducer 5 (SORT, 1)
+        Reducer 4 <- Map 8 (PARTITION-LEVEL SORT, 529), Reducer 12 (PARTITION-LEVEL SORT, 529), Reducer 3 (PARTITION-LEVEL SORT, 529)
+        Reducer 5 <- Reducer 4 (SORT, 1)
 #### A masked pattern was here ####
       Vertices:
         Map 1 
@@ -154,27 +153,7 @@ STAGE PLANS:
                         Statistics: Num rows: 431992504 Data size: 58579807164 Basic stats: COMPLETE Column stats: NONE
                         value expressions: _col1 (type: decimal(7,2))
             Execution mode: vectorized
-        Map 10 
-            Map Operator Tree:
-                TableScan
-                  alias: web_sales
-                  filterExpr: ws_sold_date_sk is not null (type: boolean)
-                  Statistics: Num rows: 144002668 Data size: 19580198212 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: ws_sold_date_sk is not null (type: boolean)
-                    Statistics: Num rows: 144002668 Data size: 19580198212 Basic stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: ws_sold_date_sk (type: int), ws_ext_sales_price (type: decimal(7,2))
-                      outputColumnNames: _col0, _col1
-                      Statistics: Num rows: 144002668 Data size: 19580198212 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: _col0 (type: int)
-                        sort order: +
-                        Map-reduce partition columns: _col0 (type: int)
-                        Statistics: Num rows: 431992504 Data size: 58579807164 Basic stats: COMPLETE Column stats: NONE
-                        value expressions: _col1 (type: decimal(7,2))
-            Execution mode: vectorized
-        Map 14 
+        Map 13 
             Map Operator Tree:
                 TableScan
                   alias: catalog_sales
@@ -194,7 +173,7 @@ STAGE PLANS:
                         Statistics: Num rows: 431992504 Data size: 58579807164 Basic stats: COMPLETE Column stats: NONE
                         value expressions: _col1 (type: decimal(7,2))
             Execution mode: vectorized
-        Map 15 
+        Map 14 
             Map Operator Tree:
                 TableScan
                   alias: date_dim
@@ -214,7 +193,7 @@ STAGE PLANS:
                         Statistics: Num rows: 73049 Data size: 81741831 Basic stats: COMPLETE Column stats: NONE
                         value expressions: _col1 (type: int), _col2 (type: string)
             Execution mode: vectorized
-        Map 16 
+        Map 15 
             Map Operator Tree:
                 TableScan
                   alias: date_dim
@@ -233,7 +212,7 @@ STAGE PLANS:
                         Map-reduce partition columns: _col0 (type: int)
                         Statistics: Num rows: 36524 Data size: 40870356 Basic stats: COMPLETE Column stats: NONE
             Execution mode: vectorized
-        Map 7 
+        Map 6 
             Map Operator Tree:
                 TableScan
                   alias: catalog_sales
@@ -253,7 +232,7 @@ STAGE PLANS:
                         Statistics: Num rows: 431992504 Data size: 58579807164 Basic stats: COMPLETE Column stats: NONE
                         value expressions: _col1 (type: decimal(7,2))
             Execution mode: vectorized
-        Map 8 
+        Map 7 
             Map Operator Tree:
                 TableScan
                   alias: date_dim
@@ -273,7 +252,7 @@ STAGE PLANS:
                         Statistics: Num rows: 73049 Data size: 81741831 Basic stats: COMPLETE Column stats: NONE
                         value expressions: _col1 (type: int), _col2 (type: string)
             Execution mode: vectorized
-        Map 9 
+        Map 8 
             Map Operator Tree:
                 TableScan
                   alias: date_dim
@@ -292,7 +271,27 @@ STAGE PLANS:
                         Map-reduce partition columns: _col0 (type: int)
                         Statistics: Num rows: 36524 Data size: 40870356 Basic stats: COMPLETE Column stats: NONE
             Execution mode: vectorized
-        Reducer 11 
+        Map 9 
+            Map Operator Tree:
+                TableScan
+                  alias: web_sales
+                  filterExpr: ws_sold_date_sk is not null (type: boolean)
+                  Statistics: Num rows: 144002668 Data size: 19580198212 Basic stats: COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: ws_sold_date_sk is not null (type: boolean)
+                    Statistics: Num rows: 144002668 Data size: 19580198212 Basic stats: COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: ws_sold_date_sk (type: int), ws_ext_sales_price (type: decimal(7,2))
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 144002668 Data size: 19580198212 Basic stats: COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: int)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: int)
+                        Statistics: Num rows: 431992504 Data size: 58579807164 Basic stats: COMPLETE Column stats: NONE
+                        value expressions: _col1 (type: decimal(7,2))
+            Execution mode: vectorized
+        Reducer 10 
             Reduce Operator Tree:
               Join Operator
                 condition map:
@@ -318,7 +317,7 @@ STAGE PLANS:
                       Map-reduce partition columns: _col0 (type: int)
                       Statistics: Num rows: 475191764 Data size: 64437789277 Basic stats: COMPLETE Column stats: NONE
                       value expressions: _col1 (type: decimal(17,2)), _col2 (type: decimal(17,2)), _col3 (type: decimal(17,2)), _col4 (type: decimal(17,2)), _col5 (type: decimal(17,2)), _col6 (type: decimal(17,2)), _col7 (type: decimal(17,2))
-        Reducer 12 
+        Reducer 11 
             Execution mode: vectorized
             Reduce Operator Tree:
               Group By Operator
@@ -333,7 +332,7 @@ STAGE PLANS:
                   Map-reduce partition columns: _col0 (type: int)
                   Statistics: Num rows: 237595882 Data size: 32218894638 Basic stats: COMPLETE Column stats: NONE
                   value expressions: _col1 (type: decimal(17,2)), _col2 (type: decimal(17,2)), _col3 (type: decimal(17,2)), _col4 (type: decimal(17,2)), _col5 (type: decimal(17,2)), _col6 (type: decimal(17,2)), _col7 (type: decimal(17,2))
-        Reducer 13 
+        Reducer 12 
             Reduce Operator Tree:
               Join Operator
                 condition map:
@@ -395,46 +394,32 @@ STAGE PLANS:
               Join Operator
                 condition map:
                      Inner Join 0 to 1
+                     Inner Join 0 to 2
                 keys:
                   0 _col0 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7
-                Statistics: Num rows: 261355475 Data size: 35440784869 Basic stats: COMPLETE Column stats: NONE
-                Reduce Output Operator
-                  key expressions: _col0 (type: int)
-                  sort order: +
-                  Map-reduce partition columns: _col0 (type: int)
-                  Statistics: Num rows: 261355475 Data size: 35440784869 Basic stats: COMPLETE Column stats: NONE
-                  value expressions: _col1 (type: decimal(17,2)), _col2 (type: decimal(17,2)), _col3 (type: decimal(17,2)), _col4 (type: decimal(17,2)), _col5 (type: decimal(17,2)), _col6 (type: decimal(17,2)), _col7 (type: decimal(17,2))
-        Reducer 5 
-            Reduce Operator Tree:
-              Join Operator
-                condition map:
-                     Inner Join 0 to 1
-                keys:
-                  0 _col0 (type: int)
-                  1 (_col0 - 53) (type: int)
-                outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col9, _col10, _col11, _col12, _col13, _col14, _col15
-                Statistics: Num rows: 287491028 Data size: 38984864200 Basic stats: COMPLETE Column stats: NONE
+                  2 (_col0 - 53) (type: int)
+                outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col11, _col12, _col13, _col14, _col15, _col16, _col17
+                Statistics: Num rows: 574982057 Data size: 77969728401 Basic stats: COMPLETE Column stats: NONE
                 Select Operator
-                  expressions: _col0 (type: int), round((_col1 / _col9), 2) (type: decimal(20,2)), round((_col2 / _col10), 2) (type: decimal(20,2)), round((_col3 / _col11), 2) (type: decimal(20,2)), round((_col4 / _col12), 2) (type: decimal(20,2)), round((_col5 / _col13), 2) (type: decimal(20,2)), round((_col6 / _col14), 2) (type: decimal(20,2)), round((_col7 / _col15), 2) (type: decimal(20,2))
+                  expressions: _col0 (type: int), round((_col1 / _col11), 2) (type: decimal(20,2)), round((_col2 / _col12), 2) (type: decimal(20,2)), round((_col3 / _col13), 2) (type: decimal(20,2)), round((_col4 / _col14), 2) (type: decimal(20,2)), round((_col5 / _col15), 2) (type: decimal(20,2)), round((_col6 / _col16), 2) (type: decimal(20,2)), round((_col7 / _col17), 2) (type: decimal(20,2))
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7
-                  Statistics: Num rows: 287491028 Data size: 38984864200 Basic stats: COMPLETE Column stats: NONE
+                  Statistics: Num rows: 574982057 Data size: 77969728401 Basic stats: COMPLETE Column stats: NONE
                   Reduce Output Operator
                     key expressions: _col0 (type: int)
                     sort order: +
-                    Statistics: Num rows: 287491028 Data size: 38984864200 Basic stats: COMPLETE Column stats: NONE
+                    Statistics: Num rows: 574982057 Data size: 77969728401 Basic stats: COMPLETE Column stats: NONE
                     value expressions: _col1 (type: decimal(20,2)), _col2 (type: decimal(20,2)), _col3 (type: decimal(20,2)), _col4 (type: decimal(20,2)), _col5 (type: decimal(20,2)), _col6 (type: decimal(20,2)), _col7 (type: decimal(20,2))
-        Reducer 6 
+        Reducer 5 
             Execution mode: vectorized
             Reduce Operator Tree:
               Select Operator
                 expressions: KEY.reducesinkkey0 (type: int), VALUE._col0 (type: decimal(20,2)), VALUE._col1 (type: decimal(20,2)), VALUE._col2 (type: decimal(20,2)), VALUE._col3 (type: decimal(20,2)), VALUE._col4 (type: decimal(20,2)), VALUE._col5 (type: decimal(20,2)), VALUE._col6 (type: decimal(20,2))
                 outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7
-                Statistics: Num rows: 287491028 Data size: 38984864200 Basic stats: COMPLETE Column stats: NONE
+                Statistics: Num rows: 574982057 Data size: 77969728401 Basic stats: COMPLETE Column stats: NONE
                 File Output Operator
                   compressed: false
-                  Statistics: Num rows: 287491028 Data size: 38984864200 Basic stats: COMPLETE Column stats: NONE
+                  Statistics: Num rows: 574982057 Data size: 77969728401 Basic stats: COMPLETE Column stats: NONE
                   table:
                       input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                       output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat

http://git-wip-us.apache.org/repos/asf/hive/blob/30c17911/ql/src/test/results/clientpositive/perf/spark/query59.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query59.q.out b/ql/src/test/results/clientpositive/perf/spark/query59.q.out
index 73ea161..1224ab6 100644
--- a/ql/src/test/results/clientpositive/perf/spark/query59.q.out
+++ b/ql/src/test/results/clientpositive/perf/spark/query59.q.out
@@ -408,28 +408,24 @@ STAGE PLANS:
                   input vertices:
                     1 Map 9
                   Statistics: Num rows: 383325119 Data size: 33817053337 Basic stats: COMPLETE Column stats: NONE
-                  Select Operator
-                    expressions: _col13 (type: string), _col0 (type: int), _col12 (type: string), _col2 (type: decimal(17,2)), _col3 (type: decimal(17,2)), _col4 (type: decimal(17,2)), _col5 (type: decimal(17,2)), _col6 (type: decimal(17,2)), _col7 (type: decimal(17,2)), _col8 (type: decimal(17,2))
-                    outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9
+                  Reduce Output Operator
+                    key expressions: _col12 (type: string), _col0 (type: int)
+                    sort order: ++
+                    Map-reduce partition columns: _col12 (type: string), _col0 (type: int)
                     Statistics: Num rows: 383325119 Data size: 33817053337 Basic stats: COMPLETE Column stats: NONE
-                    Reduce Output Operator
-                      key expressions: _col2 (type: string), _col1 (type: int)
-                      sort order: ++
-                      Map-reduce partition columns: _col2 (type: string), _col1 (type: int)
-                      Statistics: Num rows: 383325119 Data size: 33817053337 Basic stats: COMPLETE Column stats: NONE
-                      value expressions: _col0 (type: string), _col3 (type: decimal(17,2)), _col4 (type: decimal(17,2)), _col5 (type: decimal(17,2)), _col6 (type: decimal(17,2)), _col7 (type: decimal(17,2)), _col8 (type: decimal(17,2)), _col9 (type: decimal(17,2))
+                    value expressions: _col2 (type: decimal(17,2)), _col3 (type: decimal(17,2)), _col4 (type: decimal(17,2)), _col5 (type: decimal(17,2)), _col6 (type: decimal(17,2)), _col7 (type: decimal(17,2)), _col8 (type: decimal(17,2)), _col13 (type: string)
         Reducer 5 
             Reduce Operator Tree:
               Join Operator
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 _col2 (type: string), _col1 (type: int)
+                  0 _col12 (type: string), _col0 (type: int)
                   1 _col1 (type: string), (_col0 - 52) (type: int)
-                outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col12, _col13, _col14, _col15, _col16, _col17
+                outputColumnNames: _col0, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col12, _col13, _col16, _col17, _col18, _col19, _col20, _col21
                 Statistics: Num rows: 421657640 Data size: 37198759476 Basic stats: COMPLETE Column stats: NONE
                 Select Operator
-                  expressions: _col0 (type: string), _col2 (type: string), _col1 (type: int), (_col3 / _col12) (type: decimal(37,20)), (_col4 / _col13) (type: decimal(37,20)), (_col5 / _col5) (type: decimal(37,20)), (_col6 / _col14) (type: decimal(37,20)), (_col7 / _col15) (type: decimal(37,20)), (_col8 / _col16) (type: decimal(37,20)), (_col9 / _col17) (type: decimal(37,20))
+                  expressions: _col13 (type: string), _col12 (type: string), _col0 (type: int), (_col2 / _col16) (type: decimal(37,20)), (_col3 / _col17) (type: decimal(37,20)), (_col4 / _col4) (type: decimal(37,20)), (_col5 / _col18) (type: decimal(37,20)), (_col6 / _col19) (type: decimal(37,20)), (_col7 / _col20) (type: decimal(37,20)), (_col8 / _col21) (type: decimal(37,20))
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9
                   Statistics: Num rows: 421657640 Data size: 37198759476 Basic stats: COMPLETE Column stats: NONE
                   Reduce Output Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/30c17911/ql/src/test/results/clientpositive/perf/spark/query95.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query95.q.out b/ql/src/test/results/clientpositive/perf/spark/query95.q.out
index 1463671..69dcfab 100644
--- a/ql/src/test/results/clientpositive/perf/spark/query95.q.out
+++ b/ql/src/test/results/clientpositive/perf/spark/query95.q.out
@@ -255,12 +255,12 @@ STAGE PLANS:
                     Statistics: Num rows: 14398467 Data size: 1325194184 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: wr_order_number (type: int)
-                      outputColumnNames: _col0
+                      outputColumnNames: _col13
                       Statistics: Num rows: 14398467 Data size: 1325194184 Basic stats: COMPLETE Column stats: NONE
                       Reduce Output Operator
-                        key expressions: _col0 (type: int)
+                        key expressions: _col13 (type: int)
                         sort order: +
-                        Map-reduce partition columns: _col0 (type: int)
+                        Map-reduce partition columns: _col13 (type: int)
                         Statistics: Num rows: 14398467 Data size: 1325194184 Basic stats: COMPLETE Column stats: NONE
             Execution mode: vectorized
         Map 8 
@@ -351,11 +351,11 @@ STAGE PLANS:
                      Inner Join 0 to 1
                 keys:
                   0 _col0 (type: int)
-                  1 _col0 (type: int)
-                outputColumnNames: _col1
+                  1 _col13 (type: int)
+                outputColumnNames: _col14
                 Statistics: Num rows: 174243235 Data size: 23692040863 Basic stats: COMPLETE Column stats: NONE
                 Group By Operator
-                  keys: _col1 (type: int)
+                  keys: _col14 (type: int)
                   mode: hash
                   outputColumnNames: _col0
                   Statistics: Num rows: 174243235 Data size: 23692040863 Basic stats: COMPLETE Column stats: NONE

http://git-wip-us.apache.org/repos/asf/hive/blob/30c17911/ql/src/test/results/clientpositive/perf/tez/query2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/query2.q.out b/ql/src/test/results/clientpositive/perf/tez/query2.q.out
index 5f90894..e2021f9 100644
--- a/ql/src/test/results/clientpositive/perf/tez/query2.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/query2.q.out
@@ -119,167 +119,161 @@ POSTHOOK: type: QUERY
 Plan optimized by CBO.
 
 Vertex dependency in root stage
-Map 1 <- Reducer 10 (BROADCAST_EDGE), Union 2 (CONTAINS)
-Map 16 <- Reducer 14 (BROADCAST_EDGE), Union 17 (CONTAINS)
-Map 18 <- Reducer 14 (BROADCAST_EDGE), Union 17 (CONTAINS)
-Map 8 <- Reducer 10 (BROADCAST_EDGE), Union 2 (CONTAINS)
-Reducer 10 <- Map 9 (CUSTOM_SIMPLE_EDGE)
-Reducer 11 <- Map 9 (SIMPLE_EDGE), Union 17 (SIMPLE_EDGE)
-Reducer 12 <- Reducer 11 (SIMPLE_EDGE)
-Reducer 13 <- Map 15 (SIMPLE_EDGE), Reducer 12 (ONE_TO_ONE_EDGE)
-Reducer 14 <- Map 9 (CUSTOM_SIMPLE_EDGE)
-Reducer 3 <- Map 9 (SIMPLE_EDGE), Union 2 (SIMPLE_EDGE)
+Map 1 <- Reducer 9 (BROADCAST_EDGE), Union 2 (CONTAINS)
+Map 15 <- Reducer 13 (BROADCAST_EDGE), Union 16 (CONTAINS)
+Map 17 <- Reducer 13 (BROADCAST_EDGE), Union 16 (CONTAINS)
+Map 7 <- Reducer 9 (BROADCAST_EDGE), Union 2 (CONTAINS)
+Reducer 10 <- Map 8 (SIMPLE_EDGE), Union 16 (SIMPLE_EDGE)
+Reducer 11 <- Reducer 10 (SIMPLE_EDGE)
+Reducer 12 <- Map 14 (SIMPLE_EDGE), Reducer 11 (ONE_TO_ONE_EDGE)
+Reducer 13 <- Map 8 (CUSTOM_SIMPLE_EDGE)
+Reducer 3 <- Map 8 (SIMPLE_EDGE), Union 2 (SIMPLE_EDGE)
 Reducer 4 <- Reducer 3 (SIMPLE_EDGE)
-Reducer 5 <- Map 15 (SIMPLE_EDGE), Reducer 4 (ONE_TO_ONE_EDGE)
-Reducer 6 <- Reducer 13 (SIMPLE_EDGE), Reducer 5 (ONE_TO_ONE_EDGE)
-Reducer 7 <- Reducer 6 (SIMPLE_EDGE)
+Reducer 5 <- Map 14 (SIMPLE_EDGE), Reducer 12 (SIMPLE_EDGE), Reducer 4 (ONE_TO_ONE_EDGE)
+Reducer 6 <- Reducer 5 (SIMPLE_EDGE)
+Reducer 9 <- Map 8 (CUSTOM_SIMPLE_EDGE)
 
 Stage-0
   Fetch Operator
     limit:-1
     Stage-1
-      Reducer 7 vectorized
-      File Output Operator [FS_195]
-        Select Operator [SEL_194] (rows=287491028 width=135)
+      Reducer 6 vectorized
+      File Output Operator [FS_189]
+        Select Operator [SEL_188] (rows=574982057 width=135)
           Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
-        <-Reducer 6 [SIMPLE_EDGE]
-          SHUFFLE [RS_58]
-            Select Operator [SEL_57] (rows=287491028 width=135)
+        <-Reducer 5 [SIMPLE_EDGE]
+          SHUFFLE [RS_55]
+            Select Operator [SEL_54] (rows=574982057 width=135)
               Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
-              Merge Join Operator [MERGEJOIN_147] (rows=287491028 width=135)
-                Conds:RS_54._col0=RS_55.(_col0 - 53)(Inner),Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col9","_col10","_col11","_col12","_col13","_col14","_col15"]
-              <-Reducer 13 [SIMPLE_EDGE]
-                SHUFFLE [RS_55]
+              Merge Join Operator [MERGEJOIN_141] (rows=574982057 width=135)
+                Conds:RS_179._col0=RS_186._col0(Inner),RS_179._col0=RS_52.(_col0 - 53)(Inner),Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col11","_col12","_col13","_col14","_col15","_col16","_col17"]
+              <-Map 14 [SIMPLE_EDGE] vectorized
+                SHUFFLE [RS_186]
+                  PartitionCols:_col0
+                  Select Operator [SEL_184] (rows=36524 width=1119)
+                    Output:["_col0"]
+                    Filter Operator [FIL_182] (rows=36524 width=1119)
+                      predicate:((d_year = 2001) and d_week_seq is not null)
+                      TableScan [TS_20] (rows=73049 width=1119)
+                        default@date_dim,date_dim,Tbl:COMPLETE,Col:NONE,Output:["d_week_seq","d_year"]
+              <-Reducer 12 [SIMPLE_EDGE]
+                SHUFFLE [RS_52]
                   PartitionCols:(_col0 - 53)
-                  Merge Join Operator [MERGEJOIN_146] (rows=261355475 width=135)
-                    Conds:RS_193._col0=RS_191._col0(Inner),Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
-                  <-Map 15 [SIMPLE_EDGE] vectorized
-                    SHUFFLE [RS_191]
+                  Merge Join Operator [MERGEJOIN_140] (rows=261355475 width=135)
+                    Conds:RS_181._col0=RS_187._col0(Inner),Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
+                  <-Map 14 [SIMPLE_EDGE] vectorized
+                    SHUFFLE [RS_187]
                       PartitionCols:_col0
-                      Select Operator [SEL_189] (rows=36524 width=1119)
+                      Select Operator [SEL_185] (rows=36524 width=1119)
                         Output:["_col0"]
-                        Filter Operator [FIL_187] (rows=36524 width=1119)
+                        Filter Operator [FIL_183] (rows=36524 width=1119)
                           predicate:((d_year = 2002) and d_week_seq is not null)
-                          TableScan [TS_20] (rows=73049 width=1119)
-                            default@date_dim,date_dim,Tbl:COMPLETE,Col:NONE,Output:["d_week_seq","d_year"]
-                  <-Reducer 12 [ONE_TO_ONE_EDGE] vectorized
-                    FORWARD [RS_193]
+                           Please refer to the previous TableScan [TS_20]
+                  <-Reducer 11 [ONE_TO_ONE_EDGE] vectorized
+                    FORWARD [RS_181]
                       PartitionCols:_col0
-                      Group By Operator [GBY_192] (rows=237595882 width=135)
+                      Group By Operator [GBY_180] (rows=237595882 width=135)
                         Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)","sum(VALUE._col3)","sum(VALUE._col4)","sum(VALUE._col5)","sum(VALUE._col6)"],keys:KEY._col0
-                      <-Reducer 11 [SIMPLE_EDGE]
-                        SHUFFLE [RS_44]
+                      <-Reducer 10 [SIMPLE_EDGE]
+                        SHUFFLE [RS_40]
                           PartitionCols:_col0
-                          Group By Operator [GBY_43] (rows=475191764 width=135)
+                          Group By Operator [GBY_39] (rows=475191764 width=135)
                             Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(_col1)","sum(_col2)","sum(_col3)","sum(_col4)","sum(_col5)","sum(_col6)","sum(_col7)"],keys:_col0
-                            Select Operator [SEL_41] (rows=475191764 width=135)
+                            Select Operator [SEL_37] (rows=475191764 width=135)
                               Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
-                              Merge Join Operator [MERGEJOIN_145] (rows=475191764 width=135)
-                                Conds:Union 17._col0=RS_172._col0(Inner),Output:["_col1","_col3","_col4"]
-                              <-Map 9 [SIMPLE_EDGE] vectorized
-                                SHUFFLE [RS_172]
+                              Merge Join Operator [MERGEJOIN_139] (rows=475191764 width=135)
+                                Conds:Union 16._col0=RS_166._col0(Inner),Output:["_col1","_col3","_col4"]
+                              <-Map 8 [SIMPLE_EDGE] vectorized
+                                PARTITION_ONLY_SHUFFLE [RS_166]
                                   PartitionCols:_col0
-                                  Select Operator [SEL_169] (rows=73049 width=1119)
+                                  Select Operator [SEL_163] (rows=73049 width=1119)
                                     Output:["_col0","_col1","_col2"]
-                                    Filter Operator [FIL_168] (rows=73049 width=1119)
+                                    Filter Operator [FIL_162] (rows=73049 width=1119)
                                       predicate:(d_date_sk is not null and d_week_seq is not null)
                                       TableScan [TS_8] (rows=73049 width=1119)
                                         default@date_dim,date_dim,Tbl:COMPLETE,Col:NONE,Output:["d_date_sk","d_week_seq","d_day_name"]
-                              <-Union 17 [SIMPLE_EDGE]
-                                <-Map 16 [CONTAINS] vectorized
-                                  Reduce Output Operator [RS_204]
+                              <-Union 16 [SIMPLE_EDGE]
+                                <-Map 15 [CONTAINS] vectorized
+                                  Reduce Output Operator [RS_198]
                                     PartitionCols:_col0
-                                    Select Operator [SEL_203] (rows=144002668 width=135)
+                                    Select Operator [SEL_197] (rows=144002668 width=135)
                                       Output:["_col0","_col1"]
-                                      Filter Operator [FIL_202] (rows=144002668 width=135)
-                                        predicate:((ws_sold_date_sk BETWEEN DynamicValue(RS_39_date_dim_d_date_sk_min) AND DynamicValue(RS_39_date_dim_d_date_sk_max) and in_bloom_filter(ws_sold_date_sk, DynamicValue(RS_39_date_dim_d_date_sk_bloom_filter))) and ws_sold_date_sk is not null)
-                                        TableScan [TS_158] (rows=144002668 width=135)
+                                      Filter Operator [FIL_196] (rows=144002668 width=135)
+                                        predicate:((ws_sold_date_sk BETWEEN DynamicValue(RS_35_date_dim_d_date_sk_min) AND DynamicValue(RS_35_date_dim_d_date_sk_max) and in_bloom_filter(ws_sold_date_sk, DynamicValue(RS_35_date_dim_d_date_sk_bloom_filter))) and ws_sold_date_sk is not null)
+                                        TableScan [TS_152] (rows=144002668 width=135)
                                           Output:["ws_sold_date_sk","ws_ext_sales_price"]
-                                        <-Reducer 14 [BROADCAST_EDGE] vectorized
-                                          BROADCAST [RS_200]
-                                            Group By Operator [GBY_199] (rows=1 width=12)
+                                        <-Reducer 13 [BROADCAST_EDGE] vectorized
+                                          BROADCAST [RS_194]
+                                            Group By Operator [GBY_193] (rows=1 width=12)
                                               Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
-                                            <-Map 9 [CUSTOM_SIMPLE_EDGE] vectorized
-                                              SHUFFLE [RS_177]
-                                                Group By Operator [GBY_175] (rows=1 width=12)
+                                            <-Map 8 [CUSTOM_SIMPLE_EDGE] vectorized
+                                              PARTITION_ONLY_SHUFFLE [RS_171]
+                                                Group By Operator [GBY_169] (rows=1 width=12)
                                                   Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
-                                                  Select Operator [SEL_173] (rows=73049 width=1119)
+                                                  Select Operator [SEL_167] (rows=73049 width=1119)
                                                     Output:["_col0"]
-                                                     Please refer to the previous Select Operator [SEL_169]
-                                <-Map 18 [CONTAINS] vectorized
-                                  Reduce Output Operator [RS_207]
+                                                     Please refer to the previous Select Operator [SEL_163]
+                                <-Map 17 [CONTAINS] vectorized
+                                  Reduce Output Operator [RS_201]
                                     PartitionCols:_col0
-                                    Select Operator [SEL_206] (rows=287989836 width=135)
+                                    Select Operator [SEL_200] (rows=287989836 width=135)
                                       Output:["_col0","_col1"]
-                                      Filter Operator [FIL_205] (rows=287989836 width=135)
-                                        predicate:((cs_sold_date_sk BETWEEN DynamicValue(RS_39_date_dim_d_date_sk_min) AND DynamicValue(RS_39_date_dim_d_date_sk_max) and in_bloom_filter(cs_sold_date_sk, DynamicValue(RS_39_date_dim_d_date_sk_bloom_filter))) and cs_sold_date_sk is not null)
-                                        TableScan [TS_163] (rows=287989836 width=135)
+                                      Filter Operator [FIL_199] (rows=287989836 width=135)
+                                        predicate:((cs_sold_date_sk BETWEEN DynamicValue(RS_35_date_dim_d_date_sk_min) AND DynamicValue(RS_35_date_dim_d_date_sk_max) and in_bloom_filter(cs_sold_date_sk, DynamicValue(RS_35_date_dim_d_date_sk_bloom_filter))) and cs_sold_date_sk is not null)
+                                        TableScan [TS_157] (rows=287989836 width=135)
                                           Output:["cs_sold_date_sk","cs_ext_sales_price"]
-                                        <-Reducer 14 [BROADCAST_EDGE] vectorized
-                                          BROADCAST [RS_201]
-                                             Please refer to the previous Group By Operator [GBY_199]
-              <-Reducer 5 [ONE_TO_ONE_EDGE]
-                FORWARD [RS_54]
+                                        <-Reducer 13 [BROADCAST_EDGE] vectorized
+                                          BROADCAST [RS_195]
+                                             Please refer to the previous Group By Operator [GBY_193]
+              <-Reducer 4 [ONE_TO_ONE_EDGE] vectorized
+                FORWARD [RS_179]
                   PartitionCols:_col0
-                  Merge Join Operator [MERGEJOIN_144] (rows=261355475 width=135)
-                    Conds:RS_185._col0=RS_190._col0(Inner),Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
-                  <-Map 15 [SIMPLE_EDGE] vectorized
-                    SHUFFLE [RS_190]
-                      PartitionCols:_col0
-                      Select Operator [SEL_188] (rows=36524 width=1119)
-                        Output:["_col0"]
-                        Filter Operator [FIL_186] (rows=36524 width=1119)
-                          predicate:((d_year = 2001) and d_week_seq is not null)
-                           Please refer to the previous TableScan [TS_20]
-                  <-Reducer 4 [ONE_TO_ONE_EDGE] vectorized
-                    FORWARD [RS_185]
+                  Group By Operator [GBY_178] (rows=237595882 width=135)
+                    Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)","sum(VALUE._col3)","sum(VALUE._col4)","sum(VALUE._col5)","sum(VALUE._col6)"],keys:KEY._col0
+                  <-Reducer 3 [SIMPLE_EDGE]
+                    SHUFFLE [RS_17]
                       PartitionCols:_col0
-                      Group By Operator [GBY_184] (rows=237595882 width=135)
-                        Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)","sum(VALUE._col3)","sum(VALUE._col4)","sum(VALUE._col5)","sum(VALUE._col6)"],keys:KEY._col0
-                      <-Reducer 3 [SIMPLE_EDGE]
-                        SHUFFLE [RS_17]
-                          PartitionCols:_col0
-                          Group By Operator [GBY_16] (rows=475191764 width=135)
-                            Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(_col1)","sum(_col2)","sum(_col3)","sum(_col4)","sum(_col5)","sum(_col6)","sum(_col7)"],keys:_col0
-                            Select Operator [SEL_14] (rows=475191764 width=135)
-                              Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
-                              Merge Join Operator [MERGEJOIN_143] (rows=475191764 width=135)
-                                Conds:Union 2._col0=RS_170._col0(Inner),Output:["_col1","_col3","_col4"]
-                              <-Map 9 [SIMPLE_EDGE] vectorized
-                                SHUFFLE [RS_170]
-                                  PartitionCols:_col0
-                                   Please refer to the previous Select Operator [SEL_169]
-                              <-Union 2 [SIMPLE_EDGE]
-                                <-Map 1 [CONTAINS] vectorized
-                                  Reduce Output Operator [RS_183]
-                                    PartitionCols:_col0
-                                    Select Operator [SEL_182] (rows=144002668 width=135)
-                                      Output:["_col0","_col1"]
-                                      Filter Operator [FIL_181] (rows=144002668 width=135)
-                                        predicate:((ws_sold_date_sk BETWEEN DynamicValue(RS_12_date_dim_d_date_sk_min) AND DynamicValue(RS_12_date_dim_d_date_sk_max) and in_bloom_filter(ws_sold_date_sk, DynamicValue(RS_12_date_dim_d_date_sk_bloom_filter))) and ws_sold_date_sk is not null)
-                                        TableScan [TS_148] (rows=144002668 width=135)
-                                          Output:["ws_sold_date_sk","ws_ext_sales_price"]
-                                        <-Reducer 10 [BROADCAST_EDGE] vectorized
-                                          BROADCAST [RS_179]
-                                            Group By Operator [GBY_178] (rows=1 width=12)
-                                              Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
-                                            <-Map 9 [CUSTOM_SIMPLE_EDGE] vectorized
-                                              SHUFFLE [RS_176]
-                                                Group By Operator [GBY_174] (rows=1 width=12)
-                                                  Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
-                                                  Select Operator [SEL_171] (rows=73049 width=1119)
-                                                    Output:["_col0"]
-                                                     Please refer to the previous Select Operator [SEL_169]
-                                <-Map 8 [CONTAINS] vectorized
-                                  Reduce Output Operator [RS_198]
-                                    PartitionCols:_col0
-                                    Select Operator [SEL_197] (rows=287989836 width=135)
-                                      Output:["_col0","_col1"]
-                                      Filter Operator [FIL_196] (rows=287989836 width=135)
-                                        predicate:((cs_sold_date_sk BETWEEN DynamicValue(RS_12_date_dim_d_date_sk_min) AND DynamicValue(RS_12_date_dim_d_date_sk_max) and in_bloom_filter(cs_sold_date_sk, DynamicValue(RS_12_date_dim_d_date_sk_bloom_filter))) and cs_sold_date_sk is not null)
-                                        TableScan [TS_153] (rows=287989836 width=135)
-                                          Output:["cs_sold_date_sk","cs_ext_sales_price"]
-                                        <-Reducer 10 [BROADCAST_EDGE] vectorized
-                                          BROADCAST [RS_180]
-                                             Please refer to the previous Group By Operator [GBY_178]
+                      Group By Operator [GBY_16] (rows=475191764 width=135)
+                        Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(_col1)","sum(_col2)","sum(_col3)","sum(_col4)","sum(_col5)","sum(_col6)","sum(_col7)"],keys:_col0
+                        Select Operator [SEL_14] (rows=475191764 width=135)
+                          Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
+                          Merge Join Operator [MERGEJOIN_138] (rows=475191764 width=135)
+                            Conds:Union 2._col0=RS_164._col0(Inner),Output:["_col1","_col3","_col4"]
+                          <-Map 8 [SIMPLE_EDGE] vectorized
+                            PARTITION_ONLY_SHUFFLE [RS_164]
+                              PartitionCols:_col0
+                               Please refer to the previous Select Operator [SEL_163]
+                          <-Union 2 [SIMPLE_EDGE]
+                            <-Map 1 [CONTAINS] vectorized
+                              Reduce Output Operator [RS_177]
+                                PartitionCols:_col0
+                                Select Operator [SEL_176] (rows=144002668 width=135)
+                                  Output:["_col0","_col1"]
+                                  Filter Operator [FIL_175] (rows=144002668 width=135)
+                                    predicate:((ws_sold_date_sk BETWEEN DynamicValue(RS_12_date_dim_d_date_sk_min) AND DynamicValue(RS_12_date_dim_d_date_sk_max) and in_bloom_filter(ws_sold_date_sk, DynamicValue(RS_12_date_dim_d_date_sk_bloom_filter))) and ws_sold_date_sk is not null)
+                                    TableScan [TS_142] (rows=144002668 width=135)
+                                      Output:["ws_sold_date_sk","ws_ext_sales_price"]
+                                    <-Reducer 9 [BROADCAST_EDGE] vectorized
+                                      BROADCAST [RS_173]
+                                        Group By Operator [GBY_172] (rows=1 width=12)
+                                          Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
+                                        <-Map 8 [CUSTOM_SIMPLE_EDGE] vectorized
+                                          PARTITION_ONLY_SHUFFLE [RS_170]
+                                            Group By Operator [GBY_168] (rows=1 width=12)
+                                              Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                              Select Operator [SEL_165] (rows=73049 width=1119)
+                                                Output:["_col0"]
+                                                 Please refer to the previous Select Operator [SEL_163]
+                            <-Map 7 [CONTAINS] vectorized
+                              Reduce Output Operator [RS_192]
+                                PartitionCols:_col0
+                                Select Operator [SEL_191] (rows=287989836 width=135)
+                                  Output:["_col0","_col1"]
+                                  Filter Operator [FIL_190] (rows=287989836 width=135)
+                                    predicate:((cs_sold_date_sk BETWEEN DynamicValue(RS_12_date_dim_d_date_sk_min) AND DynamicValue(RS_12_date_dim_d_date_sk_max) and in_bloom_filter(cs_sold_date_sk, DynamicValue(RS_12_date_dim_d_date_sk_bloom_filter))) and cs_sold_date_sk is not null)
+                                    TableScan [TS_147] (rows=287989836 width=135)
+                                      Output:["cs_sold_date_sk","cs_ext_sales_price"]
+                                    <-Reducer 9 [BROADCAST_EDGE] vectorized
+                                      BROADCAST [RS_174]
+                                         Please refer to the previous Group By Operator [GBY_172]
 

http://git-wip-us.apache.org/repos/asf/hive/blob/30c17911/ql/src/test/results/clientpositive/perf/tez/query59.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/query59.q.out b/ql/src/test/results/clientpositive/perf/tez/query59.q.out
index 29cf136..a4be291 100644
--- a/ql/src/test/results/clientpositive/perf/tez/query59.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/query59.q.out
@@ -109,177 +109,175 @@ Stage-0
     limit:100
     Stage-1
       Reducer 7 vectorized
-      File Output Operator [FS_235]
-        Limit [LIM_234] (rows=100 width=88)
+      File Output Operator [FS_234]
+        Limit [LIM_233] (rows=100 width=88)
           Number of rows:100
-          Select Operator [SEL_233] (rows=421657640 width=88)
+          Select Operator [SEL_232] (rows=421657640 width=88)
             Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9"]
           <-Reducer 6 [SIMPLE_EDGE]
-            SHUFFLE [RS_60]
-              Select Operator [SEL_59] (rows=421657640 width=88)
+            SHUFFLE [RS_59]
+              Select Operator [SEL_58] (rows=421657640 width=88)
                 Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9"]
-                Merge Join Operator [MERGEJOIN_186] (rows=421657640 width=88)
-                  Conds:RS_56._col2, _col1=RS_57._col1, (_col0 - 52)(Inner),Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col12","_col13","_col14","_col15","_col16","_col17"]
+                Merge Join Operator [MERGEJOIN_185] (rows=421657640 width=88)
+                  Conds:RS_55._col12, _col0=RS_56._col1, (_col0 - 52)(Inner),Output:["_col0","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col12","_col13","_col16","_col17","_col18","_col19","_col20","_col21"]
                 <-Reducer 13 [SIMPLE_EDGE]
-                  SHUFFLE [RS_57]
+                  SHUFFLE [RS_56]
                     PartitionCols:_col1, (_col0 - 52)
-                    Select Operator [SEL_55] (rows=383325119 width=88)
+                    Select Operator [SEL_48] (rows=383325119 width=88)
                       Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
-                      Merge Join Operator [MERGEJOIN_185] (rows=383325119 width=88)
-                        Conds:RS_52._col1=RS_222._col0(Inner),Output:["_col0","_col2","_col3","_col4","_col5","_col6","_col7","_col11"]
+                      Merge Join Operator [MERGEJOIN_184] (rows=383325119 width=88)
+                        Conds:RS_45._col1=RS_221._col0(Inner),Output:["_col0","_col2","_col3","_col4","_col5","_col6","_col7","_col11"]
                       <-Map 19 [SIMPLE_EDGE] vectorized
-                        PARTITION_ONLY_SHUFFLE [RS_222]
+                        PARTITION_ONLY_SHUFFLE [RS_221]
                           PartitionCols:_col0
-                          Select Operator [SEL_221] (rows=1704 width=1910)
+                          Select Operator [SEL_220] (rows=1704 width=1910)
                             Output:["_col0","_col1"]
-                            Filter Operator [FIL_220] (rows=1704 width=1910)
+                            Filter Operator [FIL_219] (rows=1704 width=1910)
                               predicate:(s_store_id is not null and s_store_sk is not null)
-                              TableScan [TS_46] (rows=1704 width=1910)
+                              TableScan [TS_39] (rows=1704 width=1910)
                                 default@store,store,Tbl:COMPLETE,Col:NONE,Output:["s_store_sk","s_store_id"]
                       <-Reducer 12 [SIMPLE_EDGE]
-                        SHUFFLE [RS_52]
+                        SHUFFLE [RS_45]
                           PartitionCols:_col1
-                          Merge Join Operator [MERGEJOIN_184] (rows=348477374 width=88)
-                            Conds:RS_232._col0=RS_217._col1(Inner),Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
+                          Merge Join Operator [MERGEJOIN_183] (rows=348477374 width=88)
+                            Conds:RS_231._col0=RS_216._col1(Inner),Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
                           <-Map 15 [SIMPLE_EDGE] vectorized
-                            SHUFFLE [RS_217]
+                            SHUFFLE [RS_216]
                               PartitionCols:_col1
-                              Select Operator [SEL_215] (rows=8116 width=1119)
+                              Select Operator [SEL_214] (rows=8116 width=1119)
                                 Output:["_col1"]
-                                Filter Operator [FIL_213] (rows=8116 width=1119)
+                                Filter Operator [FIL_212] (rows=8116 width=1119)
                                   predicate:(d_month_seq BETWEEN 1197 AND 1208 and d_week_seq is not null)
                                   TableScan [TS_15] (rows=73049 width=1119)
                                     default@date_dim,d,Tbl:COMPLETE,Col:NONE,Output:["d_month_seq","d_week_seq"]
                           <-Reducer 11 [SIMPLE_EDGE] vectorized
-                            SHUFFLE [RS_232]
+                            SHUFFLE [RS_231]
                               PartitionCols:_col0
-                              Group By Operator [GBY_231] (rows=316797606 width=88)
+                              Group By Operator [GBY_230] (rows=316797606 width=88)
                                 Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)","sum(VALUE._col3)","sum(VALUE._col4)","sum(VALUE._col5)"],keys:KEY._col0, KEY._col1
                               <-Reducer 10 [SIMPLE_EDGE]
-                                SHUFFLE [RS_40]
+                                SHUFFLE [RS_33]
                                   PartitionCols:_col0, _col1
-                                  Group By Operator [GBY_39] (rows=633595212 width=88)
+                                  Group By Operator [GBY_32] (rows=633595212 width=88)
                                     Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(_col2)","sum(_col3)","sum(_col5)","sum(_col6)","sum(_col7)","sum(_col8)"],keys:_col0, _col1
-                                    Select Operator [SEL_37] (rows=633595212 width=88)
+                                    Select Operator [SEL_30] (rows=633595212 width=88)
                                       Output:["_col0","_col1","_col2","_col3","_col5","_col6","_col7","_col8"]
-                                      Merge Join Operator [MERGEJOIN_183] (rows=633595212 width=88)
-                                        Conds:RS_230._col0=RS_191._col0(Inner),Output:["_col1","_col2","_col4","_col5"]
+                                      Merge Join Operator [MERGEJOIN_182] (rows=633595212 width=88)
+                                        Conds:RS_229._col0=RS_190._col0(Inner),Output:["_col1","_col2","_col4","_col5"]
                                       <-Map 8 [SIMPLE_EDGE] vectorized
-                                        PARTITION_ONLY_SHUFFLE [RS_191]
+                                        PARTITION_ONLY_SHUFFLE [RS_190]
                                           PartitionCols:_col0
-                                          Select Operator [SEL_188] (rows=73049 width=1119)
+                                          Select Operator [SEL_187] (rows=73049 width=1119)
                                             Output:["_col0","_col1","_col2"]
-                                            Filter Operator [FIL_187] (rows=73049 width=1119)
+                                            Filter Operator [FIL_186] (rows=73049 width=1119)
                                               predicate:(d_date_sk is not null and d_week_seq is not null)
                                               TableScan [TS_3] (rows=73049 width=1119)
                                                 default@date_dim,date_dim,Tbl:COMPLETE,Col:NONE,Output:["d_date_sk","d_week_seq","d_day_name"]
                                       <-Map 18 [SIMPLE_EDGE] vectorized
-                                        SHUFFLE [RS_230]
+                                        SHUFFLE [RS_229]
                                           PartitionCols:_col0
-                                          Select Operator [SEL_229] (rows=575995635 width=88)
+                                          Select Operator [SEL_228] (rows=575995635 width=88)
                                             Output:["_col0","_col1","_col2"]
-                                            Filter Operator [FIL_228] (rows=575995635 width=88)
-                                              predicate:((ss_sold_date_sk BETWEEN DynamicValue(RS_35_date_dim_d_date_sk_min) AND DynamicValue(RS_35_date_dim_d_date_sk_max) and in_bloom_filter(ss_sold_date_sk, DynamicValue(RS_35_date_dim_d_date_sk_bloom_filter))) and (ss_store_sk BETWEEN DynamicValue(RS_53_store_s_store_sk_min) AND DynamicValue(RS_53_store_s_store_sk_max) and in_bloom_filter(ss_store_sk, DynamicValue(RS_53_store_s_store_sk_bloom_filter))) and ss_sold_date_sk is not null and ss_store_sk is not null)
-                                              TableScan [TS_28] (rows=575995635 width=88)
+                                            Filter Operator [FIL_227] (rows=575995635 width=88)
+                                              predicate:((ss_sold_date_sk BETWEEN DynamicValue(RS_28_date_dim_d_date_sk_min) AND DynamicValue(RS_28_date_dim_d_date_sk_max) and in_bloom_filter(ss_sold_date_sk, DynamicValue(RS_28_date_dim_d_date_sk_bloom_filter))) and (ss_store_sk BETWEEN DynamicValue(RS_46_store_s_store_sk_min) AND DynamicValue(RS_46_store_s_store_sk_max) and in_bloom_filter(ss_store_sk, DynamicValue(RS_46_store_s_store_sk_bloom_filter))) and ss_sold_date_sk is not null and ss_store_sk is not null)
+                                              TableScan [TS_21] (rows=575995635 width=88)
                                                 default@store_sales,store_sales,Tbl:COMPLETE,Col:NONE,Output:["ss_sold_date_sk","ss_store_sk","ss_sales_price"]
                                               <-Reducer 14 [BROADCAST_EDGE] vectorized
-                                                BROADCAST [RS_219]
-                                                  Group By Operator [GBY_218] (rows=1 width=12)
+                                                BROADCAST [RS_218]
+                                                  Group By Operator [GBY_217] (rows=1 width=12)
                                                     Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
                                                   <-Map 8 [CUSTOM_SIMPLE_EDGE] vectorized
-                                                    PARTITION_ONLY_SHUFFLE [RS_196]
-                                                      Group By Operator [GBY_194] (rows=1 width=12)
+                                                    PARTITION_ONLY_SHUFFLE [RS_195]
+                                                      Group By Operator [GBY_193] (rows=1 width=12)
                                                         Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
-                                                        Select Operator [SEL_192] (rows=73049 width=1119)
+                                                        Select Operator [SEL_191] (rows=73049 width=1119)
                                                           Output:["_col0"]
-                                                           Please refer to the previous Select Operator [SEL_188]
+                                                           Please refer to the previous Select Operator [SEL_187]
                                               <-Reducer 20 [BROADCAST_EDGE] vectorized
-                                                BROADCAST [RS_227]
-                                                  Group By Operator [GBY_226] (rows=1 width=12)
+                                                BROADCAST [RS_226]
+                                                  Group By Operator [GBY_225] (rows=1 width=12)
                                                     Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
                                                   <-Map 19 [CUSTOM_SIMPLE_EDGE] vectorized
-                                                    PARTITION_ONLY_SHUFFLE [RS_225]
-                                                      Group By Operator [GBY_224] (rows=1 width=12)
+                                                    PARTITION_ONLY_SHUFFLE [RS_224]
+                                                      Group By Operator [GBY_223] (rows=1 width=12)
                                                         Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
-                                                        Select Operator [SEL_223] (rows=1704 width=1910)
+                                                        Select Operator [SEL_222] (rows=1704 width=1910)
                                                           Output:["_col0"]
-                                                           Please refer to the previous Select Operator [SEL_221]
+                                                           Please refer to the previous Select Operator [SEL_220]
                 <-Reducer 5 [SIMPLE_EDGE]
-                  SHUFFLE [RS_56]
-                    PartitionCols:_col2, _col1
-                    Select Operator [SEL_27] (rows=383325119 width=88)
-                      Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9"]
-                      Merge Join Operator [MERGEJOIN_182] (rows=383325119 width=88)
-                        Conds:RS_24._col1=RS_201._col0(Inner),Output:["_col0","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col12","_col13"]
-                      <-Map 16 [SIMPLE_EDGE] vectorized
-                        SHUFFLE [RS_201]
-                          PartitionCols:_col0
-                          Select Operator [SEL_200] (rows=1704 width=1910)
-                            Output:["_col0","_col1","_col2"]
-                            Filter Operator [FIL_199] (rows=1704 width=1910)
-                              predicate:(s_store_id is not null and s_store_sk is not null)
-                              TableScan [TS_18] (rows=1704 width=1910)
-                                default@store,store,Tbl:COMPLETE,Col:NONE,Output:["s_store_sk","s_store_id","s_store_name"]
-                      <-Reducer 4 [SIMPLE_EDGE]
-                        SHUFFLE [RS_24]
-                          PartitionCols:_col1
-                          Merge Join Operator [MERGEJOIN_181] (rows=348477374 width=88)
-                            Conds:RS_211._col0=RS_216._col1(Inner),Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8"]
-                          <-Map 15 [SIMPLE_EDGE] vectorized
-                            SHUFFLE [RS_216]
-                              PartitionCols:_col1
-                              Select Operator [SEL_214] (rows=8116 width=1119)
-                                Output:["_col1"]
-                                Filter Operator [FIL_212] (rows=8116 width=1119)
-                                  predicate:(d_month_seq BETWEEN 1185 AND 1196 and d_week_seq is not null)
-                                   Please refer to the previous TableScan [TS_15]
-                          <-Reducer 3 [SIMPLE_EDGE] vectorized
-                            SHUFFLE [RS_211]
-                              PartitionCols:_col0
-                              Group By Operator [GBY_210] (rows=316797606 width=88)
-                                Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)","sum(VALUE._col3)","sum(VALUE._col4)","sum(VALUE._col5)","sum(VALUE._col6)"],keys:KEY._col0, KEY._col1
-                              <-Reducer 2 [SIMPLE_EDGE]
-                                SHUFFLE [RS_12]
-                                  PartitionCols:_col0, _col1
-                                  Group By Operator [GBY_11] (rows=633595212 width=88)
-                                    Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8"],aggregations:["sum(_col2)","sum(_col3)","sum(_col4)","sum(_col5)","sum(_col6)","sum(_col7)","sum(_col8)"],keys:_col0, _col1
-                                    Select Operator [SEL_9] (rows=633595212 width=88)
-                                      Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8"]
-                                      Merge Join Operator [MERGEJOIN_180] (rows=633595212 width=88)
-                                        Conds:RS_209._col0=RS_189._col0(Inner),Output:["_col1","_col2","_col4","_col5"]
-                                      <-Map 8 [SIMPLE_EDGE] vectorized
-                                        PARTITION_ONLY_SHUFFLE [RS_189]
-                                          PartitionCols:_col0
-                                           Please refer to the previous Select Operator [SEL_188]
-                                      <-Map 1 [SIMPLE_EDGE] vectorized
-                                        SHUFFLE [RS_209]
-                                          PartitionCols:_col0
-                                          Select Operator [SEL_208] (rows=575995635 width=88)
-                                            Output:["_col0","_col1","_col2"]
-                                            Filter Operator [FIL_207] (rows=575995635 width=88)
-                                              predicate:((ss_sold_date_sk BETWEEN DynamicValue(RS_7_date_dim_d_date_sk_min) AND DynamicValue(RS_7_date_dim_d_date_sk_max) and in_bloom_filter(ss_sold_date_sk, DynamicValue(RS_7_date_dim_d_date_sk_bloom_filter))) and (ss_store_sk BETWEEN DynamicValue(RS_25_store_s_store_sk_min) AND DynamicValue(RS_25_store_s_store_sk_max) and in_bloom_filter(ss_store_sk, DynamicValue(RS_25_store_s_store_sk_bloom_filter))) and ss_sold_date_sk is not null and ss_store_sk is not null)
-                                              TableScan [TS_0] (rows=575995635 width=88)
-                                                default@store_sales,store_sales,Tbl:COMPLETE,Col:NONE,Output:["ss_sold_date_sk","ss_store_sk","ss_sales_price"]
-                                              <-Reducer 17 [BROADCAST_EDGE] vectorized
-                                                BROADCAST [RS_206]
-                                                  Group By Operator [GBY_205] (rows=1 width=12)
-                                                    Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
-                                                  <-Map 16 [CUSTOM_SIMPLE_EDGE] vectorized
-                                                    SHUFFLE [RS_204]
-                                                      Group By Operator [GBY_203] (rows=1 width=12)
-                                                        Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
-                                                        Select Operator [SEL_202] (rows=1704 width=1910)
-                                                          Output:["_col0"]
-                                                           Please refer to the previous Select Operator [SEL_200]
-                                              <-Reducer 9 [BROADCAST_EDGE] vectorized
-                                                BROADCAST [RS_198]
-                                                  Group By Operator [GBY_197] (rows=1 width=12)
-                                                    Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
-                                                  <-Map 8 [CUSTOM_SIMPLE_EDGE] vectorized
-                                                    PARTITION_ONLY_SHUFFLE [RS_195]
-                                                      Group By Operator [GBY_193] (rows=1 width=12)
-                                                        Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
-                                                        Select Operator [SEL_190] (rows=73049 width=1119)
-                                                          Output:["_col0"]
-                                                           Please refer to the previous Select Operator [SEL_188]
+                  SHUFFLE [RS_55]
+                    PartitionCols:_col12, _col0
+                    Merge Join Operator [MERGEJOIN_181] (rows=383325119 width=88)
+                      Conds:RS_52._col1=RS_200._col0(Inner),Output:["_col0","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col12","_col13"]
+                    <-Map 16 [SIMPLE_EDGE] vectorized
+                      SHUFFLE [RS_200]
+                        PartitionCols:_col0
+                        Select Operator [SEL_199] (rows=1704 width=1910)
+                          Output:["_col0","_col1","_col2"]
+                          Filter Operator [FIL_198] (rows=1704 width=1910)
+                            predicate:(s_store_id is not null and s_store_sk is not null)
+                            TableScan [TS_18] (rows=1704 width=1910)
+                              default@store,store,Tbl:COMPLETE,Col:NONE,Output:["s_store_sk","s_store_id","s_store_name"]
+                    <-Reducer 4 [SIMPLE_EDGE]
+                      SHUFFLE [RS_52]
+                        PartitionCols:_col1
+                        Merge Join Operator [MERGEJOIN_180] (rows=348477374 width=88)
+                          Conds:RS_210._col0=RS_215._col1(Inner),Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8"]
+                        <-Map 15 [SIMPLE_EDGE] vectorized
+                          SHUFFLE [RS_215]
+                            PartitionCols:_col1
+                            Select Operator [SEL_213] (rows=8116 width=1119)
+                              Output:["_col1"]
+                              Filter Operator [FIL_211] (rows=8116 width=1119)
+                                predicate:(d_month_seq BETWEEN 1185 AND 1196 and d_week_seq is not null)
+                                 Please refer to the previous TableScan [TS_15]
+                        <-Reducer 3 [SIMPLE_EDGE] vectorized
+                          SHUFFLE [RS_210]
+                            PartitionCols:_col0
+                            Group By Operator [GBY_209] (rows=316797606 width=88)
+                              Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)","sum(VALUE._col3)","sum(VALUE._col4)","sum(VALUE._col5)","sum(VALUE._col6)"],keys:KEY._col0, KEY._col1
+                            <-Reducer 2 [SIMPLE_EDGE]
+                              SHUFFLE [RS_12]
+                                PartitionCols:_col0, _col1
+                                Group By Operator [GBY_11] (rows=633595212 width=88)
+                                  Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8"],aggregations:["sum(_col2)","sum(_col3)","sum(_col4)","sum(_col5)","sum(_col6)","sum(_col7)","sum(_col8)"],keys:_col0, _col1
+                                  Select Operator [SEL_9] (rows=633595212 width=88)
+                                    Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8"]
+                                    Merge Join Operator [MERGEJOIN_179] (rows=633595212 width=88)
+                                      Conds:RS_208._col0=RS_188._col0(Inner),Output:["_col1","_col2","_col4","_col5"]
+                                    <-Map 8 [SIMPLE_EDGE] vectorized
+                                      PARTITION_ONLY_SHUFFLE [RS_188]
+                                        PartitionCols:_col0
+                                         Please refer to the previous Select Operator [SEL_187]
+                                    <-Map 1 [SIMPLE_EDGE] vectorized
+                                      SHUFFLE [RS_208]
+                                        PartitionCols:_col0
+                                        Select Operator [SEL_207] (rows=575995635 width=88)
+                                          Output:["_col0","_col1","_col2"]
+                                          Filter Operator [FIL_206] (rows=575995635 width=88)
+                                            predicate:((ss_sold_date_sk BETWEEN DynamicValue(RS_7_date_dim_d_date_sk_min) AND DynamicValue(RS_7_date_dim_d_date_sk_max) and in_bloom_filter(ss_sold_date_sk, DynamicValue(RS_7_date_dim_d_date_sk_bloom_filter))) and (ss_store_sk BETWEEN DynamicValue(RS_53_store_s_store_sk_min) AND DynamicValue(RS_53_store_s_store_sk_max) and in_bloom_filter(ss_store_sk, DynamicValue(RS_53_store_s_store_sk_bloom_filter))) and ss_sold_date_sk is not null and ss_store_sk is not null)
+                                            TableScan [TS_0] (rows=575995635 width=88)
+                                              default@store_sales,store_sales,Tbl:COMPLETE,Col:NONE,Output:["ss_sold_date_sk","ss_store_sk","ss_sales_price"]
+                                            <-Reducer 17 [BROADCAST_EDGE] vectorized
+                                              BROADCAST [RS_205]
+                                                Group By Operator [GBY_204] (rows=1 width=12)
+                                                  Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
+                                                <-Map 16 [CUSTOM_SIMPLE_EDGE] vectorized
+                                                  SHUFFLE [RS_203]
+                                                    Group By Operator [GBY_202] (rows=1 width=12)
+                                                      Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                                      Select Operator [SEL_201] (rows=1704 width=1910)
+                                                        Output:["_col0"]
+                                                         Please refer to the previous Select Operator [SEL_199]
+                                            <-Reducer 9 [BROADCAST_EDGE] vectorized
+                                              BROADCAST [RS_197]
+                                                Group By Operator [GBY_196] (rows=1 width=12)
+                                                  Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
+                                                <-Map 8 [CUSTOM_SIMPLE_EDGE] vectorized
+                                                  PARTITION_ONLY_SHUFFLE [RS_194]
+                                                    Group By Operator [GBY_192] (rows=1 width=12)
+                                                      Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                                      Select Operator [SEL_189] (rows=73049 width=1119)
+                                                        Output:["_col0"]
+                                                         Please refer to the previous Select Operator [SEL_187]
 

http://git-wip-us.apache.org/repos/asf/hive/blob/30c17911/ql/src/test/results/clientpositive/perf/tez/query95.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/query95.q.out b/ql/src/test/results/clientpositive/perf/tez/query95.q.out
index 3a8ed09..86e892f 100644
--- a/ql/src/test/results/clientpositive/perf/tez/query95.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/query95.q.out
@@ -121,14 +121,14 @@ Stage-0
                                   SHUFFLE [RS_46]
                                     PartitionCols:_col0
                                     Group By Operator [GBY_45] (rows=174243235 width=135)
-                                      Output:["_col0"],keys:_col1
+                                      Output:["_col0"],keys:_col14
                                       Merge Join Operator [MERGEJOIN_227] (rows=174243235 width=135)
-                                        Conds:RS_41._col0=RS_255._col0(Inner),Output:["_col1"]
+                                        Conds:RS_41._col0=RS_255._col13(Inner),Output:["_col14"]
                                       <-Map 22 [SIMPLE_EDGE] vectorized
                                         PARTITION_ONLY_SHUFFLE [RS_255]
-                                          PartitionCols:_col0
+                                          PartitionCols:_col13
                                           Select Operator [SEL_254] (rows=14398467 width=92)
-                                            Output:["_col0"]
+                                            Output:["_col13"]
                                             Filter Operator [FIL_253] (rows=14398467 width=92)
                                               predicate:wr_order_number is not null
                                               TableScan [TS_38] (rows=14398467 width=92)

http://git-wip-us.apache.org/repos/asf/hive/blob/30c17911/ql/src/test/results/clientpositive/ppd_repeated_alias.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/ppd_repeated_alias.q.out b/ql/src/test/results/clientpositive/ppd_repeated_alias.q.out
index b9434b1..ccecfed 100644
--- a/ql/src/test/results/clientpositive/ppd_repeated_alias.q.out
+++ b/ql/src/test/results/clientpositive/ppd_repeated_alias.q.out
@@ -263,18 +263,18 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Shuffle Join JOIN[15][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-1:MAPRED' is a cross product
+Warning: Shuffle Join JOIN[14][tables = [$hdt$_0, $hdt$_1, $hdt$_2]] in Stage 'Stage-2:MAPRED' is a cross product
 PREHOOK: query: explain select c.foo, d.bar from (select c.foo, b.bar, c.blah from pokes_n0 c left outer join pokes_n0 b on c.foo=b.foo) c left outer join pokes_n0 d where d.foo=1 and c.bar=2
 PREHOOK: type: QUERY
 POSTHOOK: query: explain select c.foo, d.bar from (select c.foo, b.bar, c.blah from pokes_n0 c left outer join pokes_n0 b on c.foo=b.foo) c left outer join pokes_n0 d where d.foo=1 and c.bar=2
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
-  Stage-2 is a root stage
-  Stage-1 depends on stages: Stage-2
-  Stage-0 depends on stages: Stage-1
+  Stage-1 is a root stage
+  Stage-2 depends on stages: Stage-1
+  Stage-0 depends on stages: Stage-2
 
 STAGE PLANS:
-  Stage: Stage-2
+  Stage: Stage-1
     Map Reduce
       Map Operator Tree:
           TableScan
@@ -318,21 +318,22 @@ STAGE PLANS:
             1 _col0 (type: int)
           outputColumnNames: _col2
           Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-          Select Operator
-            expressions: _col2 (type: int)
-            outputColumnNames: _col0
-            Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-            File Output Operator
-              compressed: false
-              table:
-                  input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                  output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                  serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+          File Output Operator
+            compressed: false
+            table:
+                input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
 
-  Stage: Stage-1
+  Stage: Stage-2
     Map Reduce
       Map Operator Tree:
           TableScan
+            Reduce Output Operator
+              sort order: 
+              Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+              value expressions: _col2 (type: int)
+          TableScan
             alias: d
             filterExpr: (foo = 1) (type: boolean)
             Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
@@ -347,11 +348,6 @@ STAGE PLANS:
                   sort order: 
                   Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                   value expressions: _col1 (type: int)
-          TableScan
-            Reduce Output Operator
-              sort order: 
-              Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-              value expressions: _col0 (type: int)
       Reduce Operator Tree:
         Join Operator
           condition map:
@@ -359,10 +355,10 @@ STAGE PLANS:
           keys:
             0 
             1 
-          outputColumnNames: _col1, _col2
+          outputColumnNames: _col2, _col4
           Statistics: Num rows: 1 Data size: 1 Basic stats: PARTIAL Column stats: NONE
           Select Operator
-            expressions: _col2 (type: int), _col1 (type: int)
+            expressions: _col2 (type: int), _col4 (type: int)
             outputColumnNames: _col0, _col1
             Statistics: Num rows: 1 Data size: 1 Basic stats: PARTIAL Column stats: NONE
             File Output Operator