http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/spark/query75.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query75.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query75.q.out
index 85e6dca..553d11a 100644
--- a/ql/src/test/results/clientpositive/perf/spark/query75.q.out
+++ b/ql/src/test/results/clientpositive/perf/spark/query75.q.out
@@ -219,14 +219,14 @@ STAGE PLANS:
                     Statistics: Num rows: 231000 Data size: 331780228 Basic 
stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: i_item_sk (type: int), i_brand_id (type: 
int), i_class_id (type: int), i_category_id (type: int), i_manufact_id (type: 
int)
-                      outputColumnNames: _col0, _col1, _col2, _col3, _col5
+                      outputColumnNames: _col0, _col1, _col2, _col3, _col4
                       Statistics: Num rows: 231000 Data size: 331780228 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: 231000 Data size: 331780228 
Basic stats: COMPLETE Column stats: NONE
-                        value expressions: _col1 (type: int), _col2 (type: 
int), _col3 (type: int), _col5 (type: int)
+                        value expressions: _col1 (type: int), _col2 (type: 
int), _col3 (type: int), _col4 (type: int)
             Execution mode: vectorized
         Map 11 
             Map Operator Tree:
@@ -397,14 +397,14 @@ STAGE PLANS:
                     Statistics: Num rows: 231000 Data size: 331780228 Basic 
stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: i_item_sk (type: int), i_brand_id (type: 
int), i_class_id (type: int), i_category_id (type: int), i_manufact_id (type: 
int)
-                      outputColumnNames: _col0, _col1, _col2, _col3, _col5
+                      outputColumnNames: _col0, _col1, _col2, _col3, _col4
                       Statistics: Num rows: 231000 Data size: 331780228 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: 231000 Data size: 331780228 
Basic stats: COMPLETE Column stats: NONE
-                        value expressions: _col1 (type: int), _col2 (type: 
int), _col3 (type: int), _col5 (type: int)
+                        value expressions: _col1 (type: int), _col2 (type: 
int), _col3 (type: int), _col4 (type: int)
             Execution mode: vectorized
         Map 34 
             Map Operator Tree:
@@ -530,23 +530,23 @@ STAGE PLANS:
                 keys:
                   0 _col1 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col1, _col2, _col3, _col4, _col8, _col9, 
_col10, _col12
+                outputColumnNames: _col1, _col2, _col3, _col4, _col7, _col8, 
_col9, _col10
                 Statistics: Num rows: 696954748 Data size: 61485550191 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: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col3 (type: int), _col4 (type: 
decimal(7,2)), _col8 (type: int), _col9 (type: int), _col10 (type: int), _col12 
(type: int)
+                  value expressions: _col3 (type: int), _col4 (type: 
decimal(7,2)), _col7 (type: int), _col8 (type: int), _col9 (type: int), _col10 
(type: int)
         Reducer 15 
             Reduce Operator Tree:
               Join Operator
                 condition map:
                      Left Outer Join 0 to 1
-                outputColumnNames: _col3, _col4, _col8, _col9, _col10, _col12, 
_col15, _col16
+                outputColumnNames: _col3, _col4, _col7, _col8, _col9, _col10, 
_col13, _col14
                 Statistics: Num rows: 766650239 Data size: 67634106676 Basic 
stats: COMPLETE Column stats: NONE
                 Select Operator
-                  expressions: _col8 (type: int), _col9 (type: int), _col10 
(type: int), _col12 (type: int), (_col3 - CASE WHEN (_col15 is not null) THEN 
(_col15) ELSE (0) END) (type: int), (_col4 - CASE WHEN (_col16 is not null) 
THEN (_col16) ELSE (0) END) (type: decimal(8,2))
+                  expressions: _col7 (type: int), _col8 (type: int), _col9 
(type: int), _col10 (type: int), (_col3 - CASE WHEN (_col13 is not null) THEN 
(_col13) ELSE (0) END) (type: int), (_col4 - CASE WHEN (_col14 is not null) 
THEN (_col14) ELSE (0) END) (type: decimal(8,2))
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
                   Statistics: Num rows: 766650239 Data size: 67634106676 Basic 
stats: COMPLETE Column stats: NONE
                   Group By Operator
@@ -599,23 +599,23 @@ STAGE PLANS:
                 keys:
                   0 _col1 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col1, _col2, _col3, _col4, _col8, _col9, 
_col10, _col12
+                outputColumnNames: _col1, _col2, _col3, _col4, _col7, _col8, 
_col9, _col10
                 Statistics: Num rows: 174243235 Data size: 23692040863 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: 174243235 Data size: 23692040863 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col3 (type: int), _col4 (type: 
decimal(7,2)), _col8 (type: int), _col9 (type: int), _col10 (type: int), _col12 
(type: int)
+                  value expressions: _col3 (type: int), _col4 (type: 
decimal(7,2)), _col7 (type: int), _col8 (type: int), _col9 (type: int), _col10 
(type: int)
         Reducer 22 
             Reduce Operator Tree:
               Join Operator
                 condition map:
                      Left Outer Join 0 to 1
-                outputColumnNames: _col3, _col4, _col8, _col9, _col10, _col12, 
_col15, _col16
+                outputColumnNames: _col3, _col4, _col7, _col8, _col9, _col10, 
_col13, _col14
                 Statistics: Num rows: 191667562 Data size: 26061245514 Basic 
stats: COMPLETE Column stats: NONE
                 Select Operator
-                  expressions: _col8 (type: int), _col9 (type: int), _col10 
(type: int), _col12 (type: int), (_col3 - CASE WHEN (_col15 is not null) THEN 
(_col15) ELSE (0) END) (type: int), (_col4 - CASE WHEN (_col16 is not null) 
THEN (_col16) ELSE (0) END) (type: decimal(8,2))
+                  expressions: _col7 (type: int), _col8 (type: int), _col9 
(type: int), _col10 (type: int), (_col3 - CASE WHEN (_col13 is not null) THEN 
(_col13) ELSE (0) END) (type: int), (_col4 - CASE WHEN (_col14 is not null) 
THEN (_col14) ELSE (0) END) (type: decimal(8,2))
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
                   Statistics: Num rows: 191667562 Data size: 26061245514 Basic 
stats: COMPLETE Column stats: NONE
                   Group By Operator
@@ -652,23 +652,23 @@ STAGE PLANS:
                 keys:
                   0 _col1 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col1, _col2, _col3, _col4, _col8, _col9, 
_col10, _col12
+                outputColumnNames: _col1, _col2, _col3, _col4, _col7, _col8, 
_col9, _col10
                 Statistics: Num rows: 348467716 Data size: 47189528877 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: 348467716 Data size: 47189528877 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col3 (type: int), _col4 (type: 
decimal(7,2)), _col8 (type: int), _col9 (type: int), _col10 (type: int), _col12 
(type: int)
+                  value expressions: _col3 (type: int), _col4 (type: 
decimal(7,2)), _col7 (type: int), _col8 (type: int), _col9 (type: int), _col10 
(type: int)
         Reducer 29 
             Reduce Operator Tree:
               Join Operator
                 condition map:
                      Left Outer Join 0 to 1
-                outputColumnNames: _col3, _col4, _col8, _col9, _col10, _col12, 
_col15, _col16
+                outputColumnNames: _col3, _col4, _col7, _col8, _col9, _col10, 
_col13, _col14
                 Statistics: Num rows: 383314495 Data size: 51908482889 Basic 
