http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/spark/query66.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query66.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query66.q.out
index e8ef1dc..80723d8 100644
--- a/ql/src/test/results/clientpositive/perf/spark/query66.q.out
+++ b/ql/src/test/results/clientpositive/perf/spark/query66.q.out
@@ -624,8 +624,8 @@ STAGE PLANS:
                     predicate: (ws_ship_mode_sk is not null and 
ws_sold_date_sk is not null and ws_sold_time_sk is not null and ws_warehouse_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_sold_time_sk (type: int), ws_ship_mode_sk (type: int), ws_warehouse_sk 
(type: int), ws_quantity (type: int), ws_sales_price (type: decimal(7,2)), 
ws_net_paid_inc_tax (type: decimal(7,2))
-                      outputColumnNames: _col0, _col1, _col2, _col3, _col4, 
_col5, _col6
+                      expressions: ws_sold_date_sk (type: int), 
ws_sold_time_sk (type: int), ws_ship_mode_sk (type: int), ws_warehouse_sk 
(type: int), (ws_sales_price * CAST( ws_quantity AS decimal(10,0))) (type: 
decimal(18,2)), (ws_net_paid_inc_tax * CAST( ws_quantity AS decimal(10,0))) 
(type: decimal(18,2))
+                      outputColumnNames: _col0, _col1, _col2, _col3, _col4, 
_col5
                       Statistics: Num rows: 144002668 Data size: 19580198212 
Basic stats: COMPLETE Column stats: NONE
                       Map Join Operator
                         condition map:
@@ -633,7 +633,7 @@ STAGE PLANS:
                         keys:
                           0 _col1 (type: int)
                           1 _col0 (type: int)
-                        outputColumnNames: _col0, _col2, _col3, _col4, _col5, 
_col6
+                        outputColumnNames: _col0, _col2, _col3, _col4, _col5
                         input vertices:
                           1 Map 6
                         Statistics: Num rows: 158402938 Data size: 21538218500 
Basic stats: COMPLETE Column stats: NONE
@@ -642,7 +642,7 @@ STAGE PLANS:
                           sort order: +
                           Map-reduce partition columns: _col0 (type: int)
                           Statistics: Num rows: 158402938 Data size: 
21538218500 Basic stats: COMPLETE Column stats: NONE
-                          value expressions: _col2 (type: int), _col3 (type: 
int), _col4 (type: int), _col5 (type: decimal(7,2)), _col6 (type: decimal(7,2))
+                          value expressions: _col2 (type: int), _col3 (type: 
int), _col4 (type: decimal(18,2)), _col5 (type: decimal(18,2))
             Execution mode: vectorized
             Local Work:
               Map Reduce Local Work
@@ -656,8 +656,8 @@ STAGE PLANS:
                     predicate: (cs_ship_mode_sk is not null and 
cs_sold_date_sk is not null and cs_sold_time_sk is not null and cs_warehouse_sk 
is not null) (type: boolean)
                     Statistics: Num rows: 287989836 Data size: 38999608952 
Basic stats: COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: cs_sold_date_sk (type: int), 
cs_sold_time_sk (type: int), cs_ship_mode_sk (type: int), cs_warehouse_sk 
(type: int), cs_quantity (type: int), cs_ext_sales_price (type: decimal(7,2)), 
cs_net_paid_inc_ship_tax (type: decimal(7,2))
-                      outputColumnNames: _col0, _col1, _col2, _col3, _col4, 
_col5, _col6
+                      expressions: cs_sold_date_sk (type: int), 
cs_sold_time_sk (type: int), cs_ship_mode_sk (type: int), cs_warehouse_sk 
(type: int), (cs_ext_sales_price * CAST( cs_quantity AS decimal(10,0))) (type: 
decimal(18,2)), (cs_net_paid_inc_ship_tax * CAST( cs_quantity AS 
decimal(10,0))) (type: decimal(18,2))
+                      outputColumnNames: _col0, _col1, _col2, _col3, _col4, 
_col5
                       Statistics: Num rows: 287989836 Data size: 38999608952 
Basic stats: COMPLETE Column stats: NONE
                       Map Join Operator
                         condition map:
@@ -665,7 +665,7 @@ STAGE PLANS:
                         keys:
                           0 _col1 (type: int)
                           1 _col0 (type: int)
-                        outputColumnNames: _col0, _col2, _col3, _col4, _col5, 
_col6
+                        outputColumnNames: _col0, _col2, _col3, _col4, _col5
                         input vertices:
                           1 Map 13
                         Statistics: Num rows: 316788826 Data size: 42899570777 
Basic stats: COMPLETE Column stats: NONE
@@ -674,7 +674,7 @@ STAGE PLANS:
                           sort order: +
                           Map-reduce partition columns: _col0 (type: int)
                           Statistics: Num rows: 316788826 Data size: 
42899570777 Basic stats: COMPLETE Column stats: NONE
-                          value expressions: _col2 (type: int), _col3 (type: 
int), _col4 (type: int), _col5 (type: decimal(7,2)), _col6 (type: decimal(7,2))
+                          value expressions: _col2 (type: int), _col3 (type: 
int), _col4 (type: decimal(18,2)), _col5 (type: decimal(18,2))
             Execution mode: vectorized
             Local Work:
               Map Reduce Local Work
@@ -688,15 +688,15 @@ STAGE PLANS:
                     predicate: ((d_year = 2002) and d_date_sk is not null) 
(type: boolean)
                     Statistics: Num rows: 36524 Data size: 40870356 Basic 
stats: COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: d_date_sk (type: int), d_moy (type: int)
-                      outputColumnNames: _col0, _col2
+                      expressions: d_date_sk (type: int), (d_moy = 1) (type: 
boolean), (d_moy = 2) (type: boolean), (d_moy = 3) (type: boolean), (d_moy = 4) 
(type: boolean), (d_moy = 5) (type: boolean), (d_moy = 6) (type: boolean), 
(d_moy = 7) (type: boolean), (d_moy = 8) (type: boolean), (d_moy = 9) (type: 
boolean), (d_moy = 10) (type: boolean), (d_moy = 11) (type: boolean), (d_moy = 
12) (type: boolean)
+                      outputColumnNames: _col0, _col1, _col2, _col3, _col4, 
_col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12
                       Statistics: Num rows: 36524 Data size: 40870356 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: 36524 Data size: 40870356 Basic 
stats: COMPLETE Column stats: NONE
-                        value expressions: _col2 (type: int)
+                        value expressions: _col1 (type: boolean), _col2 (type: 
boolean), _col3 (type: boolean), _col4 (type: boolean), _col5 (type: boolean), 
_col6 (type: boolean), _col7 (type: boolean), _col8 (type: boolean), _col9 
(type: boolean), _col10 (type: boolean), _col11 (type: boolean), _col12 (type: 
boolean)
             Execution mode: vectorized
         Map 7 
             Map Operator Tree:
@@ -708,15 +708,15 @@ STAGE PLANS:
                     predicate: ((d_year = 2002) and d_date_sk is not null) 
(type: boolean)
                     Statistics: Num rows: 36524 Data size: 40870356 Basic 
stats: COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: d_date_sk (type: int), d_moy (type: int)
-                      outputColumnNames: _col0, _col2
+                      expressions: d_date_sk (type: int), (d_moy = 1) (type: 
boolean), (d_moy = 2) (type: boolean), (d_moy = 3) (type: boolean), (d_moy = 4) 
(type: boolean), (d_moy = 5) (type: boolean), (d_moy = 6) (type: boolean), 
(d_moy = 7) (type: boolean), (d_moy = 8) (type: boolean), (d_moy = 9) (type: 
boolean), (d_moy = 10) (type: boolean), (d_moy = 11) (type: boolean), (d_moy = 
12) (type: boolean)
+                      outputColumnNames: _col0, _col1, _col2, _col3, _col4, 
_col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12
                       Statistics: Num rows: 36524 Data size: 40870356 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: 36524 Data size: 40870356 Basic 
stats: COMPLETE Column stats: NONE
-                        value expressions: _col2 (type: int)
+                        value expressions: _col1 (type: boolean), _col2 (type: 
boolean), _col3 (type: boolean), _col4 (type: boolean), _col5 (type: boolean), 
_col6 (type: boolean), _col7 (type: boolean), _col8 (type: boolean), _col9 
(type: boolean), _col10 (type: boolean), _col11 (type: boolean), _col12 (type: 
boolean)
             Execution mode: vectorized
         Reducer 11 
             Local Work:
@@ -728,7 +728,7 @@ STAGE PLANS:
                 keys:
                   0 _col0 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col2, _col3, _col4, _col5, _col6, _col11
+                outputColumnNames: _col2, _col3, _col4, _col5, _col8, _col9, 
_col10, _col11, _col12, _col13, _col14, _col15, _col16, _col17, _col18, _col19
                 Statistics: Num rows: 348467716 Data size: 47189528877 Basic 
stats: COMPLETE Column stats: NONE
                 Map Join Operator
                   condition map:
@@ -736,7 +736,7 @@ STAGE PLANS:
                   keys:
                     0 _col2 (type: int)
                     1 _col0 (type: int)
-                  outputColumnNames: _col3, _col4, _col5, _col6, _col11
+                  outputColumnNames: _col3, _col4, _col5, _col8, _col9, 
_col10, _col11, _col12, _col13, _col14, _col15, _col16, _col17, _col18, _col19
                   input vertices:
                     1 Map 15
                   Statistics: Num rows: 383314495 Data size: 51908482889 Basic 
stats: PARTIAL Column stats: NONE
@@ -746,12 +746,12 @@ STAGE PLANS:
                     keys:
                       0 _col3 (type: int)
                       1 _col0 (type: int)
-                    outputColumnNames: _col4, _col5, _col6, _col11, _col15, 
_col16, _col17, _col18, _col19, _col20
+                    outputColumnNames: _col4, _col5, _col8, _col9, _col10, 
_col11, _col12, _col13, _col14, _col15, _col16, _col17, _col18, _col19, _col22, 
_col23, _col24, _col25, _col26, _col27
                     input vertices:
                       1 Map 16
                     Statistics: Num rows: 421645953 Data size: 57099332415 
Basic stats: PARTIAL Column stats: NONE
                     Select Operator
-                      expressions: _col15 (type: string), _col16 (type: int), 
_col17 (type: string), _col18 (type: string), _col19 (type: string), _col20 
(type: string), CASE WHEN ((_col11 = 1)) THEN ((_col5 * CAST( _col4 AS 
decimal(10,0)))) ELSE (0) END (type: decimal(18,2)), CASE WHEN ((_col11 = 2)) 
THEN ((_col5 * CAST( _col4 AS decimal(10,0)))) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN ((_col11 = 3)) THEN ((_col5 * CAST( _col4 AS 
decimal(10,0)))) ELSE (0) END (type: decimal(18,2)), CASE WHEN ((_col11 = 4)) 
THEN ((_col5 * CAST( _col4 AS decimal(10,0)))) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN ((_col11 = 5)) THEN ((_col5 * CAST( _col4 AS 
decimal(10,0)))) ELSE (0) END (type: decimal(18,2)), CASE WHEN ((_col11 = 6)) 
THEN ((_col5 * CAST( _col4 AS decimal(10,0)))) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN ((_col11 = 7)) THEN ((_col5 * CAST( _col4 AS 
decimal(10,0)))) ELSE (0) END (type: decimal(18,2)), CASE WHEN ((_col11 = 8)) 
THEN ((_col5 * CAST( _col4 AS decimal(10,0))))
  ELSE (0) END (type: decimal(18,2)), CASE WHEN ((_col11 = 9)) THEN ((_col5 * 
CAST( _col4 AS decimal(10,0)))) ELSE (0) END (type: decimal(18,2)), CASE WHEN 
((_col11 = 10)) THEN ((_col5 * CAST( _col4 AS decimal(10,0)))) ELSE (0) END 
(type: decimal(18,2)), CASE WHEN ((_col11 = 11)) THEN ((_col5 * CAST( _col4 AS 
decimal(10,0)))) ELSE (0) END (type: decimal(18,2)), CASE WHEN ((_col11 = 12)) 
THEN ((_col5 * CAST( _col4 AS decimal(10,0)))) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN ((_col11 = 1)) THEN ((_col6 * CAST( _col4 AS 
decimal(10,0)))) ELSE (0) END (type: decimal(18,2)), CASE WHEN ((_col11 = 2)) 
THEN ((_col6 * CAST( _col4 AS decimal(10,0)))) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN ((_col11 = 3)) THEN ((_col6 * CAST( _col4 AS 
decimal(10,0)))) ELSE (0) END (type: decimal(18,2)), CASE WHEN ((_col11 = 4)) 
THEN ((_col6 * CAST( _col4 AS decimal(10,0)))) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN ((_col11 = 5)) THEN ((_col6 * CAST( _col4 AS 
decimal(10,0)))) ELSE (0) END (type: d
 ecimal(18,2)), CASE WHEN ((_col11 = 6)) THEN ((_col6 * CAST( _col4 AS 
decimal(10,0)))) ELSE (0) END (type: decimal(18,2)), CASE WHEN ((_col11 = 7)) 
THEN ((_col6 * CAST( _col4 AS decimal(10,0)))) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN ((_col11 = 8)) THEN ((_col6 * CAST( _col4 AS 
decimal(10,0)))) ELSE (0) END (type: decimal(18,2)), CASE WHEN ((_col11 = 9)) 
THEN ((_col6 * CAST( _col4 AS decimal(10,0)))) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN ((_col11 = 10)) THEN ((_col6 * CAST( _col4 AS 
decimal(10,0)))) ELSE (0) END (type: decimal(18,2)), CASE WHEN ((_col11 = 11)) 
THEN ((_col6 * CAST( _col4 AS decimal(10,0)))) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN ((_col11 = 12)) THEN ((_col6 * CAST( _col4 AS 
decimal(10,0)))) ELSE (0) END (type: decimal(18,2))
+                      expressions: _col22 (type: string), _col23 (type: int), 
_col24 (type: string), _col25 (type: string), _col26 (type: string), _col27 
(type: string), CASE WHEN (_col8) THEN (_col4) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col9) THEN (_col4) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col10) THEN (_col4) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col11) THEN (_col4) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col12) THEN (_col4) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col13) THEN (_col4) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col14) THEN (_col4) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col15) THEN (_col4) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col16) THEN (_col4) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col17) THEN (_col4) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col18) THEN (_col4) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col19) THEN (_col4) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_c
 ol8) THEN (_col5) ELSE (0) END (type: decimal(18,2)), CASE WHEN (_col9) THEN 
