http://git-wip-us.apache.org/repos/asf/hive/blob/328d3f93/ql/src/test/results/clientpositive/perf/spark/query24.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query24.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query24.q.out
index 1f291c0..13ac1e8 100644
--- a/ql/src/test/results/clientpositive/perf/spark/query24.q.out
+++ b/ql/src/test/results/clientpositive/perf/spark/query24.q.out
@@ -131,10 +131,10 @@ STAGE PLANS:
   Stage: Stage-2
     Spark
       Edges:
-        Reducer 13 <- Map 12 (PARTITION-LEVEL SORT, 975), Map 20 
(PARTITION-LEVEL SORT, 975)
-        Reducer 14 <- Map 21 (PARTITION-LEVEL SORT, 486), Reducer 13 
(PARTITION-LEVEL SORT, 486)
-        Reducer 15 <- Map 22 (PARTITION-LEVEL SORT, 564), Reducer 14 
(PARTITION-LEVEL SORT, 564)
-        Reducer 16 <- Map 23 (PARTITION-LEVEL SORT, 899), Reducer 15 
(PARTITION-LEVEL SORT, 899)
+        Reducer 13 <- Map 12 (PARTITION-LEVEL SORT, 472), Map 20 
(PARTITION-LEVEL SORT, 472)
+        Reducer 14 <- Map 21 (PARTITION-LEVEL SORT, 1009), Reducer 13 
(PARTITION-LEVEL SORT, 1009)
+        Reducer 15 <- Map 22 (PARTITION-LEVEL SORT, 846), Reducer 14 
(PARTITION-LEVEL SORT, 846)
+        Reducer 16 <- Map 23 (PARTITION-LEVEL SORT, 587), Reducer 15 
(PARTITION-LEVEL SORT, 587)
         Reducer 17 <- Reducer 16 (GROUP, 640)
         Reducer 18 <- Reducer 17 (GROUP, 1)
 #### A masked pattern was here ####
@@ -162,16 +162,33 @@ STAGE PLANS:
                           1 Map 19
                         Statistics: Num rows: 633595212 Data size: 55895953508 
Basic stats: COMPLETE Column stats: NONE
                         Reduce Output Operator
-                          key expressions: _col1 (type: int)
-                          sort order: +
-                          Map-reduce partition columns: _col1 (type: int)
+                          key expressions: _col0 (type: int), _col3 (type: int)
+                          sort order: ++
+                          Map-reduce partition columns: _col0 (type: int), 
_col3 (type: int)
                           Statistics: Num rows: 633595212 Data size: 
55895953508 Basic stats: COMPLETE Column stats: NONE
-                          value expressions: _col0 (type: int), _col3 (type: 
int), _col4 (type: decimal(7,2)), _col6 (type: string), _col8 (type: string), 
_col9 (type: string)
+                          value expressions: _col1 (type: int), _col4 (type: 
decimal(7,2)), _col6 (type: string), _col8 (type: string), _col9 (type: string)
             Local Work:
               Map Reduce Local Work
         Map 20 
             Map Operator Tree:
                 TableScan
+                  alias: store_returns
+                  Statistics: Num rows: 57591150 Data size: 4462194832 Basic 
stats: COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: (sr_item_sk is not null and sr_ticket_number is 
not null) (type: boolean)
+                    Statistics: Num rows: 57591150 Data size: 4462194832 Basic 
stats: COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: sr_item_sk (type: int), sr_ticket_number 
(type: int)
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 57591150 Data size: 4462194832 
Basic stats: COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: int), _col1 (type: int)
+                        sort order: ++
+                        Map-reduce partition columns: _col0 (type: int), _col1 
(type: int)
+                        Statistics: Num rows: 57591150 Data size: 4462194832 
Basic stats: COMPLETE Column stats: NONE
+        Map 21 
+            Map Operator Tree:
+                TableScan
                   alias: customer
                   Statistics: Num rows: 80000000 Data size: 68801615852 Basic 
stats: COMPLETE Column stats: NONE
                   Filter Operator
@@ -187,44 +204,9 @@ STAGE PLANS:
                         Map-reduce partition columns: _col0 (type: int)
                         Statistics: Num rows: 80000000 Data size: 68801615852 
Basic stats: COMPLETE Column stats: NONE
                         value expressions: _col1 (type: string), _col2 (type: 
string), _col3 (type: string)
-        Map 21 
-            Map Operator Tree:
-                TableScan
-                  alias: item
-                  Statistics: Num rows: 462000 Data size: 663560457 Basic 
stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: i_item_sk is not null (type: boolean)
-                    Statistics: Num rows: 462000 Data size: 663560457 Basic 
stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: i_item_sk (type: int), i_current_price 
(type: decimal(7,2)), i_size (type: string), i_color (type: string), i_units 
(type: string), i_manager_id (type: int)
-                      outputColumnNames: _col0, _col1, _col2, _col3, _col4, 
_col5
-                      Statistics: Num rows: 462000 Data size: 663560457 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: 462000 Data size: 663560457 
Basic stats: COMPLETE Column stats: NONE
-                        value expressions: _col1 (type: decimal(7,2)), _col2 
(type: string), _col3 (type: string), _col4 (type: string), _col5 (type: int)
         Map 22 
             Map Operator Tree:
                 TableScan
-                  alias: store_returns
-                  Statistics: Num rows: 57591150 Data size: 4462194832 Basic 
stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: (sr_item_sk is not null and sr_ticket_number is 
not null) (type: boolean)
-                    Statistics: Num rows: 57591150 Data size: 4462194832 Basic 
stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: sr_item_sk (type: int), sr_ticket_number 
(type: int)
-                      outputColumnNames: _col0, _col1
-                      Statistics: Num rows: 57591150 Data size: 4462194832 
Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: _col0 (type: int), _col1 (type: int)
-                        sort order: ++
-                        Map-reduce partition columns: _col0 (type: int), _col1 
(type: int)
-                        Statistics: Num rows: 57591150 Data size: 4462194832 
Basic stats: COMPLETE Column stats: NONE
-        Map 23 
-            Map Operator Tree:
-                TableScan
                   alias: customer_address
                   Statistics: Num rows: 40000000 Data size: 40595195284 Basic 
stats: COMPLETE Column stats: NONE
                   Filter Operator
@@ -240,81 +222,99 @@ STAGE PLANS:
                         Map-reduce partition columns: _col1 (type: string), 
upper(_col2) (type: string)
                         Statistics: Num rows: 40000000 Data size: 40595195284 
Basic stats: COMPLETE Column stats: NONE
                         value expressions: _col0 (type: string)
+        Map 23 
+            Map Operator Tree:
+                TableScan
+                  alias: item
+                  Statistics: Num rows: 462000 Data size: 663560457 Basic 
stats: COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: i_item_sk is not null (type: boolean)
+                    Statistics: Num rows: 462000 Data size: 663560457 Basic 
stats: COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: i_item_sk (type: int), i_current_price 
(type: decimal(7,2)), i_size (type: string), i_color (type: string), i_units 
(type: string), i_manager_id (type: int)
+                      outputColumnNames: _col0, _col1, _col2, _col3, _col4, 
_col5
+                      Statistics: Num rows: 462000 Data size: 663560457 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: 462000 Data size: 663560457 
Basic stats: COMPLETE Column stats: NONE
+                        value expressions: _col1 (type: decimal(7,2)), _col2 
(type: string), _col3 (type: string), _col4 (type: string), _col5 (type: int)
         Reducer 13 
             Reduce Operator Tree:
               Join Operator
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 _col1 (type: int)
-                  1 _col0 (type: int)
-                outputColumnNames: _col0, _col3, _col4, _col6, _col8, _col9, 
_col11, _col12, _col13
+                  0 _col0 (type: int), _col3 (type: int)
+                  1 _col0 (type: int), _col1 (type: int)
+                outputColumnNames: _col0, _col1, _col4, _col6, _col8, _col9
                 Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
                 Reduce Output Operator
-                  key expressions: _col0 (type: int)
+                  key expressions: _col1 (type: int)
                   sort order: +