stats: COMPLETE Column stats: NONE
                 Select Operator
-                  expressions: _col8 (type: int), _col9 (type: int), _col10 
(type: int), _col12 (type: int), (_col3 - CASE WHEN (_col15 is not null) THEN 
(_col15) ELSE (0) END) (type: int), (_col4 - CASE WHEN (_col16 is not null) 
THEN (_col16) ELSE (0) END) (type: decimal(8,2))
+                  expressions: _col7 (type: int), _col8 (type: int), _col9 
(type: int), _col10 (type: int), (_col3 - CASE WHEN (_col13 is not null) THEN 
(_col13) ELSE (0) END) (type: int), (_col4 - CASE WHEN (_col14 is not null) 
THEN (_col14) ELSE (0) END) (type: decimal(8,2))
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
                   Statistics: Num rows: 383314495 Data size: 51908482889 Basic 
stats: COMPLETE Column stats: NONE
                   Group By Operator
@@ -689,14 +689,14 @@ STAGE PLANS:
                 keys:
                   0 _col1 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col1, _col2, _col3, _col4, _col8, _col9, 
_col10, _col12
+                outputColumnNames: _col1, _col2, _col3, _col4, _col7, _col8, 
_col9, _col10
                 Statistics: Num rows: 348467716 Data size: 47189528877 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: 348467716 Data size: 47189528877 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col3 (type: int), _col4 (type: 
decimal(7,2)), _col8 (type: int), _col9 (type: int), _col10 (type: int), _col12 
(type: int)
+                  value expressions: _col3 (type: int), _col4 (type: 
decimal(7,2)), _col7 (type: int), _col8 (type: int), _col9 (type: int), _col10 
(type: int)
         Reducer 30 
             Execution mode: vectorized
             Reduce Operator Tree:
@@ -759,23 +759,23 @@ STAGE PLANS:
                 keys:
                   0 _col1 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col1, _col2, _col3, _col4, _col8, _col9, 
_col10, _col12
+                outputColumnNames: _col1, _col2, _col3, _col4, _col7, _col8, 
_col9, _col10
                 Statistics: Num rows: 696954748 Data size: 61485550191 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: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col3 (type: int), _col4 (type: 
decimal(7,2)), _col8 (type: int), _col9 (type: int), _col10 (type: int), _col12 
(type: int)
+                  value expressions: _col3 (type: int), _col4 (type: 
decimal(7,2)), _col7 (type: int), _col8 (type: int), _col9 (type: int), _col10 
(type: int)
         Reducer 38 
             Reduce Operator Tree:
               Join Operator
                 condition map:
                      Left Outer Join 0 to 1
-                outputColumnNames: _col3, _col4, _col8, _col9, _col10, _col12, 
_col15, _col16
+                outputColumnNames: _col3, _col4, _col7, _col8, _col9, _col10, 
_col13, _col14
                 Statistics: Num rows: 766650239 Data size: 67634106676 Basic 
stats: COMPLETE Column stats: NONE
                 Select Operator
-                  expressions: _col8 (type: int), _col9 (type: int), _col10 
(type: int), _col12 (type: int), (_col3 - CASE WHEN (_col15 is not null) THEN 
(_col15) ELSE (0) END) (type: int), (_col4 - CASE WHEN (_col16 is not null) 
THEN (_col16) ELSE (0) END) (type: decimal(8,2))
+                  expressions: _col7 (type: int), _col8 (type: int), _col9 
(type: int), _col10 (type: int), (_col3 - CASE WHEN (_col13 is not null) THEN 
(_col13) ELSE (0) END) (type: int), (_col4 - CASE WHEN (_col14 is not null) 
THEN (_col14) ELSE (0) END) (type: decimal(8,2))
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
                   Statistics: Num rows: 766650239 Data size: 67634106676 Basic 
stats: COMPLETE Column stats: NONE
                   Group By Operator
@@ -793,10 +793,10 @@ STAGE PLANS:
               Join Operator
                 condition map:
                      Left Outer Join 0 to 1
-                outputColumnNames: _col3, _col4, _col8, _col9, _col10, _col12, 
_col15, _col16
+                outputColumnNames: _col3, _col4, _col7, _col8, _col9, _col10, 
_col13, _col14
                 Statistics: Num rows: 383314495 Data size: 51908482889 Basic 
stats: COMPLETE Column stats: NONE
                 Select Operator
-                  expressions: _col8 (type: int), _col9 (type: int), _col10 
(type: int), _col12 (type: int), (_col3 - CASE WHEN (_col15 is not null) THEN 
(_col15) ELSE (0) END) (type: int), (_col4 - CASE WHEN (_col16 is not null) 
THEN (_col16) ELSE (0) END) (type: decimal(8,2))
+                  expressions: _col7 (type: int), _col8 (type: int), _col9 
(type: int), _col10 (type: int), (_col3 - CASE WHEN (_col13 is not null) THEN 
(_col13) ELSE (0) END) (type: int), (_col4 - CASE WHEN (_col14 is not null) 
THEN (_col14) ELSE (0) END) (type: decimal(8,2))
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
                   Statistics: Num rows: 383314495 Data size: 51908482889 Basic 
stats: COMPLETE Column stats: NONE
                   Group By Operator
@@ -833,23 +833,23 @@ STAGE PLANS:
                 keys:
                   0 _col1 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col1, _col2, _col3, _col4, _col8, _col9, 
_col10, _col12
+                outputColumnNames: _col1, _col2, _col3, _col4, _col7, _col8, 
_col9, _col10
                 Statistics: Num rows: 174243235 Data size: 23692040863 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: 174243235 Data size: 23692040863 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col3 (type: int), _col4 (type: 
decimal(7,2)), _col8 (type: int), _col9 (type: int), _col10 (type: int), _col12 
(type: int)
+                  value expressions: _col3 (type: int), _col4 (type: 
decimal(7,2)), _col7 (type: int), _col8 (type: int), _col9 (type: int), _col10 
(type: int)
         Reducer 45 
             Reduce Operator Tree:
               Join Operator
                 condition map:
                      Left Outer Join 0 to 1
-                outputColumnNames: _col3, _col4, _col8, _col9, _col10, _col12, 
_col15, _col16
+                outputColumnNames: _col3, _col4, _col7, _col8, _col9, _col10, 
_col13, _col14
                 Statistics: Num rows: 191667562 Data size: 26061245514 Basic 
stats: COMPLETE Column stats: NONE
                 Select Operator
-                  expressions: _col8 (type: int), _col9 (type: int), _col10 
(type: int), _col12 (type: int), (_col3 - CASE WHEN (_col15 is not null) THEN 
(_col15) ELSE (0) END) (type: int), (_col4 - CASE WHEN (_col16 is not null) 
THEN (_col16) ELSE (0) END) (type: decimal(8,2))
+                  expressions: _col7 (type: int), _col8 (type: int), _col9 
(type: int), _col10 (type: int), (_col3 - CASE WHEN (_col13 is not null) THEN 
(_col13) ELSE (0) END) (type: int), (_col4 - CASE WHEN (_col14 is not null) 
THEN (_col14) ELSE (0) END) (type: decimal(8,2))
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
                   Statistics: Num rows: 191667562 Data size: 26061245514 Basic 
stats: COMPLETE Column stats: NONE
                   Group By Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/spark/query76.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query76.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query76.q.out