(_col5) ELSE (0) END (type: decimal(18,2)), CASE WHEN (_col10) THEN (_col5) 
ELSE (0) END (type: decimal(18,2)), CASE WHEN (_col11) THEN (_col5) ELSE (0) 
END (type: decimal(18,2)), CASE WHEN (_col12) THEN (_col5) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col13) THEN (_col5) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col14) THEN (_col5) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col15) THEN (_col5) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col16) THEN (_col5) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col17) THEN (_col5) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col18) THEN (_col5) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col19) THEN (_col5) ELSE (0) END (type: 
decimal(18,2))
                       outputColumnNames: _col0, _col1, _col2, _col3, _col4, 
_col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, 
_col15, _col16, _col17, _col18, _col19, _col20, _col21, _col22, _col23, _col24, 
_col25, _col26, _col27, _col28, _col29
                       Statistics: Num rows: 421645953 Data size: 57099332415 
Basic stats: PARTIAL Column stats: NONE
                       Group By Operator
@@ -802,7 +802,7 @@ STAGE PLANS:
                 keys:
                   0 _col0 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col2, _col3, _col4, _col5, _col6, _col11
+                outputColumnNames: _col2, _col3, _col4, _col5, _col8, _col9, 
_col10, _col11, _col12, _col13, _col14, _col15, _col16, _col17, _col18, _col19
                 Statistics: Num rows: 174243235 Data size: 23692040863 Basic 
stats: COMPLETE Column stats: NONE
                 Map Join Operator
                   condition map:
@@ -810,7 +810,7 @@ STAGE PLANS:
                   keys:
                     0 _col2 (type: int)
                     1 _col0 (type: int)
-                  outputColumnNames: _col3, _col4, _col5, _col6, _col11
+                  outputColumnNames: _col3, _col4, _col5, _col8, _col9, 
_col10, _col11, _col12, _col13, _col14, _col15, _col16, _col17, _col18, _col19
                   input vertices:
                     1 Map 8
                   Statistics: Num rows: 191667562 Data size: 26061245514 Basic 
stats: PARTIAL Column stats: NONE
@@ -820,12 +820,12 @@ STAGE PLANS:
                     keys:
                       0 _col3 (type: int)
                       1 _col0 (type: int)