-                  Map-reduce partition columns: _col0 (type: int)
+                  Map-reduce partition columns: _col1 (type: int)
                   Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col3 (type: int), _col4 (type: 
decimal(7,2)), _col6 (type: string), _col8 (type: string), _col9 (type: 
string), _col11 (type: string), _col12 (type: string), _col13 (type: string)
+                  value expressions: _col0 (type: int), _col4 (type: 
decimal(7,2)), _col6 (type: string), _col8 (type: string), _col9 (type: string)
         Reducer 14 
             Reduce Operator Tree:
               Join Operator
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 _col0 (type: int)
+                  0 _col1 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col0, _col3, _col4, _col6, _col8, _col9, 
_col11, _col12, _col13, _col15, _col16, _col17, _col18, _col19
+                outputColumnNames: _col0, _col4, _col6, _col8, _col9, _col13, 
_col14, _col15
                 Statistics: Num rows: 766650239 Data size: 67634106676 Basic 
stats: COMPLETE Column stats: NONE
                 Reduce Output Operator
-                  key expressions: _col0 (type: int), _col3 (type: int)
+                  key expressions: _col9 (type: string), _col15 (type: string)
                   sort order: ++
-                  Map-reduce partition columns: _col0 (type: int), _col3 
(type: int)
+                  Map-reduce partition columns: _col9 (type: string), _col15 
(type: string)
                   Statistics: Num rows: 766650239 Data size: 67634106676 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col4 (type: decimal(7,2)), _col6 (type: 
string), _col8 (type: string), _col9 (type: string), _col11 (type: string), 
_col12 (type: string), _col13 (type: string), _col15 (type: decimal(7,2)), 
_col16 (type: string), _col17 (type: string), _col18 (type: string), _col19 
(type: int)
+                  value expressions: _col0 (type: int), _col4 (type: 
decimal(7,2)), _col6 (type: string), _col8 (type: string), _col13 (type: 
string), _col14 (type: string)
         Reducer 15 
             Reduce Operator Tree:
               Join Operator
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 _col0 (type: int), _col3 (type: int)
-                  1 _col0 (type: int), _col1 (type: int)
-                outputColumnNames: _col4, _col6, _col8, _col9, _col11, _col12, 
_col13, _col15, _col16, _col17, _col18, _col19
+                  0 _col9 (type: string), _col15 (type: string)
+                  1 _col1 (type: string), upper(_col2) (type: string)
+                outputColumnNames: _col0, _col4, _col6, _col8, _col13, _col14, 
_col16
                 Statistics: Num rows: 843315281 Data size: 74397518956 Basic 
stats: COMPLETE Column stats: NONE
                 Reduce Output Operator
-                  key expressions: _col9 (type: string), _col13 (type: string)
-                  sort order: ++
-                  Map-reduce partition columns: _col9 (type: string), _col13 
(type: string)
+                  key expressions: _col0 (type: int)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: int)
                   Statistics: Num rows: 843315281 Data size: 74397518956 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col4 (type: decimal(7,2)), _col6 (type: 
string), _col8 (type: string), _col11 (type: string), _col12 (type: string), 
_col15 (type: decimal(7,2)), _col16 (type: string), _col17 (type: string), 
_col18 (type: string), _col19 (type: int)
+                  value expressions: _col4 (type: decimal(7,2)), _col6 (type: 
string), _col8 (type: string), _col13 (type: string), _col14 (type: string), 
_col16 (type: string)
         Reducer 16 
             Reduce Operator Tree:
               Join Operator
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 _col9 (type: string), _col13 (type: string)
-                  1 _col1 (type: string), upper(_col2) (type: string)
-                outputColumnNames: _col4, _col6, _col8, _col11, _col12, 
_col15, _col16, _col17, _col18, _col19, _col22
+                  0 _col0 (type: int)
+                  1 _col0 (type: int)
+                outputColumnNames: _col4, _col6, _col8, _col13, _col14, 
_col16, _col20, _col21, _col22, _col23, _col24
                 Statistics: Num rows: 927646829 Data size: 81837272625 Basic 
stats: COMPLETE Column stats: NONE
                 Group By Operator
                   aggregations: sum(_col4)
-                  keys: _col11 (type: string), _col12 (type: string), _col6 
(type: string), _col8 (type: string), _col15 (type: decimal(7,2)), _col16 
(type: string), _col17 (type: string), _col18 (type: string), _col19 (type: 
int), _col22 (type: string)
+                  keys: _col20 (type: decimal(7,2)), _col21 (type: string), 
_col22 (type: string), _col23 (type: string), _col24 (type: int), _col16 (type: 
string), _col13 (type: string), _col14 (type: string), _col6 (type: string), 
_col8 (type: string)
                   mode: hash
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7, _col8, _col9, _col10
                   Statistics: Num rows: 927646829 Data size: 81837272625 Basic 
stats: COMPLETE Column stats: NONE
                   Reduce Output Operator
-                    key expressions: _col0 (type: string), _col1 (type: 
string), _col2 (type: string), _col3 (type: string), _col4 (type: 
decimal(7,2)), _col5 (type: string), _col6 (type: string), _col7 (type: 
string), _col8 (type: int), _col9 (type: string)
+                    key expressions: _col0 (type: decimal(7,2)), _col1 (type: 
string), _col2 (type: string), _col3 (type: string), _col4 (type: int), _col5 
(type: string), _col6 (type: string), _col7 (type: string), _col8 (type: 
string), _col9 (type: string)
                     sort order: ++++++++++
-                    Map-reduce partition columns: _col0 (type: string), _col1 
(type: string), _col2 (type: string), _col3 (type: string), _col4 (type: 
decimal(7,2)), _col5 (type: string), _col6 (type: string), _col7 (type: 
string), _col8 (type: int), _col9 (type: string)
+                    Map-reduce partition columns: _col0 (type: decimal(7,2)), 
_col1 (type: string), _col2 (type: string), _col3 (type: string), _col4 (type: 
int), _col5 (type: string), _col6 (type: string), _col7 (type: string), _col8 
(type: string), _col9 (type: string)
                     Statistics: Num rows: 927646829 Data size: 81837272625 
Basic stats: COMPLETE Column stats: NONE
                     value expressions: _col10 (type: decimal(17,2))
         Reducer 17 
             Reduce Operator Tree:
               Group By Operator
                 aggregations: sum(VALUE._col0)
-                keys: KEY._col0 (type: string), KEY._col1 (type: string), 
KEY._col2 (type: string), KEY._col3 (type: string), KEY._col4 (type: 
decimal(7,2)), KEY._col5 (type: string), KEY._col6 (type: string), KEY._col7 
(type: string), KEY._col8 (type: int), KEY._col9 (type: string)
+                keys: KEY._col0 (type: decimal(7,2)), KEY._col1 (type: 
string), KEY._col2 (type: string), KEY._col3 (type: string), KEY._col4 (type: 
int), KEY._col5 (type: string), KEY._col6 (type: string), KEY._col7 (type: 
string), KEY._col8 (type: string), KEY._col9 (type: string)
                 mode: mergepartial
                 outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7, _col8, _col9, _col10
                 Statistics: Num rows: 463823414 Data size: 40918636268 Basic 
stats: COMPLETE Column stats: NONE
@@ -353,7 +353,7 @@ STAGE PLANS:
     Spark
 #### A masked pattern was here ####
       Vertices:
-        Map 8 
+        Map 7 
             Map Operator Tree:
                 TableScan
                   alias: store
@@ -375,9 +375,9 @@ STAGE PLANS:
   Stage: Stage-1
     Spark
       Edges:
-        Reducer 2 <- Map 1 (PARTITION-LEVEL SORT, 400), Map 7 (PARTITION-LEVEL 
SORT, 400)
-        Reducer 3 <- Map 9 (PARTITION-LEVEL SORT, 1009), Reducer 2 
(PARTITION-LEVEL SORT, 1009)
-        Reducer 4 <- Map 10 (PARTITION-LEVEL SORT, 564), Reducer 3 
(PARTITION-LEVEL SORT, 564)
+        Reducer 2 <- Map 1 (PARTITION-LEVEL SORT, 440), Map 8 (PARTITION-LEVEL 
SORT, 440)
+        Reducer 3 <- Map 9 (PARTITION-LEVEL SORT, 516), Reducer 2 
(PARTITION-LEVEL SORT, 516)
+        Reducer 4 <- Map 10 (PARTITION-LEVEL SORT, 1009), Reducer 3 
(PARTITION-LEVEL SORT, 1009)
         Reducer 5 <- Map 11 (PARTITION-LEVEL SORT, 899), Reducer 4 