index 593ea66..e65a5c9 100644
--- a/ql/src/test/results/clientpositive/perf/spark/query76.q.out
+++ b/ql/src/test/results/clientpositive/perf/spark/query76.q.out
@@ -145,14 +145,14 @@ STAGE PLANS:
                     Statistics: Num rows: 143994918 Data size: 19499804476 
Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: cs_sold_date_sk (type: int), cs_item_sk 
(type: int), cs_ext_sales_price (type: decimal(7,2))
-                      outputColumnNames: _col0, _col2, _col3
+                      outputColumnNames: _col0, _col1, _col2
                       Statistics: Num rows: 143994918 Data size: 19499804476 
Basic stats: COMPLETE Column stats: NONE
                       Reduce Output Operator
-                        key expressions: _col2 (type: int)
+                        key expressions: _col1 (type: int)
                         sort order: +
-                        Map-reduce partition columns: _col2 (type: int)
+                        Map-reduce partition columns: _col1 (type: int)
                         Statistics: Num rows: 143994918 Data size: 19499804476 
Basic stats: COMPLETE Column stats: NONE
-                        value expressions: _col0 (type: int), _col3 (type: 
decimal(7,2))
+                        value expressions: _col0 (type: int), _col2 (type: 
decimal(7,2))
             Execution mode: vectorized
         Map 16 
             Map Operator Tree:
@@ -205,14 +205,14 @@ STAGE PLANS:
                     Statistics: Num rows: 287997817 Data size: 25407250999 
Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: ss_sold_date_sk (type: int), ss_item_sk 
(type: int), ss_ext_sales_price (type: decimal(7,2))
-                      outputColumnNames: _col0, _col1, _col3
+                      outputColumnNames: _col0, _col1, _col2
                       Statistics: Num rows: 287997817 Data size: 25407250999 
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: 287997817 Data size: 25407250999 
Basic stats: COMPLETE Column stats: NONE
-                        value expressions: _col0 (type: int), _col3 (type: 
decimal(7,2))
+                        value expressions: _col0 (type: int), _col2 (type: 
decimal(7,2))
             Execution mode: vectorized
         Map 7 
             Map Operator Tree:
@@ -245,24 +245,24 @@ STAGE PLANS:
                     Statistics: Num rows: 72001334 Data size: 9790099106 Basic 
stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: ws_sold_date_sk (type: int), ws_item_sk 
(type: int), ws_ext_sales_price (type: decimal(7,2))
-                      outputColumnNames: _col0, _col1, _col3
+                      outputColumnNames: _col0, _col1, _col2
                       Statistics: Num rows: 72001334 Data size: 9790099106 
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: 72001334 Data size: 9790099106 
Basic stats: COMPLETE Column stats: NONE
-                        value expressions: _col0 (type: int), _col3 (type: 
decimal(7,2))
+                        value expressions: _col0 (type: int), _col2 (type: 
decimal(7,2))
             Execution mode: vectorized
         Reducer 10 
             Reduce Operator Tree:
               Join Operator
                 condition map:
                      Inner Join 0 to 1
-                outputColumnNames: _col3, _col5, _col7, _col8
+                outputColumnNames: _col2, _col4, _col6, _col7
                 Statistics: Num rows: 87121617 Data size: 11846020431 Basic 
stats: COMPLETE Column stats: NONE
                 Select Operator
-                  expressions: 'web' (type: string), 'ws_web_page_sk' (type: 
string), _col7 (type: int), _col8 (type: int), _col5 (type: string), _col3 
(type: decimal(7,2))
+                  expressions: 'web' (type: string), 'ws_web_page_sk' (type: 
string), _col6 (type: int), _col7 (type: int), _col4 (type: string), _col2 
(type: decimal(7,2))
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
                   Statistics: Num rows: 87121617 Data size: 11846020431 Basic 
stats: COMPLETE Column stats: NONE
                   Group By Operator
@@ -284,25 +284,25 @@ STAGE PLANS:
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 _col2 (type: int)
+                  0 _col1 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col0, _col3, _col5
+                outputColumnNames: _col0, _col2, _col4
                 Statistics: Num rows: 158394413 Data size: 21449785388 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: 158394413 Data size: 21449785388 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col3 (type: decimal(7,2)), _col5 (type: 
string)
+                  value expressions: _col2 (type: decimal(7,2)), _col4 (type: 
string)
         Reducer 15 
             Reduce Operator Tree:
               Join Operator
                 condition map:
                      Inner Join 0 to 1
-                outputColumnNames: _col3, _col5, _col7, _col8
+                outputColumnNames: _col2, _col4, _col6, _col7
                 Statistics: Num rows: 174233858 Data size: 23594764438 Basic 
stats: COMPLETE Column stats: NONE
                 Select Operator
-                  expressions: 'catalog' (type: string), 'cs_warehouse_sk' 
(type: string), _col7 (type: int), _col8 (type: int), _col5 (type: string), 
_col3 (type: decimal(7,2))
+                  expressions: 'catalog' (type: string), 'cs_warehouse_sk' 
(type: string), _col6 (type: int), _col7 (type: int), _col4 (type: string), 
_col2 (type: decimal(7,2))
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
                   Statistics: Num rows: 174233858 Data size: 23594764438 Basic 
stats: COMPLETE Column stats: NONE
                   Group By Operator
@@ -326,23 +326,23 @@ STAGE PLANS:
                 keys:
                   0 _col0 (type: int)
                   1 _col1 (type: int)
-                outputColumnNames: _col1, _col2, _col5
+                outputColumnNames: _col1, _col2, _col4
                 Statistics: Num rows: 316797605 Data size: 27947976704 Basic 
stats: COMPLETE Column stats: NONE
                 Reduce Output Operator
                   key expressions: _col2 (type: int)
                   sort order: +
                   Map-reduce partition columns: _col2 (type: int)
                   Statistics: Num rows: 316797605 Data size: 27947976704 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col1 (type: string), _col5 (type: 
decimal(7,2))
+                  value expressions: _col1 (type: string), _col4 (type: 
decimal(7,2))
         Reducer 3 
             Reduce Operator Tree:
               Join Operator
                 condition map:
                      Inner Join 0 to 1
-                outputColumnNames: _col1, _col5, _col7, _col8
+                outputColumnNames: _col1, _col4, _col6, _col7
                 Statistics: Num rows: 348477373 Data size: 30742775040 Basic 
stats: COMPLETE Column stats: NONE
                 Select Operator
-                  expressions: 'store' (type: string), 'ss_addr_sk' (type: 
string), _col7 (type: int), _col8 (type: int), _col1 (type: string), _col5 
(type: decimal(7,2))
+                  expressions: 'store' (type: string), 'ss_addr_sk' (type: 
string), _col6 (type: int), _col7 (type: int), _col1 (type: string), _col4 
(type: decimal(7,2))
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
                   Statistics: Num rows: 348477373 Data size: 30742775040 Basic 
stats: COMPLETE Column stats: NONE
                   Group By Operator
@@ -398,14 +398,14 @@ STAGE PLANS:
                 keys:
                   0 _col1 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col0, _col3, _col5
+                outputColumnNames: _col0, _col2, _col4
                 Statistics: Num rows: 79201469 Data size: 10769109250 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: 79201469 Data size: 10769109250 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col3 (type: decimal(7,2)), _col5 (type: 
string)
+                  value expressions: _col2 (type: decimal(7,2)), _col4 (type: 
string)
 
   Stage: Stage-0
     Fetch Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/spark/query77.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query77.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query77.q.out