-                    outputColumnNames: _col4, _col5, _col6, _col11, _col15, 
_col16, _col17, _col18, _col19, _col20
+                    outputColumnNames: _col4, _col5, _col8, _col9, _col10, 
_col11, _col12, _col13, _col14, _col15, _col16, _col17, _col18, _col19, _col22, 
_col23, _col24, _col25, _col26, _col27
                     input vertices:
                       1 Map 9
                     Statistics: Num rows: 210834322 Data size: 28667370686 
Basic stats: PARTIAL Column stats: NONE
                     Select Operator
-                      expressions: _col15 (type: string), _col16 (type: int), 
_col17 (type: string), _col18 (type: string), _col19 (type: string), _col20 
(type: string), CASE WHEN ((_col11 = 1)) THEN ((_col5 * CAST( _col4 AS 
decimal(10,0)))) ELSE (0) END (type: decimal(18,2)), CASE WHEN ((_col11 = 2)) 
THEN ((_col5 * CAST( _col4 AS decimal(10,0)))) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN ((_col11 = 3)) THEN ((_col5 * CAST( _col4 AS 
decimal(10,0)))) ELSE (0) END (type: decimal(18,2)), CASE WHEN ((_col11 = 4)) 
THEN ((_col5 * CAST( _col4 AS decimal(10,0)))) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN ((_col11 = 5)) THEN ((_col5 * CAST( _col4 AS 
decimal(10,0)))) ELSE (0) END (type: decimal(18,2)), CASE WHEN ((_col11 = 6)) 
THEN ((_col5 * CAST( _col4 AS decimal(10,0)))) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN ((_col11 = 7)) THEN ((_col5 * CAST( _col4 AS 
decimal(10,0)))) ELSE (0) END (type: decimal(18,2)), CASE WHEN ((_col11 = 8)) 
THEN ((_col5 * CAST( _col4 AS decimal(10,0))))
  ELSE (0) END (type: decimal(18,2)), CASE WHEN ((_col11 = 9)) THEN ((_col5 * 
CAST( _col4 AS decimal(10,0)))) ELSE (0) END (type: decimal(18,2)), CASE WHEN 
((_col11 = 10)) THEN ((_col5 * CAST( _col4 AS decimal(10,0)))) ELSE (0) END 
(type: decimal(18,2)), CASE WHEN ((_col11 = 11)) THEN ((_col5 * CAST( _col4 AS 
decimal(10,0)))) ELSE (0) END (type: decimal(18,2)), CASE WHEN ((_col11 = 12)) 
THEN ((_col5 * CAST( _col4 AS decimal(10,0)))) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN ((_col11 = 1)) THEN ((_col6 * CAST( _col4 AS 
decimal(10,0)))) ELSE (0) END (type: decimal(18,2)), CASE WHEN ((_col11 = 2)) 
THEN ((_col6 * CAST( _col4 AS decimal(10,0)))) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN ((_col11 = 3)) THEN ((_col6 * CAST( _col4 AS 
decimal(10,0)))) ELSE (0) END (type: decimal(18,2)), CASE WHEN ((_col11 = 4)) 
THEN ((_col6 * CAST( _col4 AS decimal(10,0)))) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN ((_col11 = 5)) THEN ((_col6 * CAST( _col4 AS 
decimal(10,0)))) ELSE (0) END (type: d
 ecimal(18,2)), CASE WHEN ((_col11 = 6)) THEN ((_col6 * CAST( _col4 AS 
decimal(10,0)))) ELSE (0) END (type: decimal(18,2)), CASE WHEN ((_col11 = 7)) 
THEN ((_col6 * CAST( _col4 AS decimal(10,0)))) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN ((_col11 = 8)) THEN ((_col6 * CAST( _col4 AS 
decimal(10,0)))) ELSE (0) END (type: decimal(18,2)), CASE WHEN ((_col11 = 9)) 
THEN ((_col6 * CAST( _col4 AS decimal(10,0)))) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN ((_col11 = 10)) THEN ((_col6 * CAST( _col4 AS 
decimal(10,0)))) ELSE (0) END (type: decimal(18,2)), CASE WHEN ((_col11 = 11)) 
THEN ((_col6 * CAST( _col4 AS decimal(10,0)))) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN ((_col11 = 12)) THEN ((_col6 * CAST( _col4 AS 
decimal(10,0)))) ELSE (0) END (type: decimal(18,2))
+                      expressions: _col22 (type: string), _col23 (type: int), 
_col24 (type: string), _col25 (type: string), _col26 (type: string), _col27 
(type: string), CASE WHEN (_col8) THEN (_col4) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col9) THEN (_col4) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col10) THEN (_col4) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col11) THEN (_col4) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col12) THEN (_col4) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col13) THEN (_col4) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col14) THEN (_col4) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col15) THEN (_col4) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col16) THEN (_col4) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col17) THEN (_col4) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col18) THEN (_col4) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col19) THEN (_col4) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_c
 ol8) THEN (_col5) ELSE (0) END (type: decimal(18,2)), CASE WHEN (_col9) THEN 
(_col5) ELSE (0) END (type: decimal(18,2)), CASE WHEN (_col10) THEN (_col5) 
ELSE (0) END (type: decimal(18,2)), CASE WHEN (_col11) THEN (_col5) ELSE (0) 
END (type: decimal(18,2)), CASE WHEN (_col12) THEN (_col5) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col13) THEN (_col5) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col14) THEN (_col5) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col15) THEN (_col5) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col16) THEN (_col5) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col17) THEN (_col5) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col18) THEN (_col5) ELSE (0) END (type: 
decimal(18,2)), CASE WHEN (_col19) THEN (_col5) ELSE (0) END (type: 
decimal(18,2))
                       outputColumnNames: _col0, _col1, _col2, _col3, _col4, 
_col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, 
_col15, _col16, _col17, _col18, _col19, _col20, _col21, _col22, _col23, _col24, 
_col25, _col26, _col27, _col28, _col29
                       Statistics: Num rows: 210834322 Data size: 28667370686 
Basic stats: PARTIAL Column stats: NONE
                       Group By Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/spark/query67.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query67.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query67.q.out
index 44da5c7..4bc6c14 100644
--- a/ql/src/test/results/clientpositive/perf/spark/query67.q.out
+++ b/ql/src/test/results/clientpositive/perf/spark/query67.q.out
@@ -145,15 +145,15 @@ STAGE PLANS:
                     predicate: (ss_item_sk is not null and ss_sold_date_sk is 
not null and ss_store_sk is not null) (type: boolean)
                     Statistics: Num rows: 575995635 Data size: 50814502088 
Basic stats: COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: ss_sold_date_sk (type: int), ss_item_sk 
(type: int), ss_store_sk (type: int), ss_quantity (type: int), ss_sales_price 
(type: decimal(7,2))
-                      outputColumnNames: _col0, _col1, _col2, _col3, _col4
+                      expressions: ss_sold_date_sk (type: int), ss_item_sk 
(type: int), ss_store_sk (type: int), CASE WHEN ((ss_sales_price is not null 
and ss_quantity is not null)) THEN ((ss_sales_price * CAST( ss_quantity AS 
decimal(10,0)))) ELSE (0) END (type: decimal(18,2))
+                      outputColumnNames: _col0, _col1, _col2, _col3
                       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))
+                        value expressions: _col1 (type: int), _col2 (type: 
int), _col3 (type: decimal(18,2))
             Execution mode: vectorized
         Map 7 
             Map Operator Tree:
@@ -166,14 +166,14 @@ STAGE PLANS:
                     Statistics: Num rows: 73049 Data size: 81741831 Basic 
stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: d_date_sk (type: int), d_year (type: int), 
d_moy (type: int), d_qoy (type: int)
-                      outputColumnNames: _col0, _col2, _col3, _col4
+                      outputColumnNames: _col0, _col1, _col2, _col3
                       Statistics: Num rows: 73049 Data size: 81741831 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: 73049 Data size: 81741831 Basic 
stats: COMPLETE Column stats: NONE
-                        value expressions: _col2 (type: int), _col3 (type: 
int), _col4 (type: int)
+                        value expressions: _col1 (type: int), _col2 (type: 
int), _col3 (type: int)
             Execution mode: vectorized
         Map 9 
             Map Operator Tree:
@@ -205,7 +205,7 @@ STAGE PLANS:
                 keys:
                   0 _col0 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col1, _col2, _col3, _col4, _col7, _col8, 
_col9
+                outputColumnNames: _col1, _col2, _col3, _col5, _col6, _col7
                 Statistics: Num rows: 633595212 Data size: 55895953508 Basic 