(PARTITION-LEVEL SORT, 899)
         Reducer 6 <- Reducer 5 (GROUP PARTITION-LEVEL SORT, 640)
 #### A masked pattern was here ####
@@ -394,29 +394,42 @@ STAGE PLANS:
                       expressions: ss_item_sk (type: int), ss_customer_sk 
(type: int), ss_store_sk (type: int), ss_ticket_number (type: int), 
ss_sales_price (type: decimal(7,2))
                       outputColumnNames: _col0, _col1, _col2, _col3, _col4
                       Statistics: Num rows: 575995635 Data size: 50814502088 
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: 575995635 Data size: 50814502088 
Basic stats: COMPLETE Column stats: NONE
-                        value expressions: _col1 (type: int), _col2 (type: 
int), _col3 (type: int), _col4 (type: decimal(7,2))
+                      Map Join Operator
+                        condition map:
+                             Inner Join 0 to 1
+                        keys:
+                          0 _col2 (type: int)
+                          1 _col0 (type: int)
+                        outputColumnNames: _col0, _col1, _col3, _col4, _col6, 
_col8, _col9
+                        input vertices:
+                          1 Map 7
+                        Statistics: Num rows: 633595212 Data size: 55895953508 
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: 633595212 Data size: 
55895953508 Basic stats: COMPLETE Column stats: NONE
+                          value expressions: _col1 (type: int), _col3 (type: 
int), _col4 (type: decimal(7,2)), _col6 (type: string), _col8 (type: string), 
_col9 (type: string)
+            Local Work:
+              Map Reduce Local Work
         Map 10 
             Map Operator Tree:
                 TableScan
-                  alias: store_returns
-                  Statistics: Num rows: 57591150 Data size: 4462194832 Basic 
stats: COMPLETE Column stats: NONE
+                  alias: customer
+                  Statistics: Num rows: 80000000 Data size: 68801615852 Basic 
stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (sr_item_sk is not null and sr_ticket_number is 
not null) (type: boolean)
-                    Statistics: Num rows: 57591150 Data size: 4462194832 Basic 
stats: COMPLETE Column stats: NONE
+                    predicate: (c_birth_country is not null and c_customer_sk 
is not null) (type: boolean)
+                    Statistics: Num rows: 80000000 Data size: 68801615852 
Basic stats: COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: sr_item_sk (type: int), sr_ticket_number 
(type: int)
-                      outputColumnNames: _col0, _col1
-                      Statistics: Num rows: 57591150 Data size: 4462194832 
Basic stats: COMPLETE Column stats: NONE
+                      expressions: c_customer_sk (type: int), c_first_name 
(type: string), c_last_name (type: string), c_birth_country (type: string)
+                      outputColumnNames: _col0, _col1, _col2, _col3
+                      Statistics: Num rows: 80000000 Data size: 68801615852 
Basic stats: COMPLETE Column stats: NONE
                       Reduce Output Operator
-                        key expressions: _col0 (type: int), _col1 (type: int)
-                        sort order: ++
-                        Map-reduce partition columns: _col0 (type: int), _col1 
(type: int)
-                        Statistics: Num rows: 57591150 Data size: 4462194832 
Basic stats: COMPLETE Column stats: NONE
+                        key expressions: _col0 (type: int)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: int)
+                        Statistics: Num rows: 80000000 Data size: 68801615852 
Basic stats: COMPLETE Column stats: NONE
+                        value expressions: _col1 (type: string), _col2 (type: 
string), _col3 (type: string)
         Map 11 
             Map Operator Tree:
                 TableScan
@@ -435,7 +448,7 @@ STAGE PLANS:
                         Map-reduce partition columns: _col1 (type: string), 
upper(_col2) (type: string)
                         Statistics: Num rows: 40000000 Data size: 40595195284 
Basic stats: COMPLETE Column stats: NONE
                         value expressions: _col0 (type: string)
-        Map 7 
+        Map 8 
             Map Operator Tree:
                 TableScan
                   alias: item
@@ -456,24 +469,21 @@ STAGE PLANS:
         Map 9 
             Map Operator Tree:
                 TableScan
-                  alias: customer
-                  Statistics: Num rows: 80000000 Data size: 68801615852 Basic 
stats: COMPLETE Column stats: NONE
+                  alias: store_returns
+                  Statistics: Num rows: 57591150 Data size: 4462194832 Basic 
stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (c_birth_country is not null and c_customer_sk 
is not null) (type: boolean)
-                    Statistics: Num rows: 80000000 Data size: 68801615852 
Basic stats: COMPLETE Column stats: NONE
+                    predicate: (sr_item_sk is not null and sr_ticket_number is 
not null) (type: boolean)
+                    Statistics: Num rows: 57591150 Data size: 4462194832 Basic 
stats: COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: c_customer_sk (type: int), c_first_name 
(type: string), c_last_name (type: string), c_birth_country (type: string)
-                      outputColumnNames: _col0, _col1, _col2, _col3
-                      Statistics: Num rows: 80000000 Data size: 68801615852 
Basic stats: COMPLETE Column stats: NONE
+                      expressions: sr_item_sk (type: int), sr_ticket_number 
(type: int)
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 57591150 Data size: 4462194832 
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: 80000000 Data size: 68801615852 
Basic stats: COMPLETE Column stats: NONE
-                        value expressions: _col1 (type: string), _col2 (type: 
string), _col3 (type: string)
+                        key expressions: _col0 (type: int), _col1 (type: int)
+                        sort order: ++
+                        Map-reduce partition columns: _col0 (type: int), _col1 
(type: int)
+                        Statistics: Num rows: 57591150 Data size: 4462194832 
Basic stats: COMPLETE Column stats: NONE
         Reducer 2 
-            Local Work:
-              Map Reduce Local Work
             Reduce Operator Tree:
               Join Operator
                 condition map:
@@ -481,74 +491,64 @@ STAGE PLANS:
                 keys:
                   0 _col0 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col6, 
_col7, _col9, _col10
-                Statistics: Num rows: 633595212 Data size: 55895953508 Basic 
stats: COMPLETE Column stats: NONE
-                Map Join Operator
-                  condition map:
-                       Inner Join 0 to 1
-                  keys:
-                    0 _col2 (type: int)
-                    1 _col0 (type: int)
-                  outputColumnNames: _col0, _col1, _col3, _col4, _col6, _col7, 
_col9, _col10, _col12, _col14, _col15
-                  input vertices:
-                    1 Map 8
+                outputColumnNames: _col0, _col1, _col3, _col4, _col6, _col8, 
_col9, _col11, _col12, _col14, _col15
+                Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  key expressions: _col0 (type: int), _col3 (type: int)
+                  sort order: ++
+                  Map-reduce partition columns: _col0 (type: int), _col3 
(type: int)
                   Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col1 (type: int)
-                    sort order: +
-                    Map-reduce partition columns: _col1 (type: int)
-                    Statistics: Num rows: 696954748 Data size: 61485550191 
Basic stats: COMPLETE Column stats: NONE
-                    value expressions: _col0 (type: int), _col3 (type: int), 
_col4 (type: decimal(7,2)), _col6 (type: decimal(7,2)), _col7 (type: string), 
_col9 (type: string), _col10 (type: int), _col12 (type: string), _col14 (type: 
string), _col15 (type: string)
+                  value expressions: _col1 (type: int), _col4 (type: 
decimal(7,2)), _col6 (type: string), _col8 (type: string), _col9 (type: 
string), _col11 (type: decimal(7,2)), _col12 (type: string), _col14 (type: 
string), _col15 (type: int)
         Reducer 3 
             Reduce Operator Tree:
               Join Operator
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 _col1 (type: int)
-                  1 _col0 (type: int)
-                outputColumnNames: _col0, _col3, _col4, _col6, _col7, _col9, 
_col10, _col12, _col14, _col15, _col17, _col18, _col19
+                  0 _col0 (type: int), _col3 (type: int)
+                  1 _col0 (type: int), _col1 (type: int)
+                outputColumnNames: _col1, _col4, _col6, _col8, _col9, _col11, 
_col12, _col14, _col15
                 Statistics: Num rows: 766650239 Data size: 67634106676 Basic 