index 1ae664d..0484b15 100644
--- a/ql/src/test/results/clientpositive/perf/spark/query77.q.out
+++ b/ql/src/test/results/clientpositive/perf/spark/query77.q.out
@@ -660,13 +660,13 @@ STAGE PLANS:
                   keys:
                     0 _col1 (type: int)
                     1 _col0 (type: int)
-                  outputColumnNames: _col2, _col3, _col6
+                  outputColumnNames: _col2, _col3, _col5
                   input vertices:
                     1 Map 13
                   Statistics: Num rows: 69685294 Data size: 5399255980 Basic 
stats: COMPLETE Column stats: NONE
                   Group By Operator
                     aggregations: sum(_col2), sum(_col3)
-                    keys: _col6 (type: int)
+                    keys: _col5 (type: int)
                     mode: hash
                     outputColumnNames: _col0, _col1, _col2
                     Statistics: Num rows: 69685294 Data size: 5399255980 Basic 
stats: COMPLETE Column stats: NONE
@@ -747,13 +747,13 @@ STAGE PLANS:
                   keys:
                     0 _col1 (type: int)
                     1 _col0 (type: int)
-                  outputColumnNames: _col2, _col3, _col6
+                  outputColumnNames: _col2, _col3, _col5
                   input vertices:
                     1 Map 8
                   Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
                   Group By Operator
                     aggregations: sum(_col2), sum(_col3)
-                    keys: _col6 (type: int)
+                    keys: _col5 (type: int)
                     mode: hash
                     outputColumnNames: _col0, _col1, _col2
                     Statistics: Num rows: 696954748 Data size: 61485550191 
Basic stats: COMPLETE Column stats: NONE
@@ -781,13 +781,13 @@ STAGE PLANS:
                   keys:
                     0 _col1 (type: int)
                     1 _col0 (type: int)
-                  outputColumnNames: _col2, _col3, _col6
+                  outputColumnNames: _col2, _col3, _col5
                   input vertices:
                     1 Map 25
                   Statistics: Num rows: 174243235 Data size: 23692040863 Basic 
stats: COMPLETE Column stats: NONE
                   Group By Operator
                     aggregations: sum(_col2), sum(_col3)
-                    keys: _col6 (type: int)
+                    keys: _col5 (type: int)
                     mode: hash
                     outputColumnNames: _col0, _col1, _col2
                     Statistics: Num rows: 174243235 Data size: 23692040863 
Basic stats: COMPLETE Column stats: NONE
@@ -854,13 +854,13 @@ STAGE PLANS:
                   keys:
                     0 _col1 (type: int)
                     1 _col0 (type: int)
-                  outputColumnNames: _col2, _col3, _col6
+                  outputColumnNames: _col2, _col3, _col5
                   input vertices:
                     1 Map 30
                   Statistics: Num rows: 17422145 Data size: 1603485031 Basic 
stats: COMPLETE Column stats: NONE
                   Group By Operator
                     aggregations: sum(_col2), sum(_col3)
-                    keys: _col6 (type: int)
+                    keys: _col5 (type: int)
                     mode: hash
                     outputColumnNames: _col0, _col1, _col2
                     Statistics: Num rows: 17422145 Data size: 1603485031 Basic 
stats: COMPLETE Column stats: NONE

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/spark/query78.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query78.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query78.q.out
index 03f7a6d..c121a34 100644
--- a/ql/src/test/results/clientpositive/perf/spark/query78.q.out
+++ b/ql/src/test/results/clientpositive/perf/spark/query78.q.out
@@ -301,11 +301,11 @@ STAGE PLANS:
                 keys:
                   0 _col0 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col3, _col4, _col6, _col7, _col8
+                outputColumnNames: _col2, _col3, _col4, _col5, _col6
                 Statistics: Num rows: 87121617 Data size: 11846020431 Basic 
stats: COMPLETE Column stats: NONE
                 Group By Operator
-                  aggregations: sum(_col6), sum(_col7), sum(_col8)
-                  keys: _col4 (type: int), _col3 (type: int)
+                  aggregations: sum(_col4), sum(_col5), sum(_col6)
+                  keys: _col3 (type: int), _col2 (type: int)
                   mode: hash
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4
                   Statistics: Num rows: 87121617 Data size: 11846020431 Basic 
stats: COMPLETE Column stats: NONE
@@ -349,14 +349,14 @@ STAGE PLANS:
                   Statistics: Num rows: 79201469 Data size: 10769109250 Basic 
stats: COMPLETE Column stats: NONE
                   Select Operator
                     expressions: _col0 (type: int), _col1 (type: int), _col2 
(type: int), _col4 (type: int), _col5 (type: decimal(7,2)), _col6 (type: 
decimal(7,2))
-                    outputColumnNames: _col0, _col1, _col2, _col4, _col5, _col6
+                    outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
                     Statistics: Num rows: 79201469 Data size: 10769109250 
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: 79201469 Data size: 10769109250 
Basic stats: COMPLETE Column stats: NONE
-                      value expressions: _col1 (type: int), _col2 (type: int), 
_col4 (type: int), _col5 (type: decimal(7,2)), _col6 (type: decimal(7,2))
+                      value expressions: _col1 (type: int), _col2 (type: int), 
_col3 (type: int), _col4 (type: decimal(7,2)), _col5 (type: decimal(7,2))
         Reducer 17 
             Reduce Operator Tree:
               Join Operator
@@ -365,11 +365,11 @@ STAGE PLANS:
                 keys:
                   0 _col0 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col3, _col4, _col6, _col7, _col8
+                outputColumnNames: _col2, _col3, _col4, _col5, _col6
                 Statistics: Num rows: 87116928 Data size: 11797382144 Basic 
stats: COMPLETE Column stats: NONE
                 Group By Operator
-                  aggregations: sum(_col6), sum(_col7), sum(_col8)
-                  keys: _col3 (type: int), _col4 (type: int)
+                  aggregations: sum(_col4), sum(_col5), sum(_col6)
+                  keys: _col2 (type: int), _col3 (type: int)
                   mode: hash
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4
                   Statistics: Num rows: 87116928 Data size: 11797382144 Basic 
stats: COMPLETE Column stats: NONE
@@ -406,11 +406,11 @@ STAGE PLANS:
                 keys:
                   0 _col0 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col3, _col4, _col6, _col7, _col8
+                outputColumnNames: _col2, _col3, _col4, _col5, _col6
                 Statistics: Num rows: 348477374 Data size: 30742775095 Basic 
stats: COMPLETE Column stats: NONE
                 Group By Operator
-                  aggregations: sum(_col6), sum(_col7), sum(_col8)
-                  keys: _col4 (type: int), _col3 (type: int)
+                  aggregations: sum(_col4), sum(_col5), sum(_col6)
+                  keys: _col3 (type: int), _col2 (type: int)
                   mode: hash
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4
                   Statistics: Num rows: 348477374 Data size: 30742775095 Basic 
stats: COMPLETE Column stats: NONE
@@ -435,14 +435,14 @@ STAGE PLANS:
                   Statistics: Num rows: 79197206 Data size: 10724892626 Basic 
stats: COMPLETE Column stats: NONE
                   Select Operator
                     expressions: _col0 (type: int), _col1 (type: int), _col2 