stats: COMPLETE Column stats: NONE
                 Map Join Operator
                   condition map:
@@ -213,7 +213,7 @@ STAGE PLANS:
                   keys:
                     0 _col2 (type: int)
                     1 _col0 (type: int)
-                  outputColumnNames: _col1, _col3, _col4, _col7, _col8, _col9, 
_col11
+                  outputColumnNames: _col1, _col3, _col5, _col6, _col7, _col9
                   input vertices:
                     1 Map 8
                   Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
@@ -222,7 +222,7 @@ STAGE PLANS:
                     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), _col4 (type: 
decimal(7,2)), _col7 (type: int), _col8 (type: int), _col9 (type: int), _col11 
(type: string)
+                    value expressions: _col3 (type: decimal(18,2)), _col5 
(type: int), _col6 (type: int), _col7 (type: int), _col9 (type: string)
         Reducer 3 
             Reduce Operator Tree:
               Join Operator
@@ -231,24 +231,20 @@ STAGE PLANS:
                 keys:
                   0 _col1 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col3, _col4, _col7, _col8, _col9, _col11, 
_col13, _col14, _col15, _col16
+                outputColumnNames: _col3, _col5, _col6, _col7, _col9, _col11, 
_col12, _col13, _col14
                 Statistics: Num rows: 766650239 Data size: 67634106676 Basic 
stats: COMPLETE Column stats: NONE
-                Select Operator
-                  expressions: _col15 (type: string), _col14 (type: string), 
_col13 (type: string), _col16 (type: string), _col7 (type: int), _col9 (type: 
int), _col8 (type: int), _col11 (type: string), CASE WHEN ((_col4 is not null 
and _col3 is not null)) THEN ((_col4 * CAST( _col3 AS decimal(10,0)))) ELSE (0) 
END (type: decimal(18,2))
-                  outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7, _col8
-                  Statistics: Num rows: 766650239 Data size: 67634106676 Basic 
stats: COMPLETE Column stats: NONE
-                  Group By Operator
-                    aggregations: sum(_col8)
-                    keys: _col0 (type: string), _col1 (type: string), _col2 
(type: string), _col3 (type: string), _col4 (type: int), _col5 (type: int), 
_col6 (type: int), _col7 (type: string), 0L (type: bigint)
-                    mode: hash
-                    outputColumnNames: _col0, _col1, _col2, _col3, _col4, 
_col5, _col6, _col7, _col8, _col9
+                Group By Operator
+                  aggregations: sum(_col3)
+                  keys: _col11 (type: string), _col12 (type: string), _col13 
(type: string), _col14 (type: string), _col5 (type: int), _col6 (type: int), 
_col7 (type: int), _col9 (type: string), 0L (type: bigint)
+                  mode: hash
+                  outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7, _col8, _col9
+                  Statistics: Num rows: 6899852151 Data size: 608706960084 
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: int), _col5 
(type: int), _col6 (type: int), _col7 (type: string), _col8 (type: bigint)
+                    sort order: +++++++++
+                    Map-reduce partition columns: _col0 (type: string), _col1 
(type: string), _col2 (type: string), _col3 (type: string), _col4 (type: int), 
_col5 (type: int), _col6 (type: int), _col7 (type: string), _col8 (type: bigint)
                     Statistics: Num rows: 6899852151 Data size: 608706960084 
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: int), _col5 
(type: int), _col6 (type: int), _col7 (type: string), _col8 (type: bigint)
-                      sort order: +++++++++
-                      Map-reduce partition columns: _col0 (type: string), 
_col1 (type: string), _col2 (type: string), _col3 (type: string), _col4 (type: 
int), _col5 (type: int), _col6 (type: int), _col7 (type: string), _col8 (type: 
bigint)
-                      Statistics: Num rows: 6899852151 Data size: 608706960084 
Basic stats: COMPLETE Column stats: NONE
-                      value expressions: _col9 (type: decimal(28,2))
+                    value expressions: _col9 (type: decimal(28,2))
         Reducer 4 
             Execution mode: vectorized
             Reduce Operator Tree:
@@ -264,17 +260,17 @@ STAGE PLANS:
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7, _col8
                   Statistics: Num rows: 3449926075 Data size: 304353479997 
Basic stats: COMPLETE Column stats: NONE
                   Reduce Output Operator
-                    key expressions: _col0 (type: string), _col8 (type: 
decimal(28,2))
+                    key expressions: _col2 (type: string), _col8 (type: 
decimal(28,2))
                     sort order: +-
-                    Map-reduce partition columns: _col0 (type: string)
+                    Map-reduce partition columns: _col2 (type: string)
                     Statistics: Num rows: 3449926075 Data size: 304353479997 
Basic stats: COMPLETE Column stats: NONE
                     TopN Hash Memory Usage: 0.1
-                    value expressions: _col1 (type: string), _col2 (type: 
string), _col3 (type: string), _col4 (type: int), _col5 (type: int), _col6 
(type: int), _col7 (type: string)
+                    value expressions: _col0 (type: string), _col1 (type: 
string), _col3 (type: string), _col4 (type: int), _col5 (type: int), _col6 
(type: int), _col7 (type: string)
         Reducer 5 
             Execution mode: vectorized
             Reduce Operator Tree:
               Select Operator
-                expressions: KEY.reducesinkkey0 (type: string), VALUE._col0 
(type: string), VALUE._col1 (type: string), VALUE._col2 (type: string), 
VALUE._col3 (type: int), VALUE._col4 (type: int), VALUE._col5 (type: int), 
VALUE._col6 (type: string), KEY.reducesinkkey1 (type: decimal(28,2))
+                expressions: VALUE._col0 (type: string), VALUE._col1 (type: 
string), KEY.reducesinkkey0 (type: string), VALUE._col2 (type: string), 
VALUE._col3 (type: int), VALUE._col4 (type: int), VALUE._col5 (type: int), 
VALUE._col6 (type: string), KEY.reducesinkkey1 (type: decimal(28,2))
                 outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7, _col8
                 Statistics: Num rows: 3449926075 Data size: 304353479997 Basic 
stats: COMPLETE Column stats: NONE
                 PTF Operator
@@ -287,7 +283,7 @@ STAGE PLANS:
                         input alias: ptf_1
                         name: windowingtablefunction
                         order by: _col8 DESC NULLS LAST
-                        partition by: _col0
+                        partition by: _col2
                         raw input shape:
                         window functions:
                             window function definition
@@ -302,7 +298,7 @@ STAGE PLANS:
                     predicate: (rank_window_0 <= 100) (type: boolean)
                     Statistics: Num rows: 1149975358 Data size: 101451159969 
Basic stats: COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: _col0 (type: string), _col1 (type: string), 
_col2 (type: string), _col3 (type: string), _col4 (type: int), _col5 (type: 
int), _col6 (type: int), _col7 (type: string), _col8 (type: decimal(28,2)), 
rank_window_0 (type: int)
+                      expressions: _col2 (type: string), _col1 (type: string), 
_col0 (type: string), _col3 (type: string), _col4 (type: int), _col6 (type: 
int), _col5 (type: int), _col7 (type: string), _col8 (type: decimal(28,2)), 
rank_window_0 (type: int)
                       outputColumnNames: _col0, _col1, _col2, _col3, _col4, 
_col5, _col6, _col7, _col8, _col9
                       Statistics: Num rows: 1149975358 Data size: 101451159969 
Basic stats: COMPLETE Column stats: NONE
                       Reduce Output Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/spark/query68.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query68.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query68.q.out
index ada5aa9..a1ceab9 100644
--- a/ql/src/test/results/clientpositive/perf/spark/query68.q.out
+++ b/ql/src/test/results/clientpositive/perf/spark/query68.q.out
@@ -357,11 +357,11 @@ STAGE PLANS:
                 keys:
                   0 _col3 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col1, _col3, _col5, _col6, _col7, _col8, 
_col18
+                outputColumnNames: _col1, _col3, _col5, _col6, _col7, _col8, 
_col13
                 Statistics: Num rows: 843315281 Data size: 74397518956 Basic 
stats: COMPLETE Column stats: NONE
                 Group By Operator
                   aggregations: sum(_col6), sum(_col7), sum(_col8)
-                  keys: _col1 (type: int), _col18 (type: string), _col3 (type: 
int), _col5 (type: int)
+                  keys: _col1 (type: int), _col13 (type: string), _col3 (type: 
int), _col5 (type: int)
                   mode: hash
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6
                   Statistics: Num rows: 843315281 Data size: 74397518956 Basic 