stats: COMPLETE Column stats: NONE
                 Reduce Output Operator
-                  key expressions: _col0 (type: int), _col3 (type: int)
-                  sort order: ++
-                  Map-reduce partition columns: _col0 (type: int), _col3 
(type: int)
+                  key expressions: _col1 (type: int)
+                  sort order: +
+                  Map-reduce partition columns: _col1 (type: int)
                   Statistics: Num rows: 766650239 Data size: 67634106676 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col4 (type: decimal(7,2)), _col6 (type: 
decimal(7,2)), _col7 (type: string), _col9 (type: string), _col10 (type: int), 
_col12 (type: string), _col14 (type: string), _col15 (type: string), _col17 
(type: string), _col18 (type: string), _col19 (type: string)
+                  value expressions: _col4 (type: decimal(7,2)), _col6 (type: 
string), _col8 (type: string), _col9 (type: string), _col11 (type: 
decimal(7,2)), _col12 (type: string), _col14 (type: string), _col15 (type: int)
         Reducer 4 
             Reduce Operator Tree:
               Join Operator
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 _col0 (type: int), _col3 (type: int)
-                  1 _col0 (type: int), _col1 (type: int)
-                outputColumnNames: _col4, _col6, _col7, _col9, _col10, _col12, 
_col14, _col15, _col17, _col18, _col19
+                  0 _col1 (type: int)
+                  1 _col0 (type: int)
+                outputColumnNames: _col4, _col6, _col8, _col9, _col11, _col12, 
_col14, _col15, _col19, _col20, _col21
                 Statistics: Num rows: 843315281 Data size: 74397518956 Basic 
stats: COMPLETE Column stats: NONE
                 Reduce Output Operator
-                  key expressions: _col15 (type: string), _col19 (type: string)
+                  key expressions: _col9 (type: string), _col21 (type: string)
                   sort order: ++
-                  Map-reduce partition columns: _col15 (type: string), _col19 
(type: string)
+                  Map-reduce partition columns: _col9 (type: string), _col21 
(type: string)
                   Statistics: Num rows: 843315281 Data size: 74397518956 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col4 (type: decimal(7,2)), _col6 (type: 
decimal(7,2)), _col7 (type: string), _col9 (type: string), _col10 (type: int), 
_col12 (type: string), _col14 (type: string), _col17 (type: string), _col18 
(type: string)
+                  value expressions: _col4 (type: decimal(7,2)), _col6 (type: 
string), _col8 (type: string), _col11 (type: decimal(7,2)), _col12 (type: 
string), _col14 (type: string), _col15 (type: int), _col19 (type: string), 
_col20 (type: string)
         Reducer 5 
             Reduce Operator Tree:
               Join Operator
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 _col15 (type: string), _col19 (type: string)
+                  0 _col9 (type: string), _col21 (type: string)
                   1 _col1 (type: string), upper(_col2) (type: string)
-                outputColumnNames: _col4, _col6, _col7, _col9, _col10, _col12, 
_col14, _col17, _col18, _col22
+                outputColumnNames: _col4, _col6, _col8, _col11, _col12, 
_col14, _col15, _col19, _col20, _col22
                 Statistics: Num rows: 927646829 Data size: 81837272625 Basic 
stats: COMPLETE Column stats: NONE
                 Group By Operator
                   aggregations: sum(_col4)
-                  keys: _col17 (type: string), _col18 (type: string), _col12 
(type: string), _col22 (type: string), _col6 (type: decimal(7,2)), _col7 (type: 
string), _col9 (type: string), _col10 (type: int), _col14 (type: string)
+                  keys: _col19 (type: string), _col20 (type: string), _col6 
(type: string), _col22 (type: string), _col8 (type: string), _col11 (type: 
decimal(7,2)), _col12 (type: string), _col14 (type: string), _col15 (type: int)
                   mode: hash
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7, _col8, _col9
                   Statistics: Num rows: 927646829 Data size: 81837272625 Basic 
stats: COMPLETE Column stats: NONE
                   Reduce Output Operator
-                    key expressions: _col0 (type: string), _col1 (type: 
string), _col2 (type: string), _col3 (type: string), _col4 (type: 
decimal(7,2)), _col5 (type: string), _col6 (type: string), _col7 (type: int), 
_col8 (type: string)
+                    key expressions: _col0 (type: string), _col1 (type: 
string), _col2 (type: string), _col3 (type: string), _col4 (type: string), 
_col5 (type: decimal(7,2)), _col6 (type: string), _col7 (type: string), _col8 
(type: int)
                     sort order: +++++++++
                     Map-reduce partition columns: _col0 (type: string), _col1 
(type: string), _col2 (type: string)
                     Statistics: Num rows: 927646829 Data size: 81837272625 
Basic stats: COMPLETE Column stats: NONE
@@ -559,17 +559,17 @@ STAGE PLANS:
             Reduce Operator Tree:
               Group By Operator
                 aggregations: sum(VALUE._col0)
-                keys: KEY._col0 (type: string), KEY._col1 (type: string), 
KEY._col2 (type: string), KEY._col3 (type: string), KEY._col4 (type: 
decimal(7,2)), KEY._col5 (type: string), KEY._col6 (type: string), KEY._col7 
(type: int), KEY._col8 (type: string)
+                keys: KEY._col0 (type: string), KEY._col1 (type: string), 
KEY._col2 (type: string), KEY._col3 (type: string), KEY._col4 (type: string), 
KEY._col5 (type: decimal(7,2)), KEY._col6 (type: string), KEY._col7 (type: 
string), KEY._col8 (type: int)
                 mode: mergepartial
                 outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7, _col8, _col9
                 Statistics: Num rows: 463823414 Data size: 40918636268 Basic 
stats: COMPLETE Column stats: NONE
                 Select Operator
                   expressions: _col0 (type: string), _col1 (type: string), 
_col2 (type: string), _col9 (type: decimal(17,2))
-                  outputColumnNames: _col1, _col2, _col7, _col9
+                  outputColumnNames: _col1, _col2, _col3, _col9
                   Statistics: Num rows: 463823414 Data size: 40918636268 Basic 
stats: COMPLETE Column stats: NONE
                   Group By Operator
                     aggregations: sum(_col9)
-                    keys: _col1 (type: string), _col2 (type: string), _col7 
(type: string)
+                    keys: _col1 (type: string), _col2 (type: string), _col3 
(type: string)
                     mode: complete
                     outputColumnNames: _col0, _col1, _col2, _col3
                     Statistics: Num rows: 231911707 Data size: 20459318134 
Basic stats: COMPLETE Column stats: NONE

http://git-wip-us.apache.org/repos/asf/hive/blob/328d3f93/ql/src/test/results/clientpositive/perf/spark/query25.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query25.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query25.q.out
index 3ecb2e5..ddfcb83 100644
--- a/ql/src/test/results/clientpositive/perf/spark/query25.q.out
+++ b/ql/src/test/results/clientpositive/perf/spark/query25.q.out
@@ -127,7 +127,7 @@ STAGE PLANS:
     Spark
 #### A masked pattern was here ####
       Vertices:
-        Map 10 
+        Map 11 
             Map Operator Tree:
                 TableScan
                   alias: d3
@@ -150,7 +150,7 @@ STAGE PLANS:
     Spark
 #### A masked pattern was here ####
       Vertices:
-        Map 12 
+        Map 13 
             Map Operator Tree:
                 TableScan
                   alias: d2
@@ -172,12 +172,12 @@ STAGE PLANS:
   Stage: Stage-1
     Spark
       Edges:
+        Reducer 10 <- Map 12 (PARTITION-LEVEL SORT, 374), Map 9 
(PARTITION-LEVEL SORT, 374)
         Reducer 2 <- Map 1 (PARTITION-LEVEL SORT, 398), Map 7 (PARTITION-LEVEL 
SORT, 398)
-        Reducer 3 <- Reducer 2 (PARTITION-LEVEL SORT, 806), Reducer 9 
(PARTITION-LEVEL SORT, 806)
-        Reducer 4 <- Map 13 (PARTITION-LEVEL SORT, 486), Reducer 3 
(PARTITION-LEVEL SORT, 486)
+        Reducer 3 <- Map 8 (PARTITION-LEVEL SORT, 442), Reducer 2 
(PARTITION-LEVEL SORT, 442)
+        Reducer 4 <- Reducer 10 (PARTITION-LEVEL SORT, 850), Reducer 3 
(PARTITION-LEVEL SORT, 850)
         Reducer 5 <- Reducer 4 (GROUP, 582)
         Reducer 6 <- Reducer 5 (SORT, 1)
-        Reducer 9 <- Map 11 (PARTITION-LEVEL SORT, 374), Map 8 
(PARTITION-LEVEL SORT, 374)
 #### A masked pattern was here ####
       Vertices:
         Map 1 
@@ -198,7 +198,7 @@ STAGE PLANS:
                         Map-reduce partition columns: _col0 (type: int)
                         Statistics: Num rows: 575995635 Data size: 50814502088 
Basic stats: COMPLETE Column stats: NONE
                         value expressions: _col1 (type: int), _col2 (type: 
int), _col3 (type: int), _col4 (type: int), _col5 (type: decimal(7,2))
-        Map 11 
+        Map 12 
             Map Operator Tree:
                 TableScan
                   alias: store_returns
@@ -218,7 +218,7 @@ STAGE PLANS:
                           1 _col0 (type: int)
                         outputColumnNames: _col1, _col2, _col3, _col4
                         input vertices:
-                          1 Map 12
+                          1 Map 13
                         Statistics: Num rows: 63350266 Data size: 4908414421 
Basic stats: COMPLETE Column stats: NONE
                         Reduce Output Operator
                           key expressions: _col1 (type: int), _col2 (type: int)
@@ -228,24 +228,6 @@ STAGE PLANS:
                           value expressions: _col3 (type: int), _col4 (type: 
decimal(7,2))
             Local Work:
               Map Reduce Local Work
-        Map 13 
-            Map Operator Tree:
-                TableScan
-                  alias: item
-                  Statistics: Num rows: 462000 Data size: 663560457 Basic 
stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: i_item_sk is not null (type: boolean)
-                    Statistics: Num rows: 462000 Data size: 663560457 Basic 
stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: i_item_sk (type: int), i_item_id (type: 
string), i_item_desc (type: string)
-                      outputColumnNames: _col0, _col1, _col2
-                      Statistics: Num rows: 462000 Data size: 663560457 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: 462000 Data size: 663560457 
Basic stats: COMPLETE Column stats: NONE
-                        value expressions: _col1 (type: string), _col2 (type: 
string)
         Map 7 
             Map Operator Tree:
                 TableScan
@@ -266,6 +248,24 @@ STAGE PLANS:
         Map 8 
             Map Operator Tree:
                 TableScan
+                  alias: item
+                  Statistics: Num rows: 462000 Data size: 663560457 Basic 
stats: COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: i_item_sk is not null (type: boolean)
+                    Statistics: Num rows: 462000 Data size: 663560457 Basic 
stats: COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: i_item_sk (type: int), i_item_id (type: 
string), i_item_desc (type: string)
+                      outputColumnNames: _col0, _col1, _col2
+                      Statistics: Num rows: 462000 Data size: 663560457 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: 462000 Data size: 663560457 
Basic stats: COMPLETE Column stats: NONE
+                        value expressions: _col1 (type: string), _col2 (type: 
string)
+        Map 9 
+            Map Operator Tree:
+                TableScan
                   alias: catalog_sales
                   Statistics: Num rows: 287989836 Data size: 38999608952 Basic 
stats: COMPLETE Column stats: NONE
                   Filter Operator
@@ -283,7 +283,7 @@ STAGE PLANS:
                           1 _col0 (type: int)
                         outputColumnNames: _col1, _col2, _col3
                         input vertices:
-                          1 Map 10
+                          1 Map 11
                         Statistics: Num rows: 316788826 Data size: 42899570777 
Basic stats: COMPLETE Column stats: NONE
                         Reduce Output Operator
                           key expressions: _col2 (type: int), _col1 (type: int)
@@ -293,6 +293,22 @@ STAGE PLANS:
                           value expressions: _col3 (type: decimal(7,2))
             Local Work:
               Map Reduce Local Work
+        Reducer 10 
+            Reduce Operator Tree:
+              Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                keys:
+                  0 _col2 (type: int), _col1 (type: int)
+                  1 _col1 (type: int), _col2 (type: int)
+                outputColumnNames: _col3, _col8, _col9, _col10, _col11
+                Statistics: Num rows: 348467716 Data size: 47189528877 Basic 
stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  key expressions: _col8 (type: int), _col9 (type: int), 
_col10 (type: int)
+                  sort order: +++
+                  Map-reduce partition columns: _col8 (type: int), _col9 
(type: int), _col10 (type: int)
+                  Statistics: Num rows: 348467716 Data size: 47189528877 Basic 
stats: COMPLETE Column stats: NONE
+                  value expressions: _col3 (type: decimal(7,2)), _col11 (type: 
decimal(7,2))
         Reducer 2 
             Reduce Operator Tree:
               Join Operator
@@ -304,27 +320,27 @@ STAGE PLANS:
                 outputColumnNames: _col1, _col2, _col3, _col4, _col5
                 Statistics: Num rows: 633595212 Data size: 55895953508 Basic 
stats: COMPLETE Column stats: NONE
                 Reduce Output Operator
-                  key expressions: _col1 (type: int), _col2 (type: int), _col4 
(type: int)
-                  sort order: +++
-                  Map-reduce partition columns: _col1 (type: int), _col2 
(type: int), _col4 (type: int)
+                  key expressions: _col1 (type: int)
+                  sort order: +
+                  Map-reduce partition columns: _col1 (type: int)
                   Statistics: Num rows: 633595212 Data size: 55895953508 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col3 (type: int), _col5 (type: 
decimal(7,2))
+                  value expressions: _col2 (type: int), _col3 (type: int), 
_col4 (type: int), _col5 (type: decimal(7,2))
         Reducer 3 
             Reduce Operator Tree:
               Join Operator
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 _col1 (type: int), _col2 (type: int), _col4 (type: int)
-                  1 _col8 (type: int), _col9 (type: int), _col10 (type: int)
-                outputColumnNames: _col1, _col3, _col5, _col12, _col20
+                  0 _col1 (type: int)
+                  1 _col0 (type: int)
+                outputColumnNames: _col1, _col2, _col3, _col4, _col5, _col10, 
_col11
                 Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
                 Reduce Output Operator
-                  key expressions: _col1 (type: int)
-                  sort order: +
-                  Map-reduce partition columns: _col1 (type: int)
+                  key expressions: _col1 (type: int), _col2 (type: int), _col4 
(type: int)
+                  sort order: +++
+                  Map-reduce partition columns: _col1 (type: int), _col2 
(type: int), _col4 (type: int)
                   Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col3 (type: int), _col5 (type: 
decimal(7,2)), _col12 (type: decimal(7,2)), _col20 (type: decimal(7,2))
+                  value expressions: _col3 (type: int), _col5 (type: 
decimal(7,2)), _col10 (type: string), _col11 (type: string)
         Reducer 4 
             Local Work:
               Map Reduce Local Work
@@ -333,9 +349,9 @@ STAGE PLANS:
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 _col1 (type: int)
-                  1 _col0 (type: int)
-                outputColumnNames: _col3, _col5, _col12, _col20, _col25, _col26
+                  0 _col1 (type: int), _col2 (type: int), _col4 (type: int)
+                  1 _col8 (type: int), _col9 (type: int), _col10 (type: int)
+                outputColumnNames: _col3, _col5, _col10, _col11, _col15, _col23
                 Statistics: Num rows: 766650239 Data size: 67634106676 Basic 
stats: COMPLETE Column stats: NONE
                 Map Join Operator
                   condition map:
@@ -343,13 +359,13 @@ STAGE PLANS:
                   keys:
                     0 _col3 (type: int)
                     1 _col0 (type: int)