(type: int), _col4 (type: int), _col5 (type: decimal(7,2)), _col6 (type: 
decimal(7,2))
-                    outputColumnNames: _col0, _col1, _col2, _col4, _col5, _col6
+                    outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
                     Statistics: Num rows: 79197206 Data size: 10724892626 
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: 79197206 Data size: 10724892626 
Basic stats: COMPLETE Column stats: NONE
-                      value expressions: _col1 (type: int), _col2 (type: int), 
_col4 (type: int), _col5 (type: decimal(7,2)), _col6 (type: decimal(7,2))
+                      value expressions: _col1 (type: int), _col2 (type: int), 
_col3 (type: int), _col4 (type: decimal(7,2)), _col5 (type: decimal(7,2))
         Reducer 3 
             Execution mode: vectorized
             Reduce Operator Tree:
@@ -535,14 +535,14 @@ STAGE PLANS:
                   Statistics: Num rows: 316797606 Data size: 27947976754 Basic 
stats: COMPLETE Column stats: NONE
                   Select Operator
                     expressions: _col0 (type: int), _col1 (type: int), _col2 
(type: int), _col4 (type: int), _col5 (type: decimal(7,2)), _col6 (type: 
decimal(7,2))
-                    outputColumnNames: _col0, _col1, _col2, _col4, _col5, _col6
+                    outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
                     Statistics: Num rows: 316797606 Data size: 27947976754 
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: 316797606 Data size: 27947976754 
Basic stats: COMPLETE Column stats: NONE
-                      value expressions: _col1 (type: int), _col2 (type: int), 
_col4 (type: int), _col5 (type: decimal(7,2)), _col6 (type: decimal(7,2))
+                      value expressions: _col1 (type: int), _col2 (type: int), 
_col3 (type: int), _col4 (type: decimal(7,2)), _col5 (type: decimal(7,2))
 
   Stage: Stage-0
     Fetch Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/spark/query79.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query79.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query79.q.out
index 943301e..a86625e 100644
--- a/ql/src/test/results/clientpositive/perf/spark/query79.q.out
+++ b/ql/src/test/results/clientpositive/perf/spark/query79.q.out
@@ -75,7 +75,7 @@ STAGE PLANS:
                     Statistics: Num rows: 1704 Data size: 3256276 Basic stats: 
COMPLETE Column stats: NONE
                     Select Operator
                       expressions: s_store_sk (type: int), s_city (type: 
string)
-                      outputColumnNames: _col0, _col2
+                      outputColumnNames: _col0, _col1
                       Statistics: Num rows: 1704 Data size: 3256276 Basic 
stats: COMPLETE Column stats: NONE
                       Spark HashTable Sink Operator
                         keys:
@@ -181,23 +181,23 @@ STAGE PLANS:
                 keys:
                   0 _col0 (type: int)
                   1 _col1 (type: int)
-                outputColumnNames: _col1, _col2, _col3, _col5, _col6, _col7
+                outputColumnNames: _col1, _col2, _col3, _col5, _col6, _col7, 
_col8
                 Statistics: Num rows: 421657640 Data size: 37198759428 Basic 
stats: COMPLETE Column stats: NONE
                 Select Operator
-                  expressions: _col2 (type: string), _col1 (type: string), 
_col3 (type: int), _col6 (type: decimal(17,2)), _col7 (type: decimal(17,2)), 
substr(_col5, 1, 30) (type: string)
-                  outputColumnNames: _col0, _col1, _col3, _col4, _col5, _col6
+                  expressions: _col2 (type: string), _col1 (type: string), 
_col8 (type: string), _col3 (type: int), _col6 (type: decimal(17,2)), _col7 
(type: decimal(17,2)), substr(_col5, 1, 30) (type: string)
+                  outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6
                   Statistics: Num rows: 421657640 Data size: 37198759428 Basic 
stats: COMPLETE Column stats: NONE
                   Reduce Output Operator
                     key expressions: _col0 (type: string), _col1 (type: 
string), _col6 (type: string), _col5 (type: decimal(17,2))
                     sort order: ++++
                     Statistics: Num rows: 421657640 Data size: 37198759428 
Basic stats: COMPLETE Column stats: NONE
                     TopN Hash Memory Usage: 0.1
-                    value expressions: _col3 (type: int), _col4 (type: 
decimal(17,2))
+                    value expressions: _col2 (type: string), _col3 (type: 
int), _col4 (type: decimal(17,2))
         Reducer 3 
             Execution mode: vectorized
             Reduce Operator Tree:
               Select Operator
-                expressions: KEY.reducesinkkey0 (type: string), 
KEY.reducesinkkey1 (type: string), KEY.reducesinkkey2 (type: string), 
VALUE._col0 (type: int), VALUE._col1 (type: decimal(17,2)), KEY.reducesinkkey3 
(type: decimal(17,2))
+                expressions: KEY.reducesinkkey0 (type: string), 
KEY.reducesinkkey1 (type: string), VALUE._col0 (type: string), VALUE._col1 
(type: int), VALUE._col2 (type: decimal(17,2)), KEY.reducesinkkey3 (type: 
decimal(17,2))
                 outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
                 Statistics: Num rows: 421657640 Data size: 37198759428 Basic 
stats: COMPLETE Column stats: NONE
                 Limit
@@ -228,7 +228,7 @@ STAGE PLANS:
                   keys:
                     0 _col4 (type: int)
                     1 _col0 (type: int)
-                  outputColumnNames: _col1, _col2, _col3, _col5, _col6, _col7, 
_col13
+                  outputColumnNames: _col1, _col2, _col3, _col5, _col6, _col7, 
_col10
                   input vertices:
                     1 Map 8
                   Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
@@ -238,13 +238,13 @@ STAGE PLANS:
                     keys:
                       0 _col2 (type: int)
                       1 _col0 (type: int)
-                    outputColumnNames: _col1, _col3, _col5, _col6, _col7, 
_col13
+                    outputColumnNames: _col1, _col3, _col5, _col6, _col7, 
_col10
                     input vertices:
                       1 Map 9
                     Statistics: Num rows: 766650239 Data size: 67634106676 
Basic stats: COMPLETE Column stats: NONE
                     Group By Operator
                       aggregations: sum(_col6), sum(_col7)
-                      keys: _col1 (type: int), _col3 (type: int), _col5 (type: 
int), _col13 (type: string)
+                      keys: _col1 (type: int), _col3 (type: int), _col5 (type: 
int), _col10 (type: string)
                       mode: hash
                       outputColumnNames: _col0, _col1, _col2, _col3, _col4, 
_col5
                       Statistics: Num rows: 766650239 Data size: 67634106676 
Basic stats: COMPLETE Column stats: NONE
@@ -264,15 +264,15 @@ STAGE PLANS:
                 outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
                 Statistics: Num rows: 383325119 Data size: 33817053293 Basic 
stats: COMPLETE Column stats: NONE
                 Select Operator
-                  expressions: _col2 (type: int), _col0 (type: int), _col3 
(type: string), _col4 (type: decimal(17,2)), _col5 (type: decimal(17,2))
-                  outputColumnNames: _col0, _col1, _col2, _col3, _col4
+                  expressions: _col2 (type: int), _col0 (type: int), _col3 
(type: string), _col4 (type: decimal(17,2)), _col5 (type: decimal(17,2)), 
substr(_col3, 1, 30) (type: string)
+                  outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
                   Statistics: Num rows: 383325119 Data size: 33817053293 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: 383325119 Data size: 33817053293 