stats: COMPLETE Column stats: NONE

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/spark/query7.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query7.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query7.q.out
index 3e58d6e..c9ac621 100644
--- a/ql/src/test/results/clientpositive/perf/spark/query7.q.out
+++ b/ql/src/test/results/clientpositive/perf/spark/query7.q.out
@@ -221,11 +221,11 @@ STAGE PLANS:
                 keys:
                   0 _col1 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col4, _col5, _col6, _col7, _col18
+                outputColumnNames: _col4, _col5, _col6, _col7, _col12
                 Statistics: Num rows: 843315281 Data size: 74397518956 Basic 
stats: COMPLETE Column stats: NONE
                 Group By Operator
                   aggregations: sum(_col4), count(_col4), sum(_col5), 
count(_col5), sum(_col7), count(_col7), sum(_col6), count(_col6)
-                  keys: _col18 (type: string)
+                  keys: _col12 (type: string)
                   mode: hash
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7, _col8
                   Statistics: Num rows: 843315281 Data size: 74397518956 Basic 
stats: COMPLETE Column stats: NONE

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/spark/query70.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query70.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query70.q.out
index e39389b..56767af 100644
--- a/ql/src/test/results/clientpositive/perf/spark/query70.q.out
+++ b/ql/src/test/results/clientpositive/perf/spark/query70.q.out
@@ -246,13 +246,13 @@ STAGE PLANS:
                   keys:
                     0 _col1 (type: int)
                     1 _col0 (type: int)
-                  outputColumnNames: _col2, _col6
+                  outputColumnNames: _col2, _col5
                   input vertices:
                     1 Map 14
                   Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
                   Group By Operator
                     aggregations: sum(_col2)
-                    keys: _col6 (type: string)
+                    keys: _col5 (type: string)
                     mode: hash
                     outputColumnNames: _col0, _col1
                     Statistics: Num rows: 696954748 Data size: 61485550191 
Basic stats: COMPLETE Column stats: NONE

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/spark/query71.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query71.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query71.q.out
index 2b87b9d..7a659e0 100644
--- a/ql/src/test/results/clientpositive/perf/spark/query71.q.out
+++ b/ql/src/test/results/clientpositive/perf/spark/query71.q.out
@@ -301,11 +301,11 @@ STAGE PLANS:
                 keys:
                   0 _col2 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col0, _col4, _col5, _col8, _col9
+                outputColumnNames: _col0, _col4, _col5, _col7, _col8
                 Statistics: Num rows: 1341632299 Data size: 145603835081 Basic 
stats: COMPLETE Column stats: NONE
                 Group By Operator
                   aggregations: sum(_col0)
-                  keys: _col4 (type: int), _col8 (type: int), _col9 (type: 
int), _col5 (type: string)
+                  keys: _col4 (type: int), _col7 (type: int), _col8 (type: 
int), _col5 (type: string)
                   mode: hash
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4
                   Statistics: Num rows: 1341632299 Data size: 145603835081 
Basic stats: COMPLETE Column stats: NONE

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/spark/query72.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query72.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query72.q.out
index 77792eb..23ab1d1 100644
--- a/ql/src/test/results/clientpositive/perf/spark/query72.q.out
+++ b/ql/src/test/results/clientpositive/perf/spark/query72.q.out
@@ -207,7 +207,7 @@ STAGE PLANS:
                     predicate: ((d_year = 2001) and d_date_sk is not null and 
d_week_seq is not null) (type: boolean)
                     Statistics: Num rows: 36524 Data size: 40870356 Basic 
stats: COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: d_date_sk (type: int), d_date (type: 
string), d_week_seq (type: int)
+                      expressions: d_date_sk (type: int), d_week_seq (type: 
int), (UDFToDouble(d_date) + 5.0D) (type: double)
                       outputColumnNames: _col0, _col1, _col2
                       Statistics: Num rows: 36524 Data size: 40870356 Basic 
stats: COMPLETE Column stats: NONE
                       Reduce Output Operator
@@ -215,7 +215,7 @@ STAGE PLANS:
                         sort order: +
                         Map-reduce partition columns: _col0 (type: int)
                         Statistics: Num rows: 36524 Data size: 40870356 Basic 
stats: COMPLETE Column stats: NONE
-                        value expressions: _col1 (type: string), _col2 (type: 
int)
+                        value expressions: _col1 (type: int), _col2 (type: 
double)
             Execution mode: vectorized
         Map 14 
             Map Operator Tree:
@@ -266,7 +266,7 @@ STAGE PLANS:
                     predicate: d_date_sk is not null (type: boolean)
                     Statistics: Num rows: 73049 Data size: 81741831 Basic 
stats: COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: d_date_sk (type: int), d_date (type: string)
+                      expressions: d_date_sk (type: int), UDFToDouble(d_date) 
(type: double)
                       outputColumnNames: _col0, _col1
                       Statistics: Num rows: 73049 Data size: 81741831 Basic 
stats: COMPLETE Column stats: NONE
                       Reduce Output Operator
@@ -274,7 +274,7 @@ STAGE PLANS:
                         sort order: +
                         Map-reduce partition columns: _col0 (type: int)
                         Statistics: Num rows: 73049 Data size: 81741831 Basic 
stats: COMPLETE Column stats: NONE
-                        value expressions: _col1 (type: string)
+                        value expressions: _col1 (type: double)
             Execution mode: vectorized
         Map 19 
             Map Operator Tree:
@@ -362,7 +362,7 @@ STAGE PLANS:
                     keys:
                       0 _col5 (type: int)
                       1 _col0 (type: int)
-                    outputColumnNames: _col1, _col4, _col6, _col7, _col9, 
_col10, _col16
+                    outputColumnNames: _col1, _col4, _col6, _col7, _col9, 
_col10, _col13
                     input vertices:
                       1 Map 16
                     Statistics: Num rows: 421645953 Data size: 57099332415 
Basic stats: COMPLETE Column stats: NONE
@@ -371,7 +371,7 @@ STAGE PLANS:
                       sort order: +
                       Map-reduce partition columns: _col4 (type: int)
                       Statistics: Num rows: 421645953 Data size: 57099332415 
Basic stats: COMPLETE Column stats: NONE
-                      value expressions: _col1 (type: int), _col6 (type: int), 
_col7 (type: int), _col9 (type: string), _col10 (type: int), _col16 (type: int)
+                      value expressions: _col1 (type: int), _col6 (type: int), 
_col7 (type: int), _col9 (type: int), _col10 (type: double), _col13 (type: int)
         Reducer 11 
             Reduce Operator Tree:
               Join Operator
@@ -380,14 +380,14 @@ STAGE PLANS:
                 keys:
                   0 _col4 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col1, _col4, _col6, _col7, _col9, _col10, 
_col16, _col18
+                outputColumnNames: _col1, _col4, _col6, _col7, _col9, _col10, 
_col13, _col15
                 Statistics: Num rows: 463810558 Data size: 62809267017 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: 463810558 Data size: 62809267017 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col4 (type: int), _col6 (type: int), 
_col7 (type: int), _col9 (type: string), _col10 (type: int), _col16 (type: 
int), _col18 (type: string)
+                  value expressions: _col4 (type: int), _col6 (type: int), 
_col7 (type: int), _col9 (type: int), _col10 (type: double), _col13 (type: 
int), _col15 (type: string)
         Reducer 12 
             Reduce Operator Tree:
               Join Operator
@@ -396,21 +396,21 @@ STAGE PLANS:
                 keys:
                   0 _col1 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col4, _col6, _col7, _col9, _col10, _col16, 
_col18, _col20
+                outputColumnNames: _col4, _col6, _col7, _col9, _col10, _col13, 
_col15, _col17
                 Statistics: Num rows: 510191624 Data size: 69090195216 Basic 
stats: COMPLETE Column stats: NONE
                 Filter Operator
-                  predicate: (UDFToDouble(_col20) > (UDFToDouble(_col9) + 
5.0D)) (type: boolean)
+                  predicate: (_col17 > _col10) (type: boolean)
                   Statistics: Num rows: 170063874 Data size: 23030064981 Basic 
stats: COMPLETE Column stats: NONE
                   Select Operator