-                  outputColumnNames: _col5, _col12, _col20, _col25, _col26, 
_col28, _col29
+                  outputColumnNames: _col5, _col10, _col11, _col15, _col23, 
_col28, _col29
                   input vertices:
                     1 Map 14
                   Statistics: Num rows: 843315281 Data size: 74397518956 Basic 
stats: COMPLETE Column stats: NONE
                   Group By Operator
-                    aggregations: sum(_col5), sum(_col20), sum(_col12)
-                    keys: _col25 (type: string), _col26 (type: string), _col28 
(type: string), _col29 (type: string)
+                    aggregations: sum(_col5), sum(_col23), sum(_col15)
+                    keys: _col10 (type: string), _col11 (type: string), _col28 
(type: string), _col29 (type: string)
                     mode: hash
                     outputColumnNames: _col0, _col1, _col2, _col3, _col4, 
_col5, _col6
                     Statistics: Num rows: 843315281 Data size: 74397518956 
Basic stats: COMPLETE Column stats: NONE
@@ -390,22 +406,6 @@ STAGE PLANS:
                         input format: 
org.apache.hadoop.mapred.SequenceFileInputFormat
                         output format: 
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
                         serde: 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-        Reducer 9 
-            Reduce Operator Tree:
-              Join Operator
-                condition map:
-                     Inner Join 0 to 1
-                keys:
-                  0 _col2 (type: int), _col1 (type: int)
-                  1 _col1 (type: int), _col2 (type: int)
-                outputColumnNames: _col3, _col8, _col9, _col10, _col11
-                Statistics: Num rows: 348467716 Data size: 47189528877 Basic 
stats: COMPLETE Column stats: NONE
-                Reduce Output Operator
-                  key expressions: _col8 (type: int), _col9 (type: int), 
_col10 (type: int)
-                  sort order: +++
-                  Map-reduce partition columns: _col8 (type: int), _col9 
(type: int), _col10 (type: int)
-                  Statistics: Num rows: 348467716 Data size: 47189528877 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col3 (type: decimal(7,2)), _col11 (type: 
decimal(7,2))
 
   Stage: Stage-0
     Fetch Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/328d3f93/ql/src/test/results/clientpositive/perf/spark/query29.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query29.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query29.q.out
index 530a625..456fce7 100644
--- a/ql/src/test/results/clientpositive/perf/spark/query29.q.out
+++ b/ql/src/test/results/clientpositive/perf/spark/query29.q.out
@@ -124,7 +124,7 @@ STAGE PLANS:
     Spark
 #### A masked pattern was here ####
       Vertices:
-        Map 13 
+        Map 14 
             Map Operator Tree:
                 TableScan
                   alias: d2
@@ -146,51 +146,51 @@ STAGE PLANS:
   Stage: Stage-1
     Spark
       Edges:
-        Reducer 10 <- Map 14 (PARTITION-LEVEL SORT, 486), Reducer 9 
(PARTITION-LEVEL SORT, 486)
-        Reducer 2 <- Map 1 (PARTITION-LEVEL SORT, 306), Map 6 (PARTITION-LEVEL 
SORT, 306)
-        Reducer 3 <- Reducer 10 (PARTITION-LEVEL SORT, 917), Reducer 2 
(PARTITION-LEVEL SORT, 917)
-        Reducer 4 <- Reducer 3 (GROUP, 640)
-        Reducer 5 <- Reducer 4 (SORT, 1)
-        Reducer 8 <- Map 11 (PARTITION-LEVEL SORT, 398), Map 7 
(PARTITION-LEVEL SORT, 398)
-        Reducer 9 <- Map 12 (PARTITION-LEVEL SORT, 476), Reducer 8 
(PARTITION-LEVEL SORT, 476)
+        Reducer 10 <- Map 12 (PARTITION-LEVEL SORT, 306), Map 9 
(PARTITION-LEVEL SORT, 306)
+        Reducer 11 <- Map 13 (PARTITION-LEVEL SORT, 374), Reducer 10 
(PARTITION-LEVEL SORT, 374)
+        Reducer 2 <- Map 1 (PARTITION-LEVEL SORT, 398), Map 7 (PARTITION-LEVEL 
SORT, 398)
+        Reducer 3 <- Map 8 (PARTITION-LEVEL SORT, 442), Reducer 2 
(PARTITION-LEVEL SORT, 442)
+        Reducer 4 <- Reducer 11 (PARTITION-LEVEL SORT, 850), Reducer 3 
(PARTITION-LEVEL SORT, 850)
+        Reducer 5 <- Reducer 4 (GROUP, 582)
+        Reducer 6 <- Reducer 5 (SORT, 1)
 #### A masked pattern was here ####
       Vertices:
         Map 1 
             Map Operator Tree:
                 TableScan
-                  alias: catalog_sales
-                  Statistics: Num rows: 287989836 Data size: 38999608952 Basic 
stats: COMPLETE Column stats: NONE
+                  alias: store_sales
+                  Statistics: Num rows: 575995635 Data size: 50814502088 Basic 
stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (cs_bill_customer_sk is not null and cs_item_sk 
is not null and cs_sold_date_sk is not null) (type: boolean)
-                    Statistics: Num rows: 287989836 Data size: 38999608952 
Basic stats: COMPLETE Column stats: NONE
+                    predicate: (ss_customer_sk is not null and ss_item_sk is 
not null and ss_sold_date_sk is not null and ss_store_sk is not null and 
ss_ticket_number is not null) (type: boolean)
+                    Statistics: Num rows: 575995635 Data size: 50814502088 
Basic stats: COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: cs_sold_date_sk (type: int), 
cs_bill_customer_sk (type: int), cs_item_sk (type: int), cs_quantity (type: int)
-                      outputColumnNames: _col0, _col1, _col2, _col3
-                      Statistics: Num rows: 287989836 Data size: 38999608952 
Basic stats: COMPLETE Column stats: NONE
+                      expressions: ss_sold_date_sk (type: int), ss_item_sk 
(type: int), ss_customer_sk (type: int), ss_store_sk (type: int), 
ss_ticket_number (type: int), ss_quantity (type: int)
+                      outputColumnNames: _col0, _col1, _col2, _col3, _col4, 
_col5
+                      Statistics: Num rows: 575995635 Data size: 50814502088 
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: 287989836 Data size: 38999608952 
Basic stats: COMPLETE Column stats: NONE
-                        value expressions: _col1 (type: int), _col2 (type: 
int), _col3 (type: int)
-        Map 11 
+                        Statistics: Num rows: 575995635 Data size: 50814502088 
Basic stats: COMPLETE Column stats: NONE
+                        value expressions: _col1 (type: int), _col2 (type: 
int), _col3 (type: int), _col4 (type: int), _col5 (type: int)
+        Map 12 
             Map Operator Tree:
                 TableScan
-                  alias: d1
+                  alias: d3
                   Statistics: Num rows: 73049 Data size: 81741831 Basic stats: 
COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((d_moy = 4) and (d_year = 1999) and d_date_sk 
is not null) (type: boolean)
-                    Statistics: Num rows: 18262 Data size: 20435178 Basic 
stats: COMPLETE Column stats: NONE
+                    predicate: ((d_year) IN (1999, 2000, 2001) and d_date_sk 
is not null) (type: boolean)
+                    Statistics: Num rows: 36525 Data size: 40871475 Basic 
stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: d_date_sk (type: int)
                       outputColumnNames: _col0
-                      Statistics: Num rows: 18262 Data size: 20435178 Basic 
stats: COMPLETE Column stats: NONE
+                      Statistics: Num rows: 36525 Data size: 40871475 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: 18262 Data size: 20435178 Basic 
stats: COMPLETE Column stats: NONE
-        Map 12 
+                        Statistics: Num rows: 36525 Data size: 40871475 Basic 
stats: COMPLETE Column stats: NONE
+        Map 13 
             Map Operator Tree:
                 TableScan
                   alias: store_returns
@@ -210,17 +210,34 @@ STAGE PLANS:
                           1 _col0 (type: int)
                         outputColumnNames: _col1, _col2, _col3, _col4
                         input vertices:
-                          1 Map 13
+                          1 Map 14
                         Statistics: Num rows: 63350266 Data size: 4908414421 
Basic stats: COMPLETE Column stats: NONE
                         Reduce Output Operator
-                          key expressions: _col1 (type: int), _col2 (type: 
int), _col3 (type: int)
-                          sort order: +++
-                          Map-reduce partition columns: _col1 (type: int), 
_col2 (type: int), _col3 (type: int)
+                          key expressions: _col1 (type: int), _col2 (type: int)
+                          sort order: ++
+                          Map-reduce partition columns: _col1 (type: int), 
_col2 (type: int)
                           Statistics: Num rows: 63350266 Data size: 4908414421 
Basic stats: COMPLETE Column stats: NONE
-                          value expressions: _col4 (type: int)
+                          value expressions: _col3 (type: int), _col4 (type: 
int)
             Local Work:
               Map Reduce Local Work
-        Map 14 
+        Map 7 
+            Map Operator Tree:
+                TableScan
+                  alias: d1
+                  Statistics: Num rows: 73049 Data size: 81741831 Basic stats: 
COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: ((d_moy = 4) and (d_year = 1999) and d_date_sk 
is not null) (type: boolean)
+                    Statistics: Num rows: 18262 Data size: 20435178 Basic 
stats: COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: d_date_sk (type: int)
+                      outputColumnNames: _col0
+                      Statistics: Num rows: 18262 Data size: 20435178 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: 18262 Data size: 20435178 Basic 
stats: COMPLETE Column stats: NONE
+        Map 8 
             Map Operator Tree:
                 TableScan
                   alias: item
@@ -238,73 +255,56 @@ STAGE PLANS:
                         Map-reduce partition columns: _col0 (type: int)
                         Statistics: Num rows: 462000 Data size: 663560457 
Basic stats: COMPLETE Column stats: NONE
                         value expressions: _col1 (type: string), _col2 (type: 
string)
-        Map 6 
+        Map 9 
             Map Operator Tree:
                 TableScan
-                  alias: d3
-                  Statistics: Num rows: 73049 Data size: 81741831 Basic stats: 
COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: ((d_year) IN (1999, 2000, 2001) and d_date_sk 
is not null) (type: boolean)
-                    Statistics: Num rows: 36525 Data size: 40871475 Basic 
stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: d_date_sk (type: int)
-                      outputColumnNames: _col0
-                      Statistics: Num rows: 36525 Data size: 40871475 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: 36525 Data size: 40871475 Basic 
stats: COMPLETE Column stats: NONE
-        Map 7 
-            Map Operator Tree:
-                TableScan
-                  alias: store_sales
-                  Statistics: Num rows: 575995635 Data size: 50814502088 Basic 
stats: COMPLETE Column stats: NONE
+                  alias: catalog_sales
+                  Statistics: Num rows: 287989836 Data size: 38999608952 Basic 
stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (ss_customer_sk is not null and ss_item_sk is 
not null and ss_sold_date_sk is not null and ss_store_sk is not null and 
ss_ticket_number is not null) (type: boolean)
-                    Statistics: Num rows: 575995635 Data size: 50814502088 
Basic stats: COMPLETE Column stats: NONE
+                    predicate: (cs_bill_customer_sk is not null and cs_item_sk 
is not null and cs_sold_date_sk is not null) (type: boolean)
+                    Statistics: Num rows: 287989836 Data size: 38999608952 
Basic stats: COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: ss_sold_date_sk (type: int), ss_item_sk 
(type: int), ss_customer_sk (type: int), ss_store_sk (type: int), 
ss_ticket_number (type: int), ss_quantity (type: int)
-                      outputColumnNames: _col0, _col1, _col2, _col3, _col4, 
_col5
-                      Statistics: Num rows: 575995635 Data size: 50814502088 
Basic stats: COMPLETE Column stats: NONE
+                      expressions: cs_sold_date_sk (type: int), 
cs_bill_customer_sk (type: int), cs_item_sk (type: int), cs_quantity (type: int)
+                      outputColumnNames: _col0, _col1, _col2, _col3
+                      Statistics: Num rows: 287989836 Data size: 38999608952 
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: 575995635 Data size: 50814502088 
Basic stats: COMPLETE Column stats: NONE
-                        value expressions: _col1 (type: int), _col2 (type: 
int), _col3 (type: int), _col4 (type: int), _col5 (type: int)
+                        Statistics: Num rows: 287989836 Data size: 38999608952 
Basic stats: COMPLETE Column stats: NONE
+                        value expressions: _col1 (type: int), _col2 (type: 
int), _col3 (type: int)
         Reducer 10 
-            Local Work:
-              Map Reduce Local Work
             Reduce Operator Tree:
               Join Operator
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 _col1 (type: int)
+                  0 _col0 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col3, _col5, _col10, _col11, _col13, 
_col18, _col19
-                Statistics: Num rows: 766650239 Data size: 67634106676 Basic 
stats: COMPLETE Column stats: NONE
-                Map Join Operator
-                  condition map:
-                       Inner Join 0 to 1
-                  keys:
-                    0 _col3 (type: int)
-                    1 _col0 (type: int)
-                  outputColumnNames: _col5, _col10, _col11, _col13, _col18, 
_col19, _col21, _col22
-                  input vertices:
-                    1 Map 15
-                  Statistics: Num rows: 843315281 Data size: 74397518956 Basic 
stats: COMPLETE Column stats: NONE
-                  Select Operator
-                    expressions: _col18 (type: string), _col19 (type: string), 
_col5 (type: int), _col10 (type: int), _col11 (type: int), _col13 (type: int), 
_col21 (type: string), _col22 (type: string)
-                    outputColumnNames: _col1, _col2, _col8, _col13, _col14, 
_col16, _col21, _col22
-                    Statistics: Num rows: 843315281 Data size: 74397518956 
Basic stats: COMPLETE Column stats: NONE
-                    Reduce Output Operator
-                      key expressions: _col14 (type: int), _col13 (type: int)
-                      sort order: ++
-                      Map-reduce partition columns: _col14 (type: int), _col13 
(type: int)
-                      Statistics: Num rows: 843315281 Data size: 74397518956 
Basic stats: COMPLETE Column stats: NONE
-                      value expressions: _col1 (type: string), _col2 (type: 
string), _col8 (type: int), _col16 (type: int), _col21 (type: string), _col22 
(type: string)
+                outputColumnNames: _col1, _col2, _col3
+                Statistics: Num rows: 316788826 Data size: 42899570777 Basic 
stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  key expressions: _col2 (type: int), _col1 (type: int)
+                  sort order: ++
+                  Map-reduce partition columns: _col2 (type: int), _col1 
(type: int)
+                  Statistics: Num rows: 316788826 Data size: 42899570777 Basic 
stats: COMPLETE Column stats: NONE
+                  value expressions: _col3 (type: int)
+        Reducer 11 
+            Reduce Operator Tree:
+              Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                keys:
+                  0 _col2 (type: int), _col1 (type: int)
+                  1 _col1 (type: int), _col2 (type: int)
+                outputColumnNames: _col3, _col7, _col8, _col9, _col10
+                Statistics: Num rows: 348467716 Data size: 47189528877 Basic 
stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  key expressions: _col7 (type: int), _col8 (type: int), _col9 
(type: int)
+                  sort order: +++
+                  Map-reduce partition columns: _col7 (type: int), _col8 
(type: int), _col9 (type: int)
+                  Statistics: Num rows: 348467716 Data size: 47189528877 Basic 
stats: COMPLETE Column stats: NONE
+                  value expressions: _col3 (type: int), _col10 (type: int)
         Reducer 2 
             Reduce Operator Tree:
               Join Operator
@@ -313,57 +313,85 @@ STAGE PLANS:
                 keys:
                   0 _col0 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col1, _col2, _col3
-                Statistics: Num rows: 316788826 Data size: 42899570777 Basic 
stats: COMPLETE Column stats: NONE
+                outputColumnNames: _col1, _col2, _col3, _col4, _col5
+                Statistics: Num rows: 633595212 Data size: 55895953508 Basic 
stats: COMPLETE Column stats: NONE
                 Reduce Output Operator