Basic stats: COMPLETE Column stats: NONE
-                    value expressions: _col0 (type: int), _col2 (type: 
string), _col3 (type: decimal(17,2)), _col4 (type: decimal(17,2))
+                    value expressions: _col0 (type: int), _col2 (type: 
string), _col3 (type: decimal(17,2)), _col4 (type: decimal(17,2)), _col5 (type: 
string)
 
   Stage: Stage-0
     Fetch Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/spark/query8.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query8.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query8.q.out
index 520ead3..7bce61e 100644
--- a/ql/src/test/results/clientpositive/perf/spark/query8.q.out
+++ b/ql/src/test/results/clientpositive/perf/spark/query8.q.out
@@ -413,13 +413,13 @@ STAGE PLANS:
                   predicate: (_col1 = 2L) (type: boolean)
                   Statistics: Num rows: 1 Data size: 1014 Basic stats: 
COMPLETE Column stats: NONE
                   Select Operator
-                    expressions: _col0 (type: string)
+                    expressions: substr(_col0, 1, 2) (type: string)
                     outputColumnNames: _col0
                     Statistics: Num rows: 1 Data size: 1014 Basic stats: 
COMPLETE Column stats: NONE
                     Spark HashTable Sink Operator
                       keys:
-                        0 substr(_col0, 1, 2) (type: string)
-                        1 substr(_col2, 1, 2) (type: string)
+                        0 _col0 (type: string)
+                        1 _col2 (type: string)
 
   Stage: Stage-2
     Spark
@@ -435,15 +435,15 @@ STAGE PLANS:
                     predicate: (s_store_sk is not null and substr(s_zip, 1, 2) 
is not null) (type: boolean)
                     Statistics: Num rows: 1704 Data size: 3256276 Basic stats: 
COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: s_store_sk (type: int), s_store_name (type: 
string), s_zip (type: string)
+                      expressions: s_store_sk (type: int), s_store_name (type: 
string), substr(s_zip, 1, 2) (type: string)
                       outputColumnNames: _col0, _col1, _col2
                       Statistics: Num rows: 1704 Data size: 3256276 Basic 
stats: COMPLETE Column stats: NONE
                       Map Join Operator
                         condition map:
                              Inner Join 0 to 1
                         keys:
-                          0 substr(_col0, 1, 2) (type: string)
-                          1 substr(_col2, 1, 2) (type: string)
+                          0 _col0 (type: string)
+                          1 _col2 (type: string)
                         outputColumnNames: _col1, _col2
                         input vertices:
                           0 Reducer 8
@@ -521,13 +521,13 @@ STAGE PLANS:
                   keys:
                     0 _col1 (type: int)
                     1 _col1 (type: int)
-                  outputColumnNames: _col2, _col8
+                  outputColumnNames: _col2, _col6
                   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: _col8 (type: string)