-                    expressions: _col18 (type: string), _col4 (type: int), 
_col6 (type: int), _col7 (type: int), _col10 (type: int), _col16 (type: int)
-                    outputColumnNames: _col3, _col8, _col10, _col11, _col14, 
_col20
+                    expressions: _col15 (type: string), _col4 (type: int), 
_col6 (type: int), _col7 (type: int), _col9 (type: int), _col13 (type: int)
+                    outputColumnNames: _col3, _col8, _col10, _col11, _col13, 
_col17
                     Statistics: Num rows: 170063874 Data size: 23030064981 
Basic stats: COMPLETE Column stats: NONE
                     Reduce Output Operator
                       key expressions: _col8 (type: int)
                       sort order: +
                       Map-reduce partition columns: _col8 (type: int)
                       Statistics: Num rows: 170063874 Data size: 23030064981 
Basic stats: COMPLETE Column stats: NONE
-                      value expressions: _col3 (type: string), _col10 (type: 
int), _col11 (type: int), _col14 (type: int), _col20 (type: int)
+                      value expressions: _col3 (type: string), _col10 (type: 
int), _col11 (type: int), _col13 (type: int), _col17 (type: int)
         Reducer 2 
             Reduce Operator Tree:
               Join Operator
@@ -419,37 +419,37 @@ STAGE PLANS:
                 keys:
                   0 _col1 (type: int)
                   1 _col8 (type: int)
-                outputColumnNames: _col0, _col3, _col5, _col9, _col14, _col16, 
_col17, _col20, _col26
+                outputColumnNames: _col0, _col3, _col5, _col9, _col14, _col16, 
_col17, _col19, _col23
                 Statistics: Num rows: 187070265 Data size: 25333072028 Basic 
stats: COMPLETE Column stats: NONE
                 Filter Operator
                   predicate: (_col3 < _col17) (type: boolean)
                   Statistics: Num rows: 62356755 Data size: 8444357342 Basic 
stats: COMPLETE Column stats: NONE
                   Reduce Output Operator
-                    key expressions: _col0 (type: int), _col20 (type: int)
+                    key expressions: _col0 (type: int), _col19 (type: int)
                     sort order: ++
-                    Map-reduce partition columns: _col0 (type: int), _col20 
(type: int)
+                    Map-reduce partition columns: _col0 (type: int), _col19 
(type: int)
                     Statistics: Num rows: 62356755 Data size: 8444357342 Basic 
stats: COMPLETE Column stats: NONE
-                    value expressions: _col5 (type: string), _col9 (type: 
string), _col14 (type: int), _col16 (type: int), _col26 (type: int)
+                    value expressions: _col5 (type: string), _col9 (type: 
string), _col14 (type: int), _col16 (type: int), _col23 (type: int)
         Reducer 3 
             Reduce Operator Tree:
               Join Operator
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 _col0 (type: int), _col20 (type: int)
+                  0 _col0 (type: int), _col19 (type: int)
                   1 _col0 (type: int), _col1 (type: int)
-                outputColumnNames: _col5, _col9, _col14, _col16, _col20, _col26
+                outputColumnNames: _col5, _col9, _col14, _col16, _col19, _col23
                 Statistics: Num rows: 68592431 Data size: 9288793277 Basic 
stats: COMPLETE Column stats: NONE
                 Select Operator
-                  expressions: _col14 (type: int), _col16 (type: int), _col5 
(type: string), _col9 (type: string), _col20 (type: int), _col26 (type: int)
-                  outputColumnNames: _col4, _col6, _col13, _col15, _col22, 
_col28
+                  expressions: _col14 (type: int), _col16 (type: int), _col5 
(type: string), _col9 (type: string), _col19 (type: int), _col23 (type: int)
+                  outputColumnNames: _col4, _col6, _col13, _col15, _col19, 
_col25
                   Statistics: Num rows: 68592431 Data size: 9288793277 Basic 
stats: COMPLETE Column stats: NONE
                   Reduce Output Operator
                     key expressions: _col4 (type: int), _col6 (type: int)
                     sort order: ++
                     Map-reduce partition columns: _col4 (type: int), _col6 
(type: int)
                     Statistics: Num rows: 68592431 Data size: 9288793277 Basic 
stats: COMPLETE Column stats: NONE
-                    value expressions: _col13 (type: string), _col15 (type: 
string), _col22 (type: int), _col28 (type: int)
+                    value expressions: _col13 (type: string), _col15 (type: 
string), _col19 (type: int), _col25 (type: int)
         Reducer 4 
             Reduce Operator Tree:
               Join Operator
@@ -458,10 +458,10 @@ STAGE PLANS:
                 keys:
                   0 _col4 (type: int), _col6 (type: int)
                   1 _col0 (type: int), _col1 (type: int)
-                outputColumnNames: _col13, _col15, _col22, _col28
+                outputColumnNames: _col13, _col15, _col19, _col25
                 Statistics: Num rows: 75451675 Data size: 10217672826 Basic 
stats: COMPLETE Column stats: NONE
                 Select Operator
-                  expressions: _col15 (type: string), _col13 (type: string), 
_col22 (type: int), CASE WHEN (_col28 is null) THEN (1) ELSE (0) END (type: 
int), CASE WHEN (_col28 is not null) THEN (1) ELSE (0) END (type: int)
+                  expressions: _col15 (type: string), _col13 (type: string), 
_col19 (type: int), CASE WHEN (_col25 is null) THEN (1) ELSE (0) END (type: 
int), CASE WHEN (_col25 is not null) THEN (1) ELSE (0) END (type: int)
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4
                   Statistics: Num rows: 75451675 Data size: 10217672826 Basic 
stats: COMPLETE Column stats: NONE
                   Group By Operator
@@ -523,7 +523,7 @@ STAGE PLANS:
                   sort order: +
                   Map-reduce partition columns: _col2 (type: int)
                   Statistics: Num rows: 316788826 Data size: 42899570777 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col1 (type: int), _col3 (type: int), 
_col4 (type: int), _col5 (type: int), _col6 (type: int), _col7 (type: int), 
_col9 (type: string), _col10 (type: int)
+                  value expressions: _col1 (type: int), _col3 (type: int), 
_col4 (type: int), _col5 (type: int), _col6 (type: int), _col7 (type: int), 
_col9 (type: int), _col10 (type: double)
 
   Stage: Stage-0
     Fetch Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/spark/query74.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query74.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query74.q.out
index 05969bb..cc9b74e 100644
--- a/ql/src/test/results/clientpositive/perf/spark/query74.q.out
+++ b/ql/src/test/results/clientpositive/perf/spark/query74.q.out
@@ -182,15 +182,14 @@ STAGE PLANS:
                     predicate: ((d_year = 2001) and (d_year) IN (2001, 2002) 
and d_date_sk is not null) (type: boolean)
                     Statistics: Num rows: 36524 Data size: 40870356 Basic 
stats: COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: d_date_sk (type: int), 2001 (type: int)
-                      outputColumnNames: _col0, _col1
+                      expressions: d_date_sk (type: int)
+                      outputColumnNames: _col0
                       Statistics: Num rows: 36524 Data size: 40870356 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: 36524 Data size: 40870356 Basic 
stats: COMPLETE Column stats: NONE
-                        value expressions: _col1 (type: int)
             Execution mode: vectorized
         Map 14 
             Map Operator Tree:
@@ -242,15 +241,14 @@ STAGE PLANS:
                     predicate: ((d_year = 2001) and (d_year) IN (2001, 2002) 
and d_date_sk is not null) (type: boolean)
                     Statistics: Num rows: 36524 Data size: 40870356 Basic 
stats: COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: d_date_sk (type: int), 2001 (type: int)
-                      outputColumnNames: _col0, _col1
+                      expressions: d_date_sk (type: int)
+                      outputColumnNames: _col0
                       Statistics: Num rows: 36524 Data size: 40870356 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: 36524 Data size: 40870356 Basic 
stats: COMPLETE Column stats: NONE
-                        value expressions: _col1 (type: int)
             Execution mode: vectorized
         Map 20 
             Map Operator Tree:
@@ -302,15 +300,14 @@ STAGE PLANS:
                     predicate: ((d_year = 2002) and (d_year) IN (2001, 2002) 
and d_date_sk is not null) (type: boolean)
                     Statistics: Num rows: 36524 Data size: 40870356 Basic 
stats: COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: d_date_sk (type: int), 2002 (type: int)
-                      outputColumnNames: _col0, _col1
+                      expressions: d_date_sk (type: int)
+                      outputColumnNames: _col0
                       Statistics: Num rows: 36524 Data size: 40870356 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: 36524 Data size: 40870356 Basic 