-                  key expressions: _col1 (type: int), _col2 (type: int)
-                  sort order: ++
-                  Map-reduce partition columns: _col1 (type: int), _col2 
(type: int)
-                  Statistics: Num rows: 316788826 Data size: 42899570777 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col3 (type: int)
+                  key expressions: _col1 (type: int)
+                  sort order: +
+                  Map-reduce partition columns: _col1 (type: int)
+                  Statistics: Num rows: 633595212 Data size: 55895953508 Basic 
stats: COMPLETE Column stats: NONE
+                  value expressions: _col2 (type: int), _col3 (type: int), 
_col4 (type: int), _col5 (type: int)
         Reducer 3 
             Reduce Operator Tree:
               Join Operator
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 _col1 (type: int), _col2 (type: int)
-                  1 _col14 (type: int), _col13 (type: int)
-                outputColumnNames: _col3, _col7, _col8, _col14, _col22, 
_col27, _col28
-                Statistics: Num rows: 927646829 Data size: 81837272625 Basic 
stats: COMPLETE Column stats: NONE
-                Group By Operator
-                  aggregations: sum(_col14), sum(_col22), sum(_col3)
-                  keys: _col7 (type: string), _col8 (type: string), _col27 
(type: string), _col28 (type: string)
-                  mode: hash
-                  outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6
-                  Statistics: Num rows: 927646829 Data size: 81837272625 Basic 
stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string), _col1 (type: 
string), _col2 (type: string), _col3 (type: string)
-                    sort order: ++++
-                    Map-reduce partition columns: _col0 (type: string), _col1 
(type: string), _col2 (type: string), _col3 (type: string)
-                    Statistics: Num rows: 927646829 Data size: 81837272625 
Basic stats: COMPLETE Column stats: NONE
-                    TopN Hash Memory Usage: 0.1
-                    value expressions: _col4 (type: bigint), _col5 (type: 
bigint), _col6 (type: bigint)
+                  0 _col1 (type: int)
+                  1 _col0 (type: int)
+                outputColumnNames: _col1, _col2, _col3, _col4, _col5, _col10, 
_col11
+                Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  key expressions: _col1 (type: int), _col2 (type: int), _col4 
(type: int)
+                  sort order: +++
+                  Map-reduce partition columns: _col1 (type: int), _col2 
(type: int), _col4 (type: int)
+                  Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
+                  value expressions: _col3 (type: int), _col5 (type: int), 
_col10 (type: string), _col11 (type: string)
         Reducer 4 
+            Local Work:
+              Map Reduce Local Work
+            Reduce Operator Tree:
+              Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                keys:
+                  0 _col1 (type: int), _col2 (type: int), _col4 (type: int)
+                  1 _col7 (type: int), _col8 (type: int), _col9 (type: int)
+                outputColumnNames: _col3, _col5, _col10, _col11, _col15, _col22
+                Statistics: Num rows: 766650239 Data size: 67634106676 Basic 
stats: COMPLETE Column stats: NONE
+                Map Join Operator
+                  condition map:
+                       Inner Join 0 to 1
+                  keys:
+                    0 _col3 (type: int)
+                    1 _col0 (type: int)
+                  outputColumnNames: _col5, _col10, _col11, _col15, _col22, 
_col27, _col28
+                  input vertices:
+                    1 Map 15
+                  Statistics: Num rows: 843315281 Data size: 74397518956 Basic 
stats: COMPLETE Column stats: NONE
+                  Group By Operator
+                    aggregations: sum(_col5), sum(_col22), sum(_col15)
+                    keys: _col10 (type: string), _col11 (type: string), _col27 
(type: string), _col28 (type: string)
+                    mode: hash
+                    outputColumnNames: _col0, _col1, _col2, _col3, _col4, 
_col5, _col6
+                    Statistics: Num rows: 843315281 Data size: 74397518956 
Basic stats: COMPLETE Column stats: NONE
+                    Reduce Output Operator
+                      key expressions: _col0 (type: string), _col1 (type: 
string), _col2 (type: string), _col3 (type: string)
+                      sort order: ++++
+                      Map-reduce partition columns: _col0 (type: string), 
_col1 (type: string), _col2 (type: string), _col3 (type: string)
+                      Statistics: Num rows: 843315281 Data size: 74397518956 
Basic stats: COMPLETE Column stats: NONE
+                      TopN Hash Memory Usage: 0.1
+                      value expressions: _col4 (type: bigint), _col5 (type: 
bigint), _col6 (type: bigint)
+        Reducer 5 
             Reduce Operator Tree:
               Group By Operator
                 aggregations: sum(VALUE._col0), sum(VALUE._col1), 
sum(VALUE._col2)
                 keys: KEY._col0 (type: string), KEY._col1 (type: string), 
KEY._col2 (type: string), KEY._col3 (type: string)
                 mode: mergepartial
                 outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6
-                Statistics: Num rows: 463823414 Data size: 40918636268 Basic 
stats: COMPLETE Column stats: NONE
+                Statistics: Num rows: 421657640 Data size: 37198759433 Basic 
stats: COMPLETE Column stats: NONE
                 Reduce Output Operator
                   key expressions: _col0 (type: string), _col1 (type: string), 
_col2 (type: string), _col3 (type: string)
                   sort order: ++++
-                  Statistics: Num rows: 463823414 Data size: 40918636268 Basic 
stats: COMPLETE Column stats: NONE
+                  Statistics: Num rows: 421657640 Data size: 37198759433 Basic 
stats: COMPLETE Column stats: NONE
                   TopN Hash Memory Usage: 0.1
                   value expressions: _col4 (type: bigint), _col5 (type: 
bigint), _col6 (type: bigint)
-        Reducer 5 
+        Reducer 6 
             Reduce Operator Tree:
               Select Operator
                 expressions: KEY.reducesinkkey0 (type: string), 
KEY.reducesinkkey1 (type: string), KEY.reducesinkkey2 (type: string), 
KEY.reducesinkkey3 (type: string), VALUE._col0 (type: bigint), VALUE._col1 
(type: bigint), VALUE._col2 (type: bigint)
                 outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6
-                Statistics: Num rows: 463823414 Data size: 40918636268 Basic 
stats: COMPLETE Column stats: NONE
+                Statistics: Num rows: 421657640 Data size: 37198759433 Basic 
stats: COMPLETE Column stats: NONE
                 Limit
                   Number of rows: 100
                   Statistics: Num rows: 100 Data size: 8800 Basic stats: 
COMPLETE Column stats: NONE
@@ -374,38 +402,6 @@ STAGE PLANS:
                         input format: 
org.apache.hadoop.mapred.SequenceFileInputFormat
                         output format: 
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
                         serde: 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-        Reducer 8 
-            Reduce Operator Tree:
-              Join Operator
-                condition map:
-                     Inner Join 0 to 1
-                keys:
-                  0 _col0 (type: int)
-                  1 _col0 (type: int)
-                outputColumnNames: _col1, _col2, _col3, _col4, _col5
-                Statistics: Num rows: 633595212 Data size: 55895953508 Basic 
stats: COMPLETE Column stats: NONE
-                Reduce Output Operator
-                  key expressions: _col1 (type: int), _col2 (type: int), _col4 
(type: int)
-                  sort order: +++
-                  Map-reduce partition columns: _col1 (type: int), _col2 
(type: int), _col4 (type: int)
-                  Statistics: Num rows: 633595212 Data size: 55895953508 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col3 (type: int), _col5 (type: int)
-        Reducer 9 
-            Reduce Operator Tree:
-              Join Operator
-                condition map:
-                     Inner Join 0 to 1
-                keys:
-                  0 _col1 (type: int), _col2 (type: int), _col4 (type: int)
-                  1 _col1 (type: int), _col2 (type: int), _col3 (type: int)
-                outputColumnNames: _col1, _col3, _col5, _col10, _col11, _col13
-                Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
-                Reduce Output Operator
-                  key expressions: _col1 (type: int)
-                  sort order: +
-                  Map-reduce partition columns: _col1 (type: int)
-                  Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col3 (type: int), _col5 (type: int), 
_col10 (type: int), _col11 (type: int), _col13 (type: int)
 
   Stage: Stage-0
     Fetch Operator

Reply via email to