+                    keys: _col6 (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/query80.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query80.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query80.q.out
index 6c5226c..8745af1 100644
--- a/ql/src/test/results/clientpositive/perf/spark/query80.q.out
+++ b/ql/src/test/results/clientpositive/perf/spark/query80.q.out
@@ -674,10 +674,10 @@ STAGE PLANS:
                 keys:
                   0 _col1 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col5, _col6, _col9, _col10, _col18
+                outputColumnNames: _col5, _col6, _col9, _col10, _col15
                 Statistics: Num rows: 463810558 Data size: 62809267017 Basic 
stats: COMPLETE Column stats: NONE
                 Select Operator
-                  expressions: _col18 (type: string), _col5 (type: 
decimal(7,2)), CASE WHEN (_col9 is not null) THEN (_col9) ELSE (0) END (type: 
decimal(12,2)), (_col6 - CASE WHEN (_col10 is not null) THEN (_col10) ELSE (0) 
END) (type: decimal(13,2))
+                  expressions: _col15 (type: string), _col5 (type: 
decimal(7,2)), CASE WHEN (_col9 is not null) THEN (_col9) ELSE (0) END (type: 
decimal(12,2)), (_col6 - CASE WHEN (_col10 is not null) THEN (_col10) ELSE (0) 
END) (type: decimal(13,2))
                   outputColumnNames: _col0, _col1, _col2, _col3
                   Statistics: Num rows: 463810558 Data size: 62809267017 Basic 
stats: COMPLETE Column stats: NONE
                   Group By Operator
@@ -802,12 +802,12 @@ STAGE PLANS:
                     keys:
                       0 _col2 (type: int)
                       1 _col0 (type: int)
-                    outputColumnNames: _col5, _col6, _col9, _col10, _col18
+                    outputColumnNames: _col5, _col6, _col9, _col10, _col15
                     input vertices:
                       1 Map 30
                     Statistics: Num rows: 231917759 Data size: 31534108438 
Basic stats: COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: _col18 (type: string), _col5 (type: 
decimal(7,2)), CASE WHEN (_col9 is not null) THEN (_col9) ELSE (0) END (type: 
decimal(12,2)), (_col6 - CASE WHEN (_col10 is not null) THEN (_col10) ELSE (0) 
END) (type: decimal(13,2))
+                      expressions: _col15 (type: string), _col5 (type: 
decimal(7,2)), CASE WHEN (_col9 is not null) THEN (_col9) ELSE (0) END (type: 
decimal(12,2)), (_col6 - CASE WHEN (_col10 is not null) THEN (_col10) ELSE (0) 
END) (type: decimal(13,2))
                       outputColumnNames: _col0, _col1, _col2, _col3
                       Statistics: Num rows: 231917759 Data size: 31534108438 
Basic stats: COMPLETE Column stats: NONE
                       Group By Operator
@@ -876,12 +876,12 @@ STAGE PLANS:
                     keys:
                       0 _col2 (type: int)
                       1 _col0 (type: int)
-                    outputColumnNames: _col5, _col6, _col9, _col10, _col18
+                    outputColumnNames: _col5, _col6, _col9, _col10, _col15
                     input vertices:
                       1 Map 11
                     Statistics: Num rows: 927646829 Data size: 81837272625 
Basic stats: COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: _col18 (type: string), _col5 (type: 
decimal(7,2)), CASE WHEN (_col9 is not null) THEN (_col9) ELSE (0) END (type: 
decimal(12,2)), (_col6 - CASE WHEN (_col10 is not null) THEN (_col10) ELSE (0) 
END) (type: decimal(13,2))
+                      expressions: _col15 (type: string), _col5 (type: 
decimal(7,2)), CASE WHEN (_col9 is not null) THEN (_col9) ELSE (0) END (type: 
decimal(12,2)), (_col6 - CASE WHEN (_col10 is not null) THEN (_col10) ELSE (0) 
END) (type: decimal(13,2))
                       outputColumnNames: _col0, _col1, _col2, _col3
                       Statistics: Num rows: 927646829 Data size: 81837272625 
Basic stats: COMPLETE Column stats: NONE
                       Group By Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/spark/query81.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query81.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query81.q.out
index d507589..4abcdc6 100644
--- a/ql/src/test/results/clientpositive/perf/spark/query81.q.out
+++ b/ql/src/test/results/clientpositive/perf/spark/query81.q.out
@@ -217,14 +217,14 @@ STAGE PLANS:
                     Statistics: Num rows: 20000000 Data size: 20297597642 
Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: ca_address_sk (type: int), ca_street_number 
(type: string), ca_street_name (type: string), ca_street_type (type: string), 
ca_suite_number (type: string), ca_city (type: string), ca_county (type: 
string), ca_zip (type: string), ca_country (type: string), ca_gmt_offset (type: 
decimal(5,2)), ca_location_type (type: string)
-                      outputColumnNames: _col0, _col1, _col2, _col3, _col4, 
_col5, _col6, _col8, _col9, _col10, _col11
+                      outputColumnNames: _col0, _col1, _col2, _col3, _col4, 
_col5, _col6, _col7, _col8, _col9, _col10
                       Statistics: Num rows: 20000000 Data size: 20297597642 
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: 20000000 Data size: 20297597642 
Basic stats: COMPLETE Column stats: NONE
-                        value expressions: _col1 (type: string), _col2 (type: 
string), _col3 (type: string), _col4 (type: string), _col5 (type: string), 
_col6 (type: string), _col8 (type: string), _col9 (type: string), _col10 (type: 
decimal(5,2)), _col11 (type: string)
+                        value expressions: _col1 (type: string), _col2 (type: 
string), _col3 (type: string), _col4 (type: string), _col5 (type: string), 
_col6 (type: string), _col7 (type: string), _col8 (type: string), _col9 (type: 
decimal(5,2)), _col10 (type: string)
             Execution mode: vectorized
         Map 6 
             Map Operator Tree:
@@ -293,11 +293,11 @@ STAGE PLANS:
                 keys:
                   0 _col2 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col1, _col3, _col7
+                outputColumnNames: _col1, _col3, _col6
                 Statistics: Num rows: 44000000 Data size: 44654715780 Basic 
stats: COMPLETE Column stats: NONE
                 Group By Operator
                   aggregations: sum(_col3)
-                  keys: _col7 (type: string), _col1 (type: int)
+                  keys: _col6 (type: string), _col1 (type: int)
                   mode: hash
                   outputColumnNames: _col0, _col1, _col2
                   Statistics: Num rows: 44000000 Data size: 44654715780 Basic 
stats: COMPLETE Column stats: NONE
@@ -344,14 +344,14 @@ STAGE PLANS:
                 keys:
                   0 _col2 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col0, _col1, _col3, _col4, _col5, _col7, 
_col8, _col9, _col10, _col11, _col12, _col14, _col15, _col16, _col17
+                outputColumnNames: _col0, _col1, _col3, _col4, _col5, _col7, 
_col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15, _col16
                 Statistics: Num rows: 88000001 Data size: 75681779077 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: 88000001 Data size: 75681779077 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col1 (type: string), _col3 (type: 
string), _col4 (type: string), _col5 (type: string), _col7 (type: string), 
_col8 (type: string), _col9 (type: string), _col10 (type: string), _col11 
(type: string), _col12 (type: string), _col14 (type: string), _col15 (type: 
string), _col16 (type: decimal(5,2)), _col17 (type: string)
+                  value expressions: _col1 (type: string), _col3 (type: 
string), _col4 (type: string), _col5 (type: string), _col7 (type: string), 
_col8 (type: string), _col9 (type: string), _col10 (type: string), _col11 
(type: string), _col12 (type: string), _col13 (type: string), _col14 (type: 
string), _col15 (type: decimal(5,2)), _col16 (type: string)
         Reducer 3 
             Reduce Operator Tree:
               Join Operator
@@ -360,10 +360,10 @@ STAGE PLANS:
                 keys:
                   0 _col0 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col1, _col3, _col4, _col5, _col7, _col8, 
_col9, _col10, _col11, _col12, _col14, _col15, _col16, _col17, _col20
+                outputColumnNames: _col1, _col3, _col4, _col5, _col7, _col8, 
_col9, _col10, _col11, _col12, _col13, _col14, _col15, _col16, _col19
                 Statistics: Num rows: 96800003 Data size: 83249958789 Basic 
stats: COMPLETE Column stats: NONE
                 Select Operator
-                  expressions: _col1 (type: string), _col3 (type: string), 
_col4 (type: string), _col5 (type: string), _col7 (type: string), _col8 (type: 
string), _col9 (type: string), _col10 (type: string), _col11 (type: string), 
_col12 (type: string), _col14 (type: string), _col15 (type: string), _col16 
(type: decimal(5,2)), _col17 (type: string), _col20 (type: decimal(17,2))
+                  expressions: _col1 (type: string), _col3 (type: string), 
_col4 (type: string), _col5 (type: string), _col7 (type: string), _col8 (type: 
string), _col9 (type: string), _col10 (type: string), _col11 (type: string), 
_col12 (type: string), _col13 (type: string), _col14 (type: string), _col15 
(type: decimal(5,2)), _col16 (type: string), _col19 (type: decimal(17,2))
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14
                   Statistics: Num rows: 96800003 Data size: 83249958789 Basic 
stats: COMPLETE Column stats: NONE
                   Reduce Output Operator
@@ -416,11 +416,11 @@ STAGE PLANS:
                 keys:
                   0 _col2 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col1, _col3, _col7
+                outputColumnNames: _col1, _col3, _col6
                 Statistics: Num rows: 44000000 Data size: 44654715780 Basic 
stats: COMPLETE Column stats: NONE
                 Group By Operator
                   aggregations: sum(_col3)
-                  keys: _col7 (type: string), _col1 (type: int)
+                  keys: _col6 (type: string), _col1 (type: int)
                   mode: hash
                   outputColumnNames: _col0, _col1, _col2
                   Statistics: Num rows: 44000000 Data size: 44654715780 Basic 
stats: COMPLETE Column stats: NONE

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/spark/query83.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query83.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query83.q.out
index 52eebb9..36ea0d4 100644
--- a/ql/src/test/results/clientpositive/perf/spark/query83.q.out
+++ b/ql/src/test/results/clientpositive/perf/spark/query83.q.out
@@ -564,12 +564,16 @@ STAGE PLANS:
                 mode: mergepartial
                 outputColumnNames: _col0, _col1
                 Statistics: Num rows: 34842647 Data size: 2699627990 Basic 
stats: COMPLETE Column stats: NONE
-                Reduce Output Operator
-                  key expressions: _col0 (type: string)
-                  sort order: +
-                  Map-reduce partition columns: _col0 (type: string)
+                Select Operator
+                  expressions: _col0 (type: string), _col1 (type: bigint), 
UDFToDouble(_col1) (type: double)
+                  outputColumnNames: _col0, _col1, _col2
                   Statistics: Num rows: 34842647 Data size: 2699627990 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col1 (type: bigint)
+                  Reduce Output Operator
+                    key expressions: _col0 (type: string)
+                    sort order: +
+                    Map-reduce partition columns: _col0 (type: string)
+                    Statistics: Num rows: 34842647 Data size: 2699627990 Basic 
stats: COMPLETE Column stats: NONE
+                    value expressions: _col1 (type: bigint), _col2 (type: 
double)
         Reducer 2 
             Reduce Operator Tree:
               Join Operator
@@ -681,12 +685,16 @@ STAGE PLANS:
                 mode: mergepartial
                 outputColumnNames: _col0, _col1
                 Statistics: Num rows: 8711072 Data size: 801742469 Basic 
stats: COMPLETE Column stats: NONE
-                Reduce Output Operator
-                  key expressions: _col0 (type: string)
-                  sort order: +
-                  Map-reduce partition columns: _col0 (type: string)
+                Select Operator
+                  expressions: _col0 (type: string), _col1 (type: bigint), 
UDFToDouble(_col1) (type: double)
+                  outputColumnNames: _col0, _col1, _col2
                   Statistics: Num rows: 8711072 Data size: 801742469 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col1 (type: bigint)
+                  Reduce Output Operator
+                    key expressions: _col0 (type: string)
+                    sort order: +
+                    Map-reduce partition columns: _col0 (type: string)
+                    Statistics: Num rows: 8711072 Data size: 801742469 Basic 
stats: COMPLETE Column stats: NONE
+                    value expressions: _col1 (type: bigint), _col2 (type: 
double)
         Reducer 3 
             Reduce Operator Tree:
               Join Operator
@@ -766,12 +774,16 @@ STAGE PLANS:
                 mode: mergepartial
                 outputColumnNames: _col0, _col1
                 Statistics: Num rows: 17423323 Data size: 1849627061 Basic 
stats: COMPLETE Column stats: NONE
-                Reduce Output Operator
-                  key expressions: _col0 (type: string)
-                  sort order: +
-                  Map-reduce partition columns: _col0 (type: string)
+                Select Operator
+                  expressions: _col0 (type: string), _col1 (type: bigint), 
UDFToDouble(_col1) (type: double)
+                  outputColumnNames: _col0, _col1, _col2
                   Statistics: Num rows: 17423323 Data size: 1849627061 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col1 (type: bigint)
+                  Reduce Output Operator
+                    key expressions: _col0 (type: string)
+                    sort order: +
+                    Map-reduce partition columns: _col0 (type: string)
+                    Statistics: Num rows: 17423323 Data size: 1849627061 Basic 
stats: COMPLETE Column stats: NONE
+                    value expressions: _col1 (type: bigint), _col2 (type: 
double)
         Reducer 5 
             Reduce Operator Tree:
               Join Operator
@@ -782,10 +794,10 @@ STAGE PLANS:
                   0 _col0 (type: string)
                   1 _col0 (type: string)
                   2 _col0 (type: string)
-                outputColumnNames: _col0, _col1, _col3, _col5
+                outputColumnNames: _col0, _col1, _col2, _col4, _col5, _col7, 
_col8
                 Statistics: Num rows: 76653825 Data size: 5939181706 Basic 
stats: COMPLETE Column stats: NONE
                 Select Operator
-                  expressions: _col0 (type: string), _col3 (type: bigint), 
(((UDFToDouble(_col3) / UDFToDouble(((_col3 + _col1) + _col5))) / 3.0D) * 
100.0D) (type: double), _col1 (type: bigint), (((UDFToDouble(_col1) / 
UDFToDouble(((_col3 + _col1) + _col5))) / 3.0D) * 100.0D) (type: double), _col5 
(type: bigint), (((UDFToDouble(_col5) / UDFToDouble(((_col3 + _col1) + _col5))) 
/ 3.0D) * 100.0D) (type: double), (CAST( ((_col3 + _col1) + _col5) AS 
decimal(19,0)) / 3) (type: decimal(25,6))
+                  expressions: _col0 (type: string), _col4 (type: bigint), 
(((_col5 / UDFToDouble(((_col4 + _col1) + _col7))) / 3.0D) * 100.0D) (type: 
double), _col1 (type: bigint), (((_col2 / UDFToDouble(((_col4 + _col1) + 
_col7))) / 3.0D) * 100.0D) (type: double), _col7 (type: bigint), (((_col8 / 
UDFToDouble(((_col4 + _col1) + _col7))) / 3.0D) * 100.0D) (type: double), 
(CAST( ((_col4 + _col1) + _col7) AS decimal(19,0)) / 3) (type: decimal(25,6))
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7
                   Statistics: Num rows: 76653825 Data size: 5939181706 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/query84.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query84.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query84.q.out
index 921caee..c7935da 100644
--- a/ql/src/test/results/clientpositive/perf/spark/query84.q.out
+++ b/ql/src/test/results/clientpositive/perf/spark/query84.q.out
@@ -175,15 +175,15 @@ STAGE PLANS:
                     predicate: (c_current_addr_sk is not null and 
c_current_cdemo_sk is not null and c_current_hdemo_sk is not null) (type: 
boolean)
                     Statistics: Num rows: 80000000 Data size: 68801615852 
Basic stats: COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: c_customer_id (type: string), 
c_current_cdemo_sk (type: int), c_current_hdemo_sk (type: int), 
c_current_addr_sk (type: int), c_first_name (type: string), c_last_name (type: 
string)
-                      outputColumnNames: _col0, _col1, _col2, _col3, _col4, 
_col5
+                      expressions: c_customer_id (type: string), 
c_current_cdemo_sk (type: int), c_current_hdemo_sk (type: int), 
c_current_addr_sk (type: int), concat(concat(c_last_name, ', '), c_first_name) 
(type: string)
+                      outputColumnNames: _col0, _col1, _col2, _col3, _col4
                       Statistics: Num rows: 80000000 Data size: 68801615852 
Basic stats: COMPLETE Column stats: NONE
                       Reduce Output Operator
                         key expressions: _col3 (type: int)
                         sort order: +
                         Map-reduce partition columns: _col3 (type: int)
                         Statistics: Num rows: 80000000 Data size: 68801615852 
Basic stats: COMPLETE Column stats: NONE
-                        value expressions: _col0 (type: string), _col1 (type: 
int), _col2 (type: int), _col4 (type: string), _col5 (type: string)
+                        value expressions: _col0 (type: string), _col1 (type: 
int), _col2 (type: int), _col4 (type: string)
             Execution mode: vectorized
         Map 7 
             Map Operator Tree:
@@ -214,10 +214,10 @@ STAGE PLANS:
                   0 _col0 (type: int)
                   1 _col0 (type: int)
                   2 _col1 (type: int)
-                outputColumnNames: _col2, _col6, _col7
+                outputColumnNames: _col2, _col6
                 Statistics: Num rows: 212960011 Data size: 183149913305 Basic 
stats: COMPLETE Column stats: NONE
                 Select Operator
-                  expressions: concat(concat(_col7, ', '), _col6) (type: 
string), _col2 (type: string)
+                  expressions: _col6 (type: string), _col2 (type: string)
                   outputColumnNames: _col1, _col2
                   Statistics: Num rows: 212960011 Data size: 183149913305 
Basic stats: COMPLETE Column stats: NONE
                   Reduce Output Operator
@@ -253,7 +253,7 @@ STAGE PLANS:
                 keys:
                   0 _col3 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col0, _col1, _col2, _col4, _col5
+                outputColumnNames: _col0, _col1, _col2, _col4
                 Statistics: Num rows: 88000001 Data size: 75681779077 Basic 
stats: COMPLETE Column stats: NONE
                 Map Join Operator
                   condition map:
@@ -261,7 +261,7 @@ STAGE PLANS:
                   keys:
                     0 _col2 (type: int)
                     1 _col0 (type: int)
-                  outputColumnNames: _col0, _col1, _col4, _col5
+                  outputColumnNames: _col0, _col1, _col4
                   input vertices:
                     1 Map 8
                   Statistics: Num rows: 96800003 Data size: 83249958789 Basic 
stats: COMPLETE Column stats: NONE
@@ -270,7 +270,7 @@ STAGE PLANS:
                     sort order: +
                     Map-reduce partition columns: _col1 (type: int)
                     Statistics: Num rows: 96800003 Data size: 83249958789 
Basic stats: COMPLETE Column stats: NONE
-                    value expressions: _col0 (type: string), _col4 (type: 
string), _col5 (type: string)
+                    value expressions: _col0 (type: string), _col4 (type: 
string)
 
   Stage: Stage-0
     Fetch Operator

Reply via email to