stats: COMPLETE Column stats: NONE
-                        value expressions: _col1 (type: int)
             Execution mode: vectorized
         Map 26 
             Map Operator Tree:
@@ -342,15 +339,14 @@ STAGE PLANS:
                     predicate: ((d_year = 2002) and (d_year) IN (2001, 2002) 
and d_date_sk is not null) (type: boolean)
                     Statistics: Num rows: 36524 Data size: 40870356 Basic 
stats: COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: d_date_sk (type: int), 2002 (type: int)
-                      outputColumnNames: _col0, _col1
+                      expressions: d_date_sk (type: int)
+                      outputColumnNames: _col0
                       Statistics: Num rows: 36524 Data size: 40870356 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: 36524 Data size: 40870356 Basic 
stats: COMPLETE Column stats: NONE
-                        value expressions: _col1 (type: int)
             Execution mode: vectorized
         Map 8 
             Map Operator Tree:
@@ -400,14 +396,14 @@ STAGE PLANS:
                 keys:
                   0 _col0 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col1, _col2, _col4
+                outputColumnNames: _col1, _col2
                 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)
                   Statistics: Num rows: 633595212 Data size: 55895953508 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col2 (type: decimal(7,2)), _col4 (type: 
int)
+                  value expressions: _col2 (type: decimal(7,2))
         Reducer 11 
             Reduce Operator Tree:
               Join Operator
@@ -416,38 +412,38 @@ STAGE PLANS:
                 keys:
                   0 _col1 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col2, _col4, _col6, _col7, _col8
+                outputColumnNames: _col2, _col5, _col6, _col7
                 Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
                 Group By Operator
                   aggregations: max(_col2)
-                  keys: _col6 (type: string), _col7 (type: string), _col8 
(type: string), _col4 (type: int)
+                  keys: _col5 (type: string), _col6 (type: string), _col7 
(type: string)
                   mode: hash
-                  outputColumnNames: _col0, _col1, _col2, _col3, _col4
+                  outputColumnNames: _col0, _col1, _col2, _col3
                   Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
                   Reduce Output Operator
-                    key expressions: _col0 (type: string), _col1 (type: 
string), _col2 (type: string), _col3 (type: int)
-                    sort order: ++++
-                    Map-reduce partition columns: _col0 (type: string), _col1 
(type: string), _col2 (type: string), _col3 (type: int)
+                    key expressions: _col0 (type: string), _col1 (type: 
string), _col2 (type: string)
+                    sort order: +++
+                    Map-reduce partition columns: _col0 (type: string), _col1 
(type: string), _col2 (type: string)
                     Statistics: Num rows: 696954748 Data size: 61485550191 
Basic stats: COMPLETE Column stats: NONE
-                    value expressions: _col4 (type: decimal(7,2))
+                    value expressions: _col3 (type: decimal(7,2))
         Reducer 12 
             Execution mode: vectorized
             Reduce Operator Tree:
               Group By Operator
                 aggregations: max(VALUE._col0)
-                keys: KEY._col0 (type: string), KEY._col1 (type: string), 
KEY._col2 (type: string), KEY._col3 (type: int)
+                keys: KEY._col0 (type: string), KEY._col1 (type: string), 
KEY._col2 (type: string)
                 mode: mergepartial
-                outputColumnNames: _col0, _col1, _col2, _col3, _col4
+                outputColumnNames: _col0, _col1, _col2, _col3
                 Statistics: Num rows: 348477374 Data size: 30742775095 Basic 
stats: COMPLETE Column stats: NONE
                 Select Operator
-                  expressions: _col0 (type: string), _col4 (type: decimal(7,2))
-                  outputColumnNames: _col0, _col4
+                  expressions: _col0 (type: string), _col3 (type: decimal(7,2))
+                  outputColumnNames: _col0, _col3
                   Statistics: Num rows: 348477374 Data size: 30742775095 Basic 
stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (_col4 > 0) (type: boolean)
+                    predicate: (_col3 > 0) (type: boolean)
                     Statistics: Num rows: 116159124 Data size: 10247591639 
Basic stats: COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: _col0 (type: string), _col4 (type: 
decimal(7,2))
+                      expressions: _col0 (type: string), _col3 (type: 
decimal(7,2))
                       outputColumnNames: _col0, _col1
                       Statistics: Num rows: 116159124 Data size: 10247591639 
Basic stats: COMPLETE Column stats: NONE
                       Reduce Output Operator
@@ -464,14 +460,14 @@ STAGE PLANS:
                 keys:
                   0 _col0 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col1, _col2, _col4
+                outputColumnNames: _col1, _col2
                 Statistics: Num rows: 158402938 Data size: 21538218500 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: 158402938 Data size: 21538218500 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col2 (type: decimal(7,2)), _col4 (type: 
int)
+                  value expressions: _col2 (type: decimal(7,2))
         Reducer 17 
             Reduce Operator Tree:
               Join Operator
@@ -480,46 +476,46 @@ STAGE PLANS:
                 keys:
                   0 _col1 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col2, _col4, _col6, _col7, _col8
+                outputColumnNames: _col2, _col5, _col6, _col7
                 Statistics: Num rows: 174243235 Data size: 23692040863 Basic 
stats: COMPLETE Column stats: NONE
                 Group By Operator
                   aggregations: max(_col2)
-                  keys: _col6 (type: string), _col7 (type: string), _col8 
(type: string), _col4 (type: int)
+                  keys: _col5 (type: string), _col6 (type: string), _col7 
(type: string)
                   mode: hash
-                  outputColumnNames: _col0, _col1, _col2, _col3, _col4
+                  outputColumnNames: _col0, _col1, _col2, _col3
                   Statistics: Num rows: 174243235 Data size: 23692040863 Basic 
stats: COMPLETE Column stats: NONE
                   Reduce Output Operator
-                    key expressions: _col0 (type: string), _col1 (type: 
string), _col2 (type: string), _col3 (type: int)
-                    sort order: ++++
-                    Map-reduce partition columns: _col0 (type: string), _col1 
(type: string), _col2 (type: string), _col3 (type: int)
+                    key expressions: _col0 (type: string), _col1 (type: 
string), _col2 (type: string)
+                    sort order: +++
+                    Map-reduce partition columns: _col0 (type: string), _col1 
(type: string), _col2 (type: string)
                     Statistics: Num rows: 174243235 Data size: 23692040863 
Basic stats: COMPLETE Column stats: NONE
-                    value expressions: _col4 (type: decimal(7,2))
+                    value expressions: _col3 (type: decimal(7,2))
         Reducer 18 
             Execution mode: vectorized
             Reduce Operator Tree:
               Group By Operator
                 aggregations: max(VALUE._col0)
-                keys: KEY._col0 (type: string), KEY._col1 (type: string), 
KEY._col2 (type: string), KEY._col3 (type: int)
+                keys: KEY._col0 (type: string), KEY._col1 (type: string), 
KEY._col2 (type: string)
                 mode: mergepartial
-                outputColumnNames: _col0, _col1, _col2, _col3, _col4
+                outputColumnNames: _col0, _col1, _col2, _col3
                 Statistics: Num rows: 87121617 Data size: 11846020363 Basic 
stats: COMPLETE Column stats: NONE
                 Select Operator
-                  expressions: _col0 (type: string), _col4 (type: decimal(7,2))
-                  outputColumnNames: _col0, _col4
+                  expressions: _col0 (type: string), _col3 (type: decimal(7,2))
+                  outputColumnNames: _col0, _col3
                   Statistics: Num rows: 87121617 Data size: 11846020363 Basic 
stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (_col4 > 0) (type: boolean)
+                    predicate: (_col3 > 0) (type: boolean)
                     Statistics: Num rows: 29040539 Data size: 3948673454 Basic 
stats: COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: _col0 (type: string), _col4 (type: 
decimal(7,2))
-                      outputColumnNames: _col0, _col1
+                      expressions: _col0 (type: string), _col3 (type: 
decimal(7,2)), _col3 is not null (type: boolean)
+                      outputColumnNames: _col0, _col1, _col2
                       Statistics: Num rows: 29040539 Data size: 3948673454 
Basic stats: COMPLETE Column stats: NONE
                       Reduce Output Operator
                         key expressions: _col0 (type: string)
                         sort order: +
                         Map-reduce partition columns: _col0 (type: string)
                         Statistics: Num rows: 29040539 Data size: 3948673454 
Basic stats: COMPLETE Column stats: NONE
-                        value expressions: _col1 (type: decimal(7,2))
+                        value expressions: _col1 (type: decimal(7,2)), _col2 
(type: boolean)
         Reducer 2 
             Reduce Operator Tree:
               Join Operator
@@ -528,14 +524,14 @@ STAGE PLANS:
                 keys:
                   0 _col0 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col1, _col2, _col4
+                outputColumnNames: _col1, _col2
                 Statistics: Num rows: 158402938 Data size: 21538218500 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: 158402938 Data size: 21538218500 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col2 (type: decimal(7,2)), _col4 (type: 
int)
+                  value expressions: _col2 (type: decimal(7,2))
         Reducer 22 
             Reduce Operator Tree:
               Join Operator
@@ -544,14 +540,14 @@ STAGE PLANS:
                 keys:
                   0 _col0 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col1, _col2, _col4
+                outputColumnNames: _col1, _col2
                 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)
                   Statistics: Num rows: 633595212 Data size: 55895953508 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col2 (type: decimal(7,2)), _col4 (type: 
int)
+                  value expressions: _col2 (type: decimal(7,2))
         Reducer 23 
             Reduce Operator Tree:
               Join Operator
@@ -560,39 +556,35 @@ STAGE PLANS:
                 keys:
                   0 _col1 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col2, _col4, _col6, _col7, _col8
+                outputColumnNames: _col2, _col5, _col6, _col7
                 Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
                 Group By Operator
                   aggregations: max(_col2)
-                  keys: _col6 (type: string), _col7 (type: string), _col8 
(type: string), _col4 (type: int)
+                  keys: _col5 (type: string), _col6 (type: string), _col7 
(type: string)
                   mode: hash
-                  outputColumnNames: _col0, _col1, _col2, _col3, _col4
+                  outputColumnNames: _col0, _col1, _col2, _col3
                   Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
                   Reduce Output Operator
-                    key expressions: _col0 (type: string), _col1 (type: 
string), _col2 (type: string), _col3 (type: int)
-                    sort order: ++++
-                    Map-reduce partition columns: _col0 (type: string), _col1 
(type: string), _col2 (type: string), _col3 (type: int)
+                    key expressions: _col0 (type: string), _col1 (type: 
string), _col2 (type: string)
+                    sort order: +++
+                    Map-reduce partition columns: _col0 (type: string), _col1 
(type: string), _col2 (type: string)
                     Statistics: Num rows: 696954748 Data size: 61485550191 
Basic stats: COMPLETE Column stats: NONE
-                    value expressions: _col4 (type: decimal(7,2))
+                    value expressions: _col3 (type: decimal(7,2))
         Reducer 24 
             Execution mode: vectorized
             Reduce Operator Tree:
               Group By Operator
                 aggregations: max(VALUE._col0)
-                keys: KEY._col0 (type: string), KEY._col1 (type: string), 
KEY._col2 (type: string), KEY._col3 (type: int)
+                keys: KEY._col0 (type: string), KEY._col1 (type: string), 
KEY._col2 (type: string)
                 mode: mergepartial
-                outputColumnNames: _col0, _col1, _col2, _col3, _col4
+                outputColumnNames: _col0, _col1, _col2, _col3
                 Statistics: Num rows: 348477374 Data size: 30742775095 Basic 
stats: COMPLETE Column stats: NONE
-                Select Operator
-                  expressions: _col0 (type: string), _col1 (type: string), 
_col2 (type: string), _col4 (type: decimal(7,2))
-                  outputColumnNames: _col0, _col1, _col2, _col3
+                Reduce Output Operator
+                  key expressions: _col0 (type: string)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: string)
                   Statistics: Num rows: 348477374 Data size: 30742775095 Basic 
stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: string)
-                    Statistics: Num rows: 348477374 Data size: 30742775095 
Basic stats: COMPLETE Column stats: NONE
-                    value expressions: _col1 (type: string), _col2 (type: 
string), _col3 (type: decimal(7,2))
+                  value expressions: _col1 (type: string), _col2 (type: 
string), _col3 (type: decimal(7,2))
         Reducer 3 
             Reduce Operator Tree:
               Join Operator
@@ -601,31 +593,31 @@ STAGE PLANS:
                 keys:
                   0 _col1 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col2, _col4, _col6, _col7, _col8
+                outputColumnNames: _col2, _col5, _col6, _col7
                 Statistics: Num rows: 174243235 Data size: 23692040863 Basic 
stats: COMPLETE Column stats: NONE
                 Group By Operator
                   aggregations: max(_col2)
-                  keys: _col6 (type: string), _col7 (type: string), _col8 
(type: string), _col4 (type: int)
+                  keys: _col5 (type: string), _col6 (type: string), _col7 
(type: string)
                   mode: hash
-                  outputColumnNames: _col0, _col1, _col2, _col3, _col4
+                  outputColumnNames: _col0, _col1, _col2, _col3
                   Statistics: Num rows: 174243235 Data size: 23692040863 Basic 
stats: COMPLETE Column stats: NONE
                   Reduce Output Operator
-                    key expressions: _col0 (type: string), _col1 (type: 
string), _col2 (type: string), _col3 (type: int)
-                    sort order: ++++
-                    Map-reduce partition columns: _col0 (type: string), _col1 
(type: string), _col2 (type: string), _col3 (type: int)
+                    key expressions: _col0 (type: string), _col1 (type: 
string), _col2 (type: string)
+                    sort order: +++
+                    Map-reduce partition columns: _col0 (type: string), _col1 
(type: string), _col2 (type: string)
                     Statistics: Num rows: 174243235 Data size: 23692040863 
Basic stats: COMPLETE Column stats: NONE
-                    value expressions: _col4 (type: decimal(7,2))
+                    value expressions: _col3 (type: decimal(7,2))
         Reducer 4 
             Execution mode: vectorized
             Reduce Operator Tree:
               Group By Operator
                 aggregations: max(VALUE._col0)
-                keys: KEY._col0 (type: string), KEY._col1 (type: string), 
KEY._col2 (type: string), KEY._col3 (type: int)
+                keys: KEY._col0 (type: string), KEY._col1 (type: string), 
KEY._col2 (type: string)
                 mode: mergepartial
-                outputColumnNames: _col0, _col1, _col2, _col3, _col4
+                outputColumnNames: _col0, _col1, _col2, _col3
                 Statistics: Num rows: 87121617 Data size: 11846020363 Basic 
stats: COMPLETE Column stats: NONE
                 Select Operator
-                  expressions: _col0 (type: string), _col4 (type: decimal(7,2))
+                  expressions: _col0 (type: string), _col3 (type: decimal(7,2))
                   outputColumnNames: _col0, _col1
                   Statistics: Num rows: 87121617 Data size: 11846020363 Basic 
stats: COMPLETE Column stats: NONE
                   Reduce Output Operator
@@ -646,13 +638,13 @@ STAGE PLANS:
                   1 _col0 (type: string)
                   2 _col0 (type: string)
                   3 _col0 (type: string)
-                outputColumnNames: _col1, _col3, _col5, _col6, _col7, _col8, 
_col9
+                outputColumnNames: _col1, _col3, _col5, _col6, _col7, _col8, 
_col9, _col10
                 Statistics: Num rows: 1149975359 Data size: 101451160012 Basic 
stats: COMPLETE Column stats: NONE
                 Filter Operator
-                  predicate: CASE WHEN (_col3 is not null) THEN (CASE WHEN 
(_col5 is not null) THEN (((_col1 / _col5) > (_col9 / _col3))) ELSE ((null > 
(_col9 / _col3))) END) ELSE (CASE WHEN (_col5 is not null) THEN (((_col1 / 
_col5) > null)) ELSE (null) END) END (type: boolean)
+                  predicate: CASE WHEN (_col3 is not null) THEN (CASE WHEN 
(_col6) THEN (((_col1 / _col5) > (_col10 / _col3))) ELSE ((null > (_col10 / 
_col3))) END) ELSE (CASE WHEN (_col6) THEN (((_col1 / _col5) > null)) ELSE 
(null) END) END (type: boolean)
                   Statistics: Num rows: 574987679 Data size: 50725579961 Basic 
stats: COMPLETE Column stats: NONE
                   Select Operator
-                    expressions: _col6 (type: string), _col7 (type: string), 
_col8 (type: string)
+                    expressions: _col7 (type: string), _col8 (type: string), 
_col9 (type: string)
                     outputColumnNames: _col0, _col1, _col2
                     Statistics: Num rows: 574987679 Data size: 50725579961 
Basic stats: COMPLETE Column stats: NONE
                     Reduce Output Operator

Reply via email to