http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/spark/query18.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query18.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query18.q.out
index e77a918..1d73576 100644
--- a/ql/src/test/results/clientpositive/perf/spark/query18.q.out
+++ b/ql/src/test/results/clientpositive/perf/spark/query18.q.out
@@ -106,15 +106,15 @@ STAGE PLANS:
                     predicate: ((c_birth_month) IN (9, 5, 12, 4, 1, 10) and 
c_current_addr_sk is not null and c_current_cdemo_sk is not null and 
c_customer_sk is not null) (type: boolean)
                     Statistics: Num rows: 80000000 Data size: 68801615852 
Basic stats: COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: c_customer_sk (type: int), 
c_current_cdemo_sk (type: int), c_current_addr_sk (type: int), c_birth_year 
(type: int)
-                      outputColumnNames: _col0, _col1, _col2, _col4
+                      expressions: c_customer_sk (type: int), 
c_current_cdemo_sk (type: int), c_current_addr_sk (type: int), CAST( 
c_birth_year AS decimal(12,2)) (type: decimal(12,2))
+                      outputColumnNames: _col0, _col1, _col2, _col3
                       Statistics: Num rows: 80000000 Data size: 68801615852 
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: 80000000 Data size: 68801615852 
Basic stats: COMPLETE Column stats: NONE
-                        value expressions: _col0 (type: int), _col1 (type: 
int), _col4 (type: int)
+                        value expressions: _col0 (type: int), _col1 (type: 
int), _col3 (type: decimal(12,2))
             Execution mode: vectorized
         Map 13 
             Map Operator Tree:
@@ -145,15 +145,15 @@ STAGE PLANS:
                     predicate: ((cd_education_status = 'College') and 
(cd_gender = 'M') and cd_demo_sk is not null) (type: boolean)
                     Statistics: Num rows: 465450 Data size: 179296539 Basic 
stats: COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: cd_demo_sk (type: int), cd_dep_count (type: 
int)
-                      outputColumnNames: _col0, _col3
+                      expressions: cd_demo_sk (type: int), CAST( cd_dep_count 
AS decimal(12,2)) (type: decimal(12,2))
+                      outputColumnNames: _col0, _col1
                       Statistics: Num rows: 465450 Data size: 179296539 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: 465450 Data size: 179296539 
Basic stats: COMPLETE Column stats: NONE
-                        value expressions: _col3 (type: int)
+                        value expressions: _col1 (type: decimal(12,2))
             Execution mode: vectorized
         Map 15 
             Map Operator Tree:
@@ -224,7 +224,7 @@ STAGE PLANS:
                     predicate: (cs_bill_cdemo_sk is not null and 
cs_bill_customer_sk is not null and cs_item_sk is not null and cs_sold_date_sk 
is not null) (type: boolean)
                     Statistics: Num rows: 287989836 Data size: 38999608952 
Basic stats: COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: cs_sold_date_sk (type: int), 
cs_bill_customer_sk (type: int), cs_bill_cdemo_sk (type: int), cs_item_sk 
(type: int), cs_quantity (type: int), cs_list_price (type: decimal(7,2)), 
cs_sales_price (type: decimal(7,2)), cs_coupon_amt (type: decimal(7,2)), 
cs_net_profit (type: decimal(7,2))
+                      expressions: cs_sold_date_sk (type: int), 
cs_bill_customer_sk (type: int), cs_bill_cdemo_sk (type: int), cs_item_sk 
(type: int), CAST( cs_quantity AS decimal(12,2)) (type: decimal(12,2)), CAST( 
cs_list_price AS decimal(12,2)) (type: decimal(12,2)), CAST( cs_coupon_amt AS 
decimal(12,2)) (type: decimal(12,2)), CAST( cs_sales_price AS decimal(12,2)) 
(type: decimal(12,2)), CAST( cs_net_profit AS decimal(12,2)) (type: 
decimal(12,2))
                       outputColumnNames: _col0, _col1, _col2, _col3, _col4, 
_col5, _col6, _col7, _col8
                       Statistics: Num rows: 287989836 Data size: 38999608952 
Basic stats: COMPLETE Column stats: NONE
                       Reduce Output Operator
@@ -232,7 +232,7 @@ STAGE PLANS:
                         sort order: +
                         Map-reduce partition columns: _col0 (type: int)
                         Statistics: Num rows: 287989836 Data size: 38999608952 
Basic stats: COMPLETE Column stats: NONE
-                        value expressions: _col1 (type: int), _col2 (type: 
int), _col3 (type: int), _col4 (type: int), _col5 (type: decimal(7,2)), _col6 
(type: decimal(7,2)), _col7 (type: decimal(7,2)), _col8 (type: decimal(7,2))
+                        value expressions: _col1 (type: int), _col2 (type: 
int), _col3 (type: int), _col4 (type: decimal(12,2)), _col5 (type: 
decimal(12,2)), _col6 (type: decimal(12,2)), _col7 (type: decimal(12,2)), _col8 
(type: decimal(12,2))
             Execution mode: vectorized
         Reducer 10 
             Reduce Operator Tree:
@@ -249,7 +249,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: decimal(7,2)), _col6 (type: decimal(7,2)), 
_col7 (type: decimal(7,2)), _col8 (type: decimal(7,2))
+                  value expressions: _col1 (type: int), _col3 (type: int), 
_col4 (type: decimal(12,2)), _col5 (type: decimal(12,2)), _col6 (type: 
decimal(12,2)), _col7 (type: decimal(12,2)), _col8 (type: decimal(12,2))
         Reducer 11 
             Reduce Operator Tree:
               Join Operator
@@ -258,14 +258,14 @@ STAGE PLANS:
                 keys:
                   0 _col2 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col1, _col3, _col4, _col5, _col6, _col7, 
_col8, _col14
+                outputColumnNames: _col1, _col3, _col4, _col5, _col6, _col7, 
_col8, _col11
                 Statistics: Num rows: 348467716 Data size: 47189528877 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: 348467716 Data size: 47189528877 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col1 (type: int), _col4 (type: int), 
_col5 (type: decimal(7,2)), _col6 (type: decimal(7,2)), _col7 (type: 
decimal(7,2)), _col8 (type: decimal(7,2)), _col14 (type: int)
+                  value expressions: _col1 (type: int), _col4 (type: 
decimal(12,2)), _col5 (type: decimal(12,2)), _col6 (type: decimal(12,2)), _col7 
(type: decimal(12,2)), _col8 (type: decimal(12,2)), _col11 (type: decimal(12,2))
         Reducer 12 
             Reduce Operator Tree:
               Join Operator
@@ -274,18 +274,18 @@ STAGE PLANS:
                 keys:
                   0 _col3 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col1, _col4, _col5, _col6, _col7, _col8, 
_col14, _col16
+                outputColumnNames: _col1, _col4, _col5, _col6, _col7, _col8, 
_col11, _col13
                 Statistics: Num rows: 383314495 Data size: 51908482889 Basic 
stats: COMPLETE Column stats: NONE
                 Select Operator
-                  expressions: _col16 (type: string), _col1 (type: int), _col4 
(type: int), _col5 (type: decimal(7,2)), _col6 (type: decimal(7,2)), _col7 
(type: decimal(7,2)), _col8 (type: decimal(7,2)), _col14 (type: int)
-                  outputColumnNames: _col1, _col3, _col6, _col7, _col8, _col9, 
_col10, _col16
+                  expressions: _col13 (type: string), _col1 (type: int), _col4 
(type: decimal(12,2)), _col5 (type: decimal(12,2)), _col6 (type: 
decimal(12,2)), _col7 (type: decimal(12,2)), _col8 (type: decimal(12,2)), 
_col11 (type: decimal(12,2))
+                  outputColumnNames: _col1, _col3, _col6, _col7, _col8, _col9, 
_col10, _col13
                   Statistics: Num rows: 383314495 Data size: 51908482889 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: 383314495 Data size: 51908482889 
Basic stats: COMPLETE Column stats: NONE
-                    value expressions: _col1 (type: string), _col6 (type: 
int), _col7 (type: decimal(7,2)), _col8 (type: decimal(7,2)), _col9 (type: 
decimal(7,2)), _col10 (type: decimal(7,2)), _col16 (type: int)
+                    value expressions: _col1 (type: string), _col6 (type: 
decimal(12,2)), _col7 (type: decimal(12,2)), _col8 (type: decimal(12,2)), _col9 
(type: decimal(12,2)), _col10 (type: decimal(12,2)), _col13 (type: 
decimal(12,2))
         Reducer 2 
             Reduce Operator Tree:
               Join Operator
@@ -294,14 +294,14 @@ STAGE PLANS:
                 keys:
                   0 _col2 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col0, _col1, _col4, _col6, _col7, _col8
+                outputColumnNames: _col0, _col1, _col3, _col5, _col6, _col7
                 Statistics: Num rows: 88000001 Data size: 75681779077 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: 88000001 Data size: 75681779077 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col0 (type: int), _col4 (type: int), 
_col6 (type: string), _col7 (type: string), _col8 (type: string)
+                  value expressions: _col0 (type: int), _col3 (type: 
decimal(12,2)), _col5 (type: string), _col6 (type: string), _col7 (type: string)
         Reducer 3 
             Reduce Operator Tree:
               Join Operator
@@ -310,14 +310,14 @@ STAGE PLANS:
                 keys:
                   0 _col1 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col0, _col4, _col6, _col7, _col8
+                outputColumnNames: _col0, _col3, _col5, _col6, _col7
                 Statistics: Num rows: 96800003 Data size: 83249958789 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: 96800003 Data size: 83249958789 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col4 (type: int), _col6 (type: string), 
_col7 (type: string), _col8 (type: string)
+                  value expressions: _col3 (type: decimal(12,2)), _col5 (type: 
string), _col6 (type: string), _col7 (type: string)
         Reducer 4 
             Reduce Operator Tree:
               Join Operator
@@ -326,24 +326,20 @@ STAGE PLANS:
                 keys:
                   0 _col0 (type: int)
                   1 _col3 (type: int)
-                outputColumnNames: _col4, _col6, _col7, _col8, _col11, _col16, 
_col17, _col18, _col19, _col20, _col26
+                outputColumnNames: _col3, _col5, _col6, _col7, _col10, _col15, 
_col16, _col17, _col18, _col19, _col22
                 Statistics: Num rows: 421645953 Data size: 57099332415 Basic 
stats: COMPLETE Column stats: NONE
-                Select Operator
-                  expressions: _col11 (type: string), _col8 (type: string), 
_col7 (type: string), _col6 (type: string), CAST( _col16 AS decimal(12,2)) 
(type: decimal(12,2)), CAST( _col17 AS decimal(12,2)) (type: decimal(12,2)), 
CAST( _col19 AS decimal(12,2)) (type: decimal(12,2)), CAST( _col18 AS 
decimal(12,2)) (type: decimal(12,2)), CAST( _col20 AS decimal(12,2)) (type: 
decimal(12,2)), CAST( _col4 AS decimal(12,2)) (type: decimal(12,2)), CAST( 
_col26 AS decimal(12,2)) (type: decimal(12,2))
-                  outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7, _col8, _col9, _col10
-                  Statistics: Num rows: 421645953 Data size: 57099332415 Basic 
stats: COMPLETE Column stats: NONE
-                  Group By Operator
-                    aggregations: sum(_col4), count(_col4), sum(_col5), 
count(_col5), sum(_col6), count(_col6), sum(_col7), count(_col7), sum(_col8), 
count(_col8), sum(_col9), count(_col9), sum(_col10), count(_col10)
-                    keys: _col0 (type: string), _col1 (type: string), _col2 
(type: string), _col3 (type: string), 0L (type: bigint)
-                    mode: hash
-                    outputColumnNames: _col0, _col1, _col2, _col3, _col4, 
_col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, 
_col15, _col16, _col17, _col18
+                Group By Operator
+                  aggregations: sum(_col15), count(_col15), sum(_col16), 
count(_col16), sum(_col17), count(_col17), sum(_col18), count(_col18), 
sum(_col19), count(_col19), sum(_col3), count(_col3), sum(_col22), count(_col22)
+                  keys: _col5 (type: string), _col6 (type: string), _col7 
(type: string), _col10 (type: string), 0L (type: bigint)
+                  mode: hash
+                  outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15, 
_col16, _col17, _col18
+                  Statistics: Num rows: 2108229765 Data size: 285496662075 
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: bigint)
+                    sort order: +++++
+                    Map-reduce partition columns: _col0 (type: string), _col1 
(type: string), _col2 (type: string), _col3 (type: string), _col4 (type: bigint)
                     Statistics: Num rows: 2108229765 Data size: 285496662075 
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: bigint)
-                      sort order: +++++
-                      Map-reduce partition columns: _col0 (type: string), 
_col1 (type: string), _col2 (type: string), _col3 (type: string), _col4 (type: 
bigint)
-                      Statistics: Num rows: 2108229765 Data size: 285496662075 
Basic stats: COMPLETE Column stats: NONE
-                      value expressions: _col5 (type: decimal(22,2)), _col6 
(type: bigint), _col7 (type: decimal(22,2)), _col8 (type: bigint), _col9 (type: 
decimal(22,2)), _col10 (type: bigint), _col11 (type: decimal(22,2)), _col12 
(type: bigint), _col13 (type: decimal(22,2)), _col14 (type: bigint), _col15 
(type: decimal(22,2)), _col16 (type: bigint), _col17 (type: decimal(22,2)), 
_col18 (type: bigint)
+                    value expressions: _col5 (type: decimal(22,2)), _col6 
(type: bigint), _col7 (type: decimal(22,2)), _col8 (type: bigint), _col9 (type: 
decimal(22,2)), _col10 (type: bigint), _col11 (type: decimal(22,2)), _col12 
(type: bigint), _col13 (type: decimal(22,2)), _col14 (type: bigint), _col15 
(type: decimal(22,2)), _col16 (type: bigint), _col17 (type: decimal(22,2)), 
_col18 (type: bigint)
         Reducer 5 
             Execution mode: vectorized
             Reduce Operator Tree:
@@ -355,7 +351,7 @@ STAGE PLANS:
                 Statistics: Num rows: 1054114882 Data size: 142748330969 Basic 
stats: COMPLETE Column stats: NONE
                 pruneGroupingSetId: true
                 Select Operator
-                  expressions: _col0 (type: string), _col1 (type: string), 
_col2 (type: string), _col3 (type: string), (_col5 / _col6) (type: 
decimal(38,18)), (_col7 / _col8) (type: decimal(38,18)), (_col9 / _col10) 
(type: decimal(38,18)), (_col11 / _col12) (type: decimal(38,18)), (_col13 / 
_col14) (type: decimal(38,18)), (_col15 / _col16) (type: decimal(38,18)), 
(_col17 / _col18) (type: decimal(38,18))
+                  expressions: _col3 (type: string), _col2 (type: string), 
_col1 (type: string), _col0 (type: string), (_col5 / _col6) (type: 
decimal(38,18)), (_col7 / _col8) (type: decimal(38,18)), (_col9 / _col10) 
(type: decimal(38,18)), (_col11 / _col12) (type: decimal(38,18)), (_col13 / 
_col14) (type: decimal(38,18)), (_col15 / _col16) (type: decimal(38,18)), 
(_col17 / _col18) (type: decimal(38,18))
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7, _col8, _col9, _col10
                   Statistics: Num rows: 1054114882 Data size: 142748330969 
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/query19.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query19.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query19.q.out
index 237157e..f6e29e6 100644
--- a/ql/src/test/results/clientpositive/perf/spark/query19.q.out
+++ b/ql/src/test/results/clientpositive/perf/spark/query19.q.out
@@ -80,7 +80,7 @@ STAGE PLANS:
                     predicate: s_store_sk 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_zip (type: string)
+                      expressions: s_store_sk (type: int), substr(s_zip, 1, 5) 
(type: string)
                       outputColumnNames: _col0, _col1
                       Statistics: Num rows: 1704 Data size: 3256276 Basic 
stats: COMPLETE Column stats: NONE
                       Spark HashTable Sink Operator
@@ -171,7 +171,7 @@ STAGE PLANS:
                     predicate: ca_address_sk is not null (type: boolean)
                     Statistics: Num rows: 40000000 Data size: 40595195284 
Basic stats: COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: ca_address_sk (type: int), ca_zip (type: 
string)
+                      expressions: ca_address_sk (type: int), substr(ca_zip, 
1, 5) (type: string)
                       outputColumnNames: _col0, _col1
                       Statistics: Num rows: 40000000 Data size: 40595195284 
Basic stats: COMPLETE Column stats: NONE
                       Reduce Output Operator
@@ -227,7 +227,7 @@ STAGE PLANS:
                 keys:
                   0 _col0 (type: int)
                   1 _col2 (type: int)
-                outputColumnNames: _col3, _col7, _col8, _col13, _col14, 
_col15, _col16
+                outputColumnNames: _col3, _col7, _col8, _col11, _col12, 
_col13, _col14
                 Statistics: Num rows: 766650239 Data size: 67634106676 Basic 
stats: COMPLETE Column stats: NONE
                 Map Join Operator
                   condition map:
@@ -235,20 +235,20 @@ STAGE PLANS:
                   keys:
                     0 _col7 (type: int)
                     1 _col0 (type: int)
-                  outputColumnNames: _col3, _col8, _col13, _col14, _col15, 
_col16, _col19
+                  outputColumnNames: _col3, _col8, _col11, _col12, _col13, 
_col14, _col16
                   input vertices:
                     1 Map 12
                   Statistics: Num rows: 843315281 Data size: 74397518956 Basic 
stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (substr(_col3, 1, 5) <> substr(_col19, 1, 5)) 
(type: boolean)
+                    predicate: (_col3 <> _col16) (type: boolean)
                     Statistics: Num rows: 843315281 Data size: 74397518956 
Basic stats: COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: _col8 (type: decimal(7,2)), _col13 (type: 
int), _col14 (type: string), _col15 (type: int), _col16 (type: string)
-                      outputColumnNames: _col8, _col13, _col14, _col15, _col16
+                      expressions: _col8 (type: decimal(7,2)), _col11 (type: 
int), _col12 (type: string), _col13 (type: int), _col14 (type: string)
+                      outputColumnNames: _col8, _col11, _col12, _col13, _col14
                       Statistics: Num rows: 843315281 Data size: 74397518956 
Basic stats: COMPLETE Column stats: NONE
                       Group By Operator
                         aggregations: sum(_col8)
-                        keys: _col14 (type: string), _col13 (type: int), 
_col15 (type: int), _col16 (type: string)
+                        keys: _col12 (type: string), _col11 (type: int), 
_col13 (type: int), _col14 (type: string)
                         mode: hash
                         outputColumnNames: _col0, _col1, _col2, _col3, _col4
                         Statistics: Num rows: 843315281 Data size: 74397518956 
Basic stats: COMPLETE Column stats: NONE
@@ -317,14 +317,14 @@ STAGE PLANS:
                 keys:
                   0 _col1 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col2, _col3, _col4, _col9, _col10, _col11, 
_col12
+                outputColumnNames: _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: _col2 (type: int)
                   sort order: +
                   Map-reduce partition columns: _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)), _col9 (type: int), _col10 (type: string), _col11 (type: int), 
_col12 (type: string)
+                  value expressions: _col3 (type: int), _col4 (type: 
decimal(7,2)), _col7 (type: int), _col8 (type: string), _col9 (type: int), 
_col10 (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/query2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query2.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query2.q.out
index 07e8c66..f623575 100644
--- a/ql/src/test/results/clientpositive/perf/spark/query2.q.out
+++ b/ql/src/test/results/clientpositive/perf/spark/query2.q.out
@@ -191,15 +191,15 @@ STAGE PLANS:
                     predicate: (d_date_sk is not null and d_week_seq 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_week_seq (type: 
int), d_day_name (type: string)
-                      outputColumnNames: _col0, _col1, _col2
+                      expressions: d_date_sk (type: int), d_week_seq (type: 
int), (d_day_name = 'Sunday') (type: boolean), (d_day_name = 'Monday') (type: 
boolean), (d_day_name = 'Tuesday') (type: boolean), (d_day_name = 'Wednesday') 
(type: boolean), (d_day_name = 'Thursday') (type: boolean), (d_day_name = 
'Friday') (type: boolean), (d_day_name = 'Saturday') (type: boolean)
+                      outputColumnNames: _col0, _col1, _col2, _col3, _col4, 
_col5, _col6, _col7, _col8
                       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: _col1 (type: int), _col2 (type: 
string)
+                        value expressions: _col1 (type: int), _col2 (type: 
boolean), _col3 (type: boolean), _col4 (type: boolean), _col5 (type: boolean), 
_col6 (type: boolean), _col7 (type: boolean), _col8 (type: boolean)
             Execution mode: vectorized
         Map 15 
             Map Operator Tree:
@@ -250,15 +250,15 @@ STAGE PLANS:
                     predicate: (d_date_sk is not null and d_week_seq 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_week_seq (type: 
int), d_day_name (type: string)
-                      outputColumnNames: _col0, _col1, _col2
+                      expressions: d_date_sk (type: int), d_week_seq (type: 
int), (d_day_name = 'Sunday') (type: boolean), (d_day_name = 'Monday') (type: 
boolean), (d_day_name = 'Tuesday') (type: boolean), (d_day_name = 'Wednesday') 
(type: boolean), (d_day_name = 'Thursday') (type: boolean), (d_day_name = 
'Friday') (type: boolean), (d_day_name = 'Saturday') (type: boolean)
+                      outputColumnNames: _col0, _col1, _col2, _col3, _col4, 
_col5, _col6, _col7, _col8
                       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: _col1 (type: int), _col2 (type: 
string)
+                        value expressions: _col1 (type: int), _col2 (type: 
boolean), _col3 (type: boolean), _col4 (type: boolean), _col5 (type: boolean), 
_col6 (type: boolean), _col7 (type: boolean), _col8 (type: boolean)
             Execution mode: vectorized
         Map 8 
             Map Operator Tree:
@@ -307,10 +307,10 @@ STAGE PLANS:
                 keys:
                   0 _col0 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col1, _col3, _col4
+                outputColumnNames: _col1, _col3, _col4, _col5, _col6, _col7, 
_col8, _col9, _col10
                 Statistics: Num rows: 475191764 Data size: 64437789277 Basic 
stats: COMPLETE Column stats: NONE
                 Select Operator
-                  expressions: _col3 (type: int), CASE WHEN ((_col4 = 
'Sunday')) THEN (_col1) ELSE (null) END (type: decimal(7,2)), CASE WHEN ((_col4 
= 'Monday')) THEN (_col1) ELSE (null) END (type: decimal(7,2)), CASE WHEN 
((_col4 = 'Tuesday')) THEN (_col1) ELSE (null) END (type: decimal(7,2)), CASE 
WHEN ((_col4 = 'Wednesday')) THEN (_col1) ELSE (null) END (type: decimal(7,2)), 
CASE WHEN ((_col4 = 'Thursday')) THEN (_col1) ELSE (null) END (type: 
decimal(7,2)), CASE WHEN ((_col4 = 'Friday')) THEN (_col1) ELSE (null) END 
(type: decimal(7,2)), CASE WHEN ((_col4 = 'Saturday')) THEN (_col1) ELSE (null) 
END (type: decimal(7,2))
+                  expressions: _col3 (type: int), CASE WHEN (_col4) THEN 
(_col1) ELSE (null) END (type: decimal(7,2)), CASE WHEN (_col5) THEN (_col1) 
ELSE (null) END (type: decimal(7,2)), CASE WHEN (_col6) THEN (_col1) ELSE 
(null) END (type: decimal(7,2)), CASE WHEN (_col7) THEN (_col1) ELSE (null) END 
(type: decimal(7,2)), CASE WHEN (_col8) THEN (_col1) ELSE (null) END (type: 
decimal(7,2)), CASE WHEN (_col9) THEN (_col1) ELSE (null) END (type: 
decimal(7,2)), CASE WHEN (_col10) THEN (_col1) ELSE (null) END (type: 
decimal(7,2))
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7
                   Statistics: Num rows: 475191764 Data size: 64437789277 Basic 
stats: COMPLETE Column stats: NONE
                   Group By Operator
@@ -364,10 +364,10 @@ STAGE PLANS:
                 keys:
                   0 _col0 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col1, _col3, _col4
+                outputColumnNames: _col1, _col3, _col4, _col5, _col6, _col7, 
_col8, _col9, _col10
                 Statistics: Num rows: 475191764 Data size: 64437789277 Basic 
stats: COMPLETE Column stats: NONE
                 Select Operator
-                  expressions: _col3 (type: int), CASE WHEN ((_col4 = 
'Sunday')) THEN (_col1) ELSE (null) END (type: decimal(7,2)), CASE WHEN ((_col4 
= 'Monday')) THEN (_col1) ELSE (null) END (type: decimal(7,2)), CASE WHEN 
((_col4 = 'Tuesday')) THEN (_col1) ELSE (null) END (type: decimal(7,2)), CASE 
WHEN ((_col4 = 'Wednesday')) THEN (_col1) ELSE (null) END (type: decimal(7,2)), 
CASE WHEN ((_col4 = 'Thursday')) THEN (_col1) ELSE (null) END (type: 
decimal(7,2)), CASE WHEN ((_col4 = 'Friday')) THEN (_col1) ELSE (null) END 
(type: decimal(7,2)), CASE WHEN ((_col4 = 'Saturday')) THEN (_col1) ELSE (null) 
END (type: decimal(7,2))
+                  expressions: _col3 (type: int), CASE WHEN (_col4) THEN 
(_col1) ELSE (null) END (type: decimal(7,2)), CASE WHEN (_col5) THEN (_col1) 
ELSE (null) END (type: decimal(7,2)), CASE WHEN (_col6) THEN (_col1) ELSE 
(null) END (type: decimal(7,2)), CASE WHEN (_col7) THEN (_col1) ELSE (null) END 
(type: decimal(7,2)), CASE WHEN (_col8) THEN (_col1) ELSE (null) END (type: 
decimal(7,2)), CASE WHEN (_col9) THEN (_col1) ELSE (null) END (type: 
decimal(7,2)), CASE WHEN (_col10) THEN (_col1) ELSE (null) END (type: 
decimal(7,2))
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7
                   Statistics: Num rows: 475191764 Data size: 64437789277 Basic 
stats: COMPLETE Column stats: NONE
                   Group By Operator
@@ -407,10 +407,10 @@ STAGE PLANS:
                   0 _col0 (type: int)
                   1 _col0 (type: int)
                   2 (_col0 - 53) (type: int)
-                outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7, _col11, _col12, _col13, _col14, _col15, _col16, _col17
+                outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7, _col10, _col11, _col12, _col13, _col14, _col15, _col16
                 Statistics: Num rows: 574982057 Data size: 77969728401 Basic 
stats: COMPLETE Column stats: NONE
                 Select Operator
-                  expressions: _col0 (type: int), round((_col1 / _col11), 2) 
(type: decimal(20,2)), round((_col2 / _col12), 2) (type: decimal(20,2)), 
round((_col3 / _col13), 2) (type: decimal(20,2)), round((_col4 / _col14), 2) 
(type: decimal(20,2)), round((_col5 / _col15), 2) (type: decimal(20,2)), 
round((_col6 / _col16), 2) (type: decimal(20,2)), round((_col7 / _col17), 2) 
(type: decimal(20,2))
+                  expressions: _col0 (type: int), round((_col1 / _col10), 2) 
(type: decimal(20,2)), round((_col2 / _col11), 2) (type: decimal(20,2)), 
round((_col3 / _col12), 2) (type: decimal(20,2)), round((_col4 / _col13), 2) 
(type: decimal(20,2)), round((_col5 / _col14), 2) (type: decimal(20,2)), 
round((_col6 / _col15), 2) (type: decimal(20,2)), round((_col7 / _col16), 2) 
(type: decimal(20,2))
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7
                   Statistics: Num rows: 574982057 Data size: 77969728401 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/query20.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query20.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query20.q.out
index f9c3ba5..953986d 100644
--- a/ql/src/test/results/clientpositive/perf/spark/query20.q.out
+++ b/ql/src/test/results/clientpositive/perf/spark/query20.q.out
@@ -162,11 +162,11 @@ STAGE PLANS:
                 keys:
                   0 _col1 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col2, _col6, _col7, _col8, _col9, _col10
+                outputColumnNames: _col2, _col5, _col6, _col7, _col8, _col9
                 Statistics: Num rows: 348467716 Data size: 47189528877 Basic 
stats: COMPLETE Column stats: NONE
                 Group By Operator
                   aggregations: sum(_col2)
-                  keys: _col10 (type: string), _col9 (type: string), _col6 
(type: string), _col7 (type: string), _col8 (type: decimal(7,2))
+                  keys: _col9 (type: string), _col8 (type: string), _col5 
(type: string), _col6 (type: string), _col7 (type: decimal(7,2))
                   mode: hash
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
                   Statistics: Num rows: 348467716 Data size: 47189528877 Basic 
stats: COMPLETE Column stats: NONE

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/spark/query21.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query21.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query21.q.out
index 77fde06..6c2efe7 100644
--- a/ql/src/test/results/clientpositive/perf/spark/query21.q.out
+++ b/ql/src/test/results/clientpositive/perf/spark/query21.q.out
@@ -112,8 +112,8 @@ STAGE PLANS:
                     predicate: (CAST( d_date AS TIMESTAMP) BETWEEN 
TIMESTAMP'1998-03-09 00:00:00' AND TIMESTAMP'1998-05-08 00:00:00' and d_date_sk 
is not null) (type: boolean)
                     Statistics: Num rows: 8116 Data size: 9081804 Basic stats: 
COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: d_date_sk (type: int), d_date (type: string)
-                      outputColumnNames: _col0, _col1
+                      expressions: d_date_sk (type: int), (CAST( d_date AS 
DATE) < DATE'1998-04-08') (type: boolean), (CAST( d_date AS DATE) >= 
DATE'1998-04-08') (type: boolean)
+                      outputColumnNames: _col0, _col1, _col2
                       Statistics: Num rows: 8116 Data size: 9081804 Basic 
stats: COMPLETE Column stats: NONE
                       Spark HashTable Sink Operator
                         keys:
@@ -150,7 +150,7 @@ STAGE PLANS:
                         keys:
                           0 _col0 (type: int)
                           1 _col0 (type: int)
-                        outputColumnNames: _col1, _col2, _col3, _col5
+                        outputColumnNames: _col1, _col2, _col3, _col5, _col6
                         input vertices:
                           1 Map 5
                         Statistics: Num rows: 41342400 Data size: 653203228 
Basic stats: COMPLETE Column stats: NONE
@@ -159,7 +159,7 @@ STAGE PLANS:
                           sort order: +
                           Map-reduce partition columns: _col1 (type: int)
                           Statistics: Num rows: 41342400 Data size: 653203228 
Basic stats: COMPLETE Column stats: NONE
-                          value expressions: _col2 (type: int), _col3 (type: 
int), _col5 (type: string)
+                          value expressions: _col2 (type: int), _col3 (type: 
int), _col5 (type: boolean), _col6 (type: boolean)
             Execution mode: vectorized
             Local Work:
               Map Reduce Local Work
@@ -193,7 +193,7 @@ STAGE PLANS:
                 keys:
                   0 _col1 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col2, _col3, _col5, _col7
+                outputColumnNames: _col2, _col3, _col5, _col6, _col8
                 Statistics: Num rows: 45476640 Data size: 718523566 Basic 
stats: COMPLETE Column stats: NONE
                 Map Join Operator
                   condition map:
@@ -201,12 +201,12 @@ STAGE PLANS:
                   keys:
                     0 _col2 (type: int)
                     1 _col0 (type: int)
-                  outputColumnNames: _col3, _col5, _col7, _col10
+                  outputColumnNames: _col3, _col5, _col6, _col8, _col10
                   input vertices:
                     1 Map 7
                   Statistics: Num rows: 50024305 Data size: 790375939 Basic 
stats: COMPLETE Column stats: NONE
                   Select Operator
-                    expressions: _col10 (type: string), _col7 (type: string), 
CASE WHEN ((CAST( _col5 AS DATE) < DATE'1998-04-08')) THEN (_col3) ELSE (0) END 
(type: int), CASE WHEN ((CAST( _col5 AS DATE) >= DATE'1998-04-08')) THEN 
(_col3) ELSE (0) END (type: int)
+                    expressions: _col10 (type: string), _col8 (type: string), 
CASE WHEN (_col5) THEN (_col3) ELSE (0) END (type: int), CASE WHEN (_col6) THEN 
(_col3) ELSE (0) END (type: int)
                     outputColumnNames: _col0, _col1, _col2, _col3
                     Statistics: Num rows: 50024305 Data size: 790375939 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/query22.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query22.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query22.q.out
index 8c9d8a5..2b5e7d0 100644
--- a/ql/src/test/results/clientpositive/perf/spark/query22.q.out
+++ b/ql/src/test/results/clientpositive/perf/spark/query22.q.out
@@ -185,11 +185,11 @@ STAGE PLANS:
                 keys:
                   0 _col1 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col3, _col8, _col9, _col10, _col11
+                outputColumnNames: _col3, _col7, _col8, _col9, _col10
                 Statistics: Num rows: 50024305 Data size: 790375939 Basic 
stats: COMPLETE Column stats: NONE
                 Group By Operator
                   aggregations: sum(_col3), count(_col3)
-                  keys: _col8 (type: string), _col9 (type: string), _col10 
(type: string), _col11 (type: string), 0L (type: bigint)
+                  keys: _col7 (type: string), _col8 (type: string), _col9 
(type: string), _col10 (type: string), 0L (type: bigint)
                   mode: hash
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6
                   Statistics: Num rows: 250121525 Data size: 3951879695 Basic 
stats: COMPLETE Column stats: NONE

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/spark/query23.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query23.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query23.q.out
index bfda977..e85f710 100644
--- a/ql/src/test/results/clientpositive/perf/spark/query23.q.out
+++ b/ql/src/test/results/clientpositive/perf/spark/query23.q.out
@@ -1,5 +1,5 @@
-Warning: Map Join MAPJOIN[285][bigTable=?] in task 'Stage-1:MAPRED' is a cross 
product
-Warning: Map Join MAPJOIN[286][bigTable=?] in task 'Stage-1:MAPRED' is a cross 
product
+Warning: Map Join MAPJOIN[275][bigTable=?] in task 'Stage-1:MAPRED' is a cross 
product
+Warning: Map Join MAPJOIN[276][bigTable=?] in task 'Stage-1:MAPRED' is a cross 
product
 PREHOOK: query: explain
 with frequent_ss_items as 
  (select substr(i_item_desc,1,30) itemdesc,i_item_sk item_sk,d_date 
solddate,count(*) cnt
@@ -146,15 +146,15 @@ STAGE PLANS:
                     predicate: (ss_customer_sk is not null and ss_sold_date_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_customer_sk 
(type: int), ss_quantity (type: int), ss_sales_price (type: decimal(7,2))
-                      outputColumnNames: _col0, _col1, _col2, _col3
+                      expressions: ss_sold_date_sk (type: int), ss_customer_sk 
(type: int), (CAST( ss_quantity AS decimal(10,0)) * ss_sales_price) (type: 
decimal(18,2))
+                      outputColumnNames: _col0, _col1, _col2
                       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: decimal(7,2))
+                        value expressions: _col1 (type: int), _col2 (type: 
decimal(18,2))
             Execution mode: vectorized
         Map 18 
             Map Operator Tree:
@@ -204,15 +204,15 @@ STAGE PLANS:
                     predicate: (ss_customer_sk is not null and ss_sold_date_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_customer_sk 
(type: int), ss_quantity (type: int), ss_sales_price (type: decimal(7,2))
-                      outputColumnNames: _col0, _col1, _col2, _col3
+                      expressions: ss_sold_date_sk (type: int), ss_customer_sk 
(type: int), (CAST( ss_quantity AS decimal(10,0)) * ss_sales_price) (type: 
decimal(18,2))
+                      outputColumnNames: _col0, _col1, _col2
                       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: decimal(7,2))
+                        value expressions: _col1 (type: int), _col2 (type: 
decimal(18,2))
             Execution mode: vectorized
         Map 25 
             Map Operator Tree:
@@ -260,14 +260,14 @@ STAGE PLANS:
                 keys:
                   0 _col0 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col1, _col2, _col3
+                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: int), _col3 (type: 
decimal(7,2))
+                  value expressions: _col2 (type: decimal(18,2))
         Reducer 15 
             Reduce Operator Tree:
               Join Operator
@@ -276,24 +276,20 @@ STAGE PLANS:
                 keys:
                   0 _col1 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col2, _col3, _col6
+                outputColumnNames: _col2, _col4
                 Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
-                Select Operator
-                  expressions: _col6 (type: int), (CAST( _col2 AS 
decimal(10,0)) * _col3) (type: decimal(18,2))
+                Group By Operator
+                  aggregations: sum(_col2)
+                  keys: _col4 (type: int)
+                  mode: hash
                   outputColumnNames: _col0, _col1
                   Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
-                  Group By Operator
-                    aggregations: sum(_col1)
-                    keys: _col0 (type: int)
-                    mode: hash
-                    outputColumnNames: _col0, _col1
+                  Reduce Output Operator
+                    key expressions: _col0 (type: int)
+                    sort order: +
+                    Map-reduce partition columns: _col0 (type: int)
                     Statistics: Num rows: 696954748 Data size: 61485550191 
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: 696954748 Data size: 61485550191 
Basic stats: COMPLETE Column stats: NONE
-                      value expressions: _col1 (type: decimal(28,2))
+                    value expressions: _col1 (type: decimal(28,2))
         Reducer 16 
             Execution mode: vectorized
             Reduce Operator Tree:
@@ -351,14 +347,14 @@ STAGE PLANS:
                 keys:
                   0 _col0 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col1, _col2, _col3
+                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: int), _col3 (type: 
decimal(7,2))
+                  value expressions: _col2 (type: decimal(18,2))
         Reducer 22 
             Reduce Operator Tree:
               Join Operator
@@ -367,24 +363,20 @@ STAGE PLANS:
                 keys:
                   0 _col1 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col2, _col3, _col6
+                outputColumnNames: _col2, _col4
                 Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
-                Select Operator
-                  expressions: _col6 (type: int), (CAST( _col2 AS 
decimal(10,0)) * _col3) (type: decimal(18,2))
+                Group By Operator
+                  aggregations: sum(_col2)
+                  keys: _col4 (type: int)
+                  mode: hash
                   outputColumnNames: _col0, _col1
                   Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
-                  Group By Operator
-                    aggregations: sum(_col1)
-                    keys: _col0 (type: int)
-                    mode: hash
-                    outputColumnNames: _col0, _col1
+                  Reduce Output Operator
+                    key expressions: _col0 (type: int)
+                    sort order: +
+                    Map-reduce partition columns: _col0 (type: int)
                     Statistics: Num rows: 696954748 Data size: 61485550191 
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: 696954748 Data size: 61485550191 
Basic stats: COMPLETE Column stats: NONE
-                      value expressions: _col1 (type: decimal(28,2))
+                    value expressions: _col1 (type: decimal(28,2))
         Reducer 23 
             Execution mode: vectorized
             Reduce Operator Tree:
@@ -446,15 +438,15 @@ STAGE PLANS:
                     predicate: (ss_customer_sk is not null and ss_sold_date_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_customer_sk 
(type: int), ss_quantity (type: int), ss_sales_price (type: decimal(7,2))
-                      outputColumnNames: _col0, _col1, _col2, _col3
+                      expressions: ss_sold_date_sk (type: int), ss_customer_sk 
(type: int), (CAST( ss_quantity AS decimal(10,0)) * ss_sales_price) (type: 
decimal(18,2))
+                      outputColumnNames: _col0, _col1, _col2
                       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: decimal(7,2))
+                        value expressions: _col1 (type: int), _col2 (type: 
decimal(18,2))
             Execution mode: vectorized
         Map 47 
             Map Operator Tree:
@@ -504,15 +496,15 @@ STAGE PLANS:
                     predicate: (ss_customer_sk is not null and ss_sold_date_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_customer_sk 
(type: int), ss_quantity (type: int), ss_sales_price (type: decimal(7,2))
-                      outputColumnNames: _col0, _col1, _col2, _col3
+                      expressions: ss_sold_date_sk (type: int), ss_customer_sk 
(type: int), (CAST( ss_quantity AS decimal(10,0)) * ss_sales_price) (type: 
decimal(18,2))
+                      outputColumnNames: _col0, _col1, _col2
                       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: decimal(7,2))
+                        value expressions: _col1 (type: int), _col2 (type: 
decimal(18,2))
             Execution mode: vectorized
         Map 54 
             Map Operator Tree:
@@ -560,14 +552,14 @@ STAGE PLANS:
                 keys:
                   0 _col0 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col1, _col2, _col3
+                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: int), _col3 (type: 
decimal(7,2))
+                  value expressions: _col2 (type: decimal(18,2))
         Reducer 44 
             Reduce Operator Tree:
               Join Operator
@@ -576,24 +568,20 @@ STAGE PLANS:
                 keys:
                   0 _col1 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col2, _col3, _col6
+                outputColumnNames: _col2, _col4
                 Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
-                Select Operator
-                  expressions: _col6 (type: int), (CAST( _col2 AS 
decimal(10,0)) * _col3) (type: decimal(18,2))
+                Group By Operator
+                  aggregations: sum(_col2)
+                  keys: _col4 (type: int)
+                  mode: hash
                   outputColumnNames: _col0, _col1
                   Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
-                  Group By Operator
-                    aggregations: sum(_col1)
-                    keys: _col0 (type: int)
-                    mode: hash
-                    outputColumnNames: _col0, _col1
+                  Reduce Output Operator
+                    key expressions: _col0 (type: int)
+                    sort order: +
+                    Map-reduce partition columns: _col0 (type: int)
                     Statistics: Num rows: 696954748 Data size: 61485550191 
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: 696954748 Data size: 61485550191 
Basic stats: COMPLETE Column stats: NONE
-                      value expressions: _col1 (type: decimal(28,2))
+                    value expressions: _col1 (type: decimal(28,2))
         Reducer 45 
             Execution mode: vectorized
             Reduce Operator Tree:
@@ -651,14 +639,14 @@ STAGE PLANS:
                 keys:
                   0 _col0 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col1, _col2, _col3
+                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: int), _col3 (type: 
decimal(7,2))
+                  value expressions: _col2 (type: decimal(18,2))
         Reducer 51 
             Reduce Operator Tree:
               Join Operator
@@ -667,24 +655,20 @@ STAGE PLANS:
                 keys:
                   0 _col1 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col2, _col3, _col6
+                outputColumnNames: _col2, _col4
                 Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
-                Select Operator
-                  expressions: _col6 (type: int), (CAST( _col2 AS 
decimal(10,0)) * _col3) (type: decimal(18,2))
+                Group By Operator
+                  aggregations: sum(_col2)
+                  keys: _col4 (type: int)
+                  mode: hash
                   outputColumnNames: _col0, _col1
                   Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
-                  Group By Operator
-                    aggregations: sum(_col1)
-                    keys: _col0 (type: int)
-                    mode: hash
-                    outputColumnNames: _col0, _col1
+                  Reduce Output Operator
+                    key expressions: _col0 (type: int)
+                    sort order: +
+                    Map-reduce partition columns: _col0 (type: int)
                     Statistics: Num rows: 696954748 Data size: 61485550191 
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: 696954748 Data size: 61485550191 
Basic stats: COMPLETE Column stats: NONE
-                      value expressions: _col1 (type: decimal(28,2))
+                    value expressions: _col1 (type: decimal(28,2))
         Reducer 52 
             Execution mode: vectorized
             Reduce Operator Tree:
@@ -791,7 +775,7 @@ STAGE PLANS:
                     predicate: i_item_sk is not null (type: boolean)
                     Statistics: Num rows: 462000 Data size: 663560457 Basic 
stats: COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: i_item_sk (type: int), i_item_desc (type: 
string)
+                      expressions: i_item_sk (type: int), substr(i_item_desc, 
1, 30) (type: string)
                       outputColumnNames: _col0, _col1
                       Statistics: Num rows: 462000 Data size: 663560457 Basic 
stats: COMPLETE Column stats: NONE
                       Reduce Output Operator
@@ -811,15 +795,15 @@ STAGE PLANS:
                     predicate: ss_customer_sk is not null (type: boolean)
                     Statistics: Num rows: 575995635 Data size: 50814502088 
Basic stats: COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: ss_customer_sk (type: int), ss_quantity 
(type: int), ss_sales_price (type: decimal(7,2))
-                      outputColumnNames: _col0, _col1, _col2
+                      expressions: ss_customer_sk (type: int), (CAST( 
ss_quantity AS decimal(10,0)) * ss_sales_price) (type: decimal(18,2))
+                      outputColumnNames: _col0, _col1
                       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: 
decimal(7,2))
+                        value expressions: _col1 (type: decimal(18,2))
             Execution mode: vectorized
         Map 30 
             Map Operator Tree:
@@ -910,13 +894,13 @@ STAGE PLANS:
                 Statistics: Num rows: 348477374 Data size: 30742775095 Basic 
stats: COMPLETE Column stats: NONE
                 Select Operator
                   expressions: _col0 (type: int), _col3 (type: bigint)
-                  outputColumnNames: _col0, _col3
+                  outputColumnNames: _col1, _col3
                   Statistics: Num rows: 348477374 Data size: 30742775095 Basic 
stats: COMPLETE Column stats: NONE
                   Filter Operator
                     predicate: (_col3 > 4L) (type: boolean)
                     Statistics: Num rows: 116159124 Data size: 10247591639 
Basic stats: COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: _col0 (type: int)
+                      expressions: _col1 (type: int)
                       outputColumnNames: _col1
                       Statistics: Num rows: 116159124 Data size: 10247591639 
Basic stats: COMPLETE Column stats: NONE
                       Group By Operator
@@ -953,24 +937,20 @@ STAGE PLANS:
                 keys:
                   0 _col0 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col1, _col2, _col3
+                outputColumnNames: _col1, _col2
                 Statistics: Num rows: 633595212 Data size: 55895953508 Basic 
stats: COMPLETE Column stats: NONE
-                Select Operator
-                  expressions: _col3 (type: int), (CAST( _col1 AS 
decimal(10,0)) * _col2) (type: decimal(18,2))
+                Group By Operator
+                  aggregations: sum(_col1)
+                  keys: _col2 (type: int)
+                  mode: hash
                   outputColumnNames: _col0, _col1
                   Statistics: Num rows: 633595212 Data size: 55895953508 Basic 
stats: COMPLETE Column stats: NONE
-                  Group By Operator
-                    aggregations: sum(_col1)
-                    keys: _col0 (type: int)
-                    mode: hash
-                    outputColumnNames: _col0, _col1
+                  Reduce Output Operator
+                    key expressions: _col0 (type: int)
+                    sort order: +
+                    Map-reduce partition columns: _col0 (type: int)
                     Statistics: Num rows: 633595212 Data size: 55895953508 
Basic stats: COMPLETE Column stats: NONE
-                    Reduce Output Operator
-                      key expressions: _col0 (type: int)
-                      sort order: +
-                      Map-reduce partition columns: _col0 (type: int)
-                      Statistics: Num rows: 633595212 Data size: 55895953508 
Basic stats: COMPLETE Column stats: NONE
-                      value expressions: _col1 (type: decimal(28,2))
+                    value expressions: _col1 (type: decimal(28,2))
         Reducer 29 
             Execution mode: vectorized
             Local Work:
@@ -1100,24 +1080,20 @@ STAGE PLANS:
                 keys:
                   0 _col1 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col3, _col5, _col6
+                outputColumnNames: _col3, _col4, _col5
                 Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
-                Select Operator
-                  expressions: substr(_col6, 1, 30) (type: string), _col5 
(type: int), _col3 (type: string)
-                  outputColumnNames: _col0, _col1, _col2
+                Group By Operator
+                  aggregations: count()
+                  keys: _col4 (type: int), _col3 (type: string), _col5 (type: 
string)
+                  mode: hash
+                  outputColumnNames: _col0, _col1, _col2, _col3
                   Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
-                  Group By Operator
-                    aggregations: count()
-                    keys: _col1 (type: int), _col0 (type: string), _col2 
(type: string)
-                    mode: hash
-                    outputColumnNames: _col0, _col1, _col2, _col3
+                  Reduce Output Operator
+                    key expressions: _col0 (type: int), _col1 (type: string), 
_col2 (type: string)
+                    sort order: +++
+                    Map-reduce partition columns: _col0 (type: int)
                     Statistics: Num rows: 696954748 Data size: 61485550191 
Basic stats: COMPLETE Column stats: NONE
-                    Reduce Output Operator
-                      key expressions: _col0 (type: int), _col1 (type: 
string), _col2 (type: string)
-                      sort order: +++
-                      Map-reduce partition columns: _col0 (type: int)
-                      Statistics: Num rows: 696954748 Data size: 61485550191 
Basic stats: COMPLETE Column stats: NONE
-                      value expressions: _col3 (type: bigint)
+                    value expressions: _col3 (type: bigint)
         Reducer 4 
             Reduce Operator Tree:
               Join Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/spark/query24.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query24.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query24.q.out
index 91fe702..2d57eca 100644
--- a/ql/src/test/results/clientpositive/perf/spark/query24.q.out
+++ b/ql/src/test/results/clientpositive/perf/spark/query24.q.out
@@ -136,12 +136,12 @@ STAGE PLANS:
                     Statistics: Num rows: 852 Data size: 1628138 Basic stats: 
COMPLETE Column stats: NONE
                     Select Operator
                       expressions: s_store_sk (type: int), s_store_name (type: 
string), s_state (type: string), s_zip (type: string)
-                      outputColumnNames: _col0, _col1, _col3, _col4
+                      outputColumnNames: _col0, _col1, _col2, _col3
                       Statistics: Num rows: 852 Data size: 1628138 Basic 
stats: COMPLETE Column stats: NONE
                       Spark HashTable Sink Operator
                         keys:
                           0 _col2 (type: string)
-                          1 _col4 (type: string)
+                          1 _col3 (type: string)
             Execution mode: vectorized
             Local Work:
               Map Reduce Local Work
@@ -167,7 +167,7 @@ STAGE PLANS:
                     predicate: (ca_address_sk is not null and ca_zip is not 
null) (type: boolean)
                     Statistics: Num rows: 40000000 Data size: 40595195284 
Basic stats: COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: ca_address_sk (type: int), ca_state (type: 
string), ca_zip (type: string), ca_country (type: string)
+                      expressions: ca_address_sk (type: int), ca_state (type: 
string), ca_zip (type: string), upper(ca_country) (type: string)
                       outputColumnNames: _col0, _col1, _col2, _col3
                       Statistics: Num rows: 40000000 Data size: 40595195284 
Basic stats: COMPLETE Column stats: NONE
                       Map Join Operator
@@ -175,8 +175,8 @@ STAGE PLANS:
                              Inner Join 0 to 1
                         keys:
                           0 _col2 (type: string)
-                          1 _col4 (type: string)
-                        outputColumnNames: _col0, _col1, _col3, _col4, _col5, 
_col7
+                          1 _col3 (type: string)
+                        outputColumnNames: _col0, _col1, _col3, _col4, _col5, 
_col6
                         input vertices:
                           1 Map 19
                         Statistics: Num rows: 44000000 Data size: 44654715780 
Basic stats: COMPLETE Column stats: NONE
@@ -185,7 +185,7 @@ STAGE PLANS:
                           sort order: +
                           Map-reduce partition columns: _col0 (type: int)
                           Statistics: Num rows: 44000000 Data size: 
44654715780 Basic stats: COMPLETE Column stats: NONE
-                          value expressions: _col1 (type: string), _col3 
(type: string), _col4 (type: int), _col5 (type: string), _col7 (type: string)
+                          value expressions: _col1 (type: string), _col3 
(type: string), _col4 (type: int), _col5 (type: string), _col6 (type: string)
             Execution mode: vectorized
             Local Work:
               Map Reduce Local Work
@@ -276,62 +276,62 @@ STAGE PLANS:
                 keys:
                   0 _col0 (type: int)
                   1 _col1 (type: int)
-                outputColumnNames: _col1, _col3, _col4, _col5, _col7, _col9, 
_col11, _col12, _col13
+                outputColumnNames: _col1, _col3, _col4, _col5, _col6, _col8, 
_col10, _col11, _col12
                 Statistics: Num rows: 88000001 Data size: 75681779077 Basic 
stats: COMPLETE Column stats: NONE
                 Filter Operator
-                  predicate: (_col13 <> upper(_col3)) (type: boolean)
+                  predicate: (_col12 <> _col3) (type: boolean)
                   Statistics: Num rows: 88000001 Data size: 75681779077 Basic 
stats: COMPLETE Column stats: NONE
                   Reduce Output Operator
-                    key expressions: _col9 (type: int), _col4 (type: int)
+                    key expressions: _col8 (type: int), _col4 (type: int)
                     sort order: ++
-                    Map-reduce partition columns: _col9 (type: int), _col4 
(type: int)
+                    Map-reduce partition columns: _col8 (type: int), _col4 
(type: int)
                     Statistics: Num rows: 88000001 Data size: 75681779077 
Basic stats: COMPLETE Column stats: NONE
-                    value expressions: _col1 (type: string), _col5 (type: 
string), _col7 (type: string), _col11 (type: string), _col12 (type: string)
+                    value expressions: _col1 (type: string), _col5 (type: 
string), _col6 (type: string), _col10 (type: string), _col11 (type: string)
         Reducer 14 
             Reduce Operator Tree:
               Join Operator
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 _col9 (type: int), _col4 (type: int)
+                  0 _col8 (type: int), _col4 (type: int)
                   1 _col1 (type: int), _col2 (type: int)
-                outputColumnNames: _col1, _col5, _col7, _col11, _col12, 
_col14, _col17, _col18
+                outputColumnNames: _col1, _col5, _col6, _col10, _col11, 
_col13, _col16, _col17
                 Statistics: Num rows: 633595212 Data size: 55895953508 Basic 
stats: COMPLETE Column stats: NONE
                 Reduce Output Operator
-                  key expressions: _col14 (type: int)
+                  key expressions: _col13 (type: int)
                   sort order: +
-                  Map-reduce partition columns: _col14 (type: int)
+                  Map-reduce partition columns: _col13 (type: int)
                   Statistics: Num rows: 633595212 Data size: 55895953508 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col1 (type: string), _col5 (type: 
string), _col7 (type: string), _col11 (type: string), _col12 (type: string), 
_col17 (type: int), _col18 (type: decimal(7,2))
+                  value expressions: _col1 (type: string), _col5 (type: 
string), _col6 (type: string), _col10 (type: string), _col11 (type: string), 
_col16 (type: int), _col17 (type: decimal(7,2))
         Reducer 15 
             Reduce Operator Tree:
               Join Operator
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 _col14 (type: int)
+                  0 _col13 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col1, _col5, _col7, _col11, _col12, 
_col14, _col17, _col18, _col20, _col21, _col22, _col23, _col24
+                outputColumnNames: _col1, _col5, _col6, _col10, _col11, 
_col13, _col16, _col17, _col19, _col20, _col21, _col22, _col23
                 Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
                 Reduce Output Operator
-                  key expressions: _col14 (type: int), _col17 (type: int)
+                  key expressions: _col13 (type: int), _col16 (type: int)
                   sort order: ++
-                  Map-reduce partition columns: _col14 (type: int), _col17 
(type: int)
+                  Map-reduce partition columns: _col13 (type: int), _col16 
(type: int)
                   Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col1 (type: string), _col5 (type: 
string), _col7 (type: string), _col11 (type: string), _col12 (type: string), 
_col18 (type: decimal(7,2)), _col20 (type: decimal(7,2)), _col21 (type: 
string), _col22 (type: string), _col23 (type: string), _col24 (type: int)
+                  value expressions: _col1 (type: string), _col5 (type: 
string), _col6 (type: string), _col10 (type: string), _col11 (type: string), 
_col17 (type: decimal(7,2)), _col19 (type: decimal(7,2)), _col20 (type: 
string), _col21 (type: string), _col22 (type: string), _col23 (type: int)
         Reducer 16 
             Reduce Operator Tree:
               Join Operator
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 _col14 (type: int), _col17 (type: int)
+                  0 _col13 (type: int), _col16 (type: int)
                   1 _col0 (type: int), _col1 (type: int)
-                outputColumnNames: _col1, _col5, _col7, _col11, _col12, 
_col18, _col20, _col21, _col22, _col23, _col24
+                outputColumnNames: _col1, _col5, _col6, _col10, _col11, 
_col17, _col19, _col20, _col21, _col22, _col23
                 Statistics: Num rows: 766650239 Data size: 67634106676 Basic 
stats: COMPLETE Column stats: NONE
                 Group By Operator
-                  aggregations: sum(_col18)
-                  keys: _col11 (type: string), _col12 (type: string), _col1 
(type: string), _col5 (type: string), _col7 (type: string), _col20 (type: 
decimal(7,2)), _col21 (type: string), _col22 (type: string), _col23 (type: 
string), _col24 (type: int)
+                  aggregations: sum(_col17)
+                  keys: _col10 (type: string), _col11 (type: string), _col1 
(type: string), _col5 (type: string), _col6 (type: string), _col19 (type: 
decimal(7,2)), _col20 (type: string), _col21 (type: string), _col22 (type: 
string), _col23 (type: int)
                   mode: hash
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7, _col8, _col9, _col10
                   Statistics: Num rows: 766650239 Data size: 67634106676 Basic 
stats: COMPLETE Column stats: NONE
@@ -397,12 +397,12 @@ STAGE PLANS:
                     Statistics: Num rows: 852 Data size: 1628138 Basic stats: 
COMPLETE Column stats: NONE
                     Select Operator
                       expressions: s_store_sk (type: int), s_store_name (type: 
string), s_state (type: string), s_zip (type: string)
-                      outputColumnNames: _col0, _col1, _col3, _col4
+                      outputColumnNames: _col0, _col1, _col2, _col3
                       Statistics: Num rows: 852 Data size: 1628138 Basic 
stats: COMPLETE Column stats: NONE
                       Spark HashTable Sink Operator
                         keys:
                           0 _col2 (type: string)
-                          1 _col4 (type: string)
+                          1 _col3 (type: string)
             Execution mode: vectorized
             Local Work:
               Map Reduce Local Work
@@ -487,14 +487,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_current_price 
(type: decimal(7,2)), i_size (type: string), i_units (type: string), 
i_manager_id (type: int)
-                      outputColumnNames: _col0, _col1, _col2, _col4, _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: decimal(7,2)), _col2 
(type: string), _col4 (type: string), _col5 (type: int)
+                        value expressions: _col1 (type: decimal(7,2)), _col2 
(type: string), _col3 (type: string), _col4 (type: int)
             Execution mode: vectorized
         Map 7 
             Map Operator Tree:
@@ -506,7 +506,7 @@ STAGE PLANS:
                     predicate: (ca_address_sk is not null and ca_zip is not 
null) (type: boolean)
                     Statistics: Num rows: 40000000 Data size: 40595195284 
Basic stats: COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: ca_address_sk (type: int), ca_state (type: 
string), ca_zip (type: string), ca_country (type: string)
+                      expressions: ca_address_sk (type: int), ca_state (type: 
string), ca_zip (type: string), upper(ca_country) (type: string)
                       outputColumnNames: _col0, _col1, _col2, _col3
                       Statistics: Num rows: 40000000 Data size: 40595195284 
Basic stats: COMPLETE Column stats: NONE
                       Map Join Operator
@@ -514,8 +514,8 @@ STAGE PLANS:
                              Inner Join 0 to 1
                         keys:
                           0 _col2 (type: string)
-                          1 _col4 (type: string)
-                        outputColumnNames: _col0, _col1, _col3, _col4, _col5, 
_col7
+                          1 _col3 (type: string)
+                        outputColumnNames: _col0, _col1, _col3, _col4, _col5, 
_col6
                         input vertices:
                           1 Map 9
                         Statistics: Num rows: 44000000 Data size: 44654715780 
Basic stats: COMPLETE Column stats: NONE
@@ -524,7 +524,7 @@ STAGE PLANS:
                           sort order: +
                           Map-reduce partition columns: _col0 (type: int)
                           Statistics: Num rows: 44000000 Data size: 
44654715780 Basic stats: COMPLETE Column stats: NONE
-                          value expressions: _col1 (type: string), _col3 
(type: string), _col4 (type: int), _col5 (type: string), _col7 (type: string)
+                          value expressions: _col1 (type: string), _col3 
(type: string), _col4 (type: int), _col5 (type: string), _col6 (type: string)
             Execution mode: vectorized
             Local Work:
               Map Reduce Local Work
@@ -536,14 +536,14 @@ STAGE PLANS:
                 keys:
                   0 _col0 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col6, 
_col7, _col9, _col10
+                outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col6, 
_col7, _col8, _col9
                 Statistics: Num rows: 633595212 Data size: 55895953508 Basic 
stats: COMPLETE Column stats: NONE
                 Reduce Output Operator
                   key expressions: _col1 (type: int), _col2 (type: int)
                   sort order: ++
                   Map-reduce partition columns: _col1 (type: int), _col2 
(type: int)
                   Statistics: Num rows: 633595212 Data size: 55895953508 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col0 (type: int), _col3 (type: int), 
_col4 (type: decimal(7,2)), _col6 (type: decimal(7,2)), _col7 (type: string), 
_col9 (type: string), _col10 (type: int)
+                  value expressions: _col0 (type: int), _col3 (type: int), 
_col4 (type: decimal(7,2)), _col6 (type: decimal(7,2)), _col7 (type: string), 
_col8 (type: string), _col9 (type: int)
         Reducer 3 
             Reduce Operator Tree:
               Join Operator
@@ -552,14 +552,14 @@ STAGE PLANS:
                 keys:
                   0 _col1 (type: int), _col2 (type: int)
                   1 _col0 (type: int), _col9 (type: int)
-                outputColumnNames: _col0, _col3, _col4, _col6, _col7, _col9, 
_col10, _col13, _col14, _col17, _col21, _col23
+                outputColumnNames: _col0, _col3, _col4, _col6, _col7, _col8, 
_col9, _col12, _col13, _col16, _col20, _col21
                 Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
                 Reduce Output Operator
                   key expressions: _col0 (type: int), _col3 (type: int)
                   sort order: ++
                   Map-reduce partition columns: _col0 (type: int), _col3 
(type: int)
                   Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col4 (type: decimal(7,2)), _col6 (type: 
decimal(7,2)), _col7 (type: string), _col9 (type: string), _col10 (type: int), 
_col13 (type: string), _col14 (type: string), _col17 (type: string), _col21 
(type: string), _col23 (type: string)
+                  value expressions: _col4 (type: decimal(7,2)), _col6 (type: 
decimal(7,2)), _col7 (type: string), _col8 (type: string), _col9 (type: int), 
_col12 (type: string), _col13 (type: string), _col16 (type: string), _col20 
(type: string), _col21 (type: string)
         Reducer 4 
             Reduce Operator Tree:
               Join Operator
@@ -568,11 +568,11 @@ STAGE PLANS:
                 keys:
                   0 _col0 (type: int), _col3 (type: int)
                   1 _col0 (type: int), _col1 (type: int)
-                outputColumnNames: _col4, _col6, _col7, _col9, _col10, _col13, 
_col14, _col17, _col21, _col23
+                outputColumnNames: _col4, _col6, _col7, _col8, _col9, _col12, 
_col13, _col16, _col20, _col21
                 Statistics: Num rows: 766650239 Data size: 67634106676 Basic 
stats: COMPLETE Column stats: NONE
                 Group By Operator
                   aggregations: sum(_col4)
-                  keys: _col13 (type: string), _col14 (type: string), _col21 
(type: string), _col6 (type: decimal(7,2)), _col7 (type: string), _col9 (type: 
string), _col10 (type: int), _col17 (type: string), _col23 (type: string)
+                  keys: _col12 (type: string), _col13 (type: string), _col20 
(type: string), _col6 (type: decimal(7,2)), _col7 (type: string), _col8 (type: 
string), _col9 (type: int), _col16 (type: string), _col21 (type: string)
                   mode: hash
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7, _col8, _col9
                   Statistics: Num rows: 766650239 Data size: 67634106676 Basic 
stats: COMPLETE Column stats: NONE
@@ -639,21 +639,21 @@ STAGE PLANS:
                 keys:
                   0 _col0 (type: int)
                   1 _col1 (type: int)
-                outputColumnNames: _col1, _col3, _col4, _col5, _col7, _col9, 
_col11, _col12, _col13
+                outputColumnNames: _col1, _col3, _col4, _col5, _col6, _col8, 
_col10, _col11, _col12
                 Statistics: Num rows: 88000001 Data size: 75681779077 Basic 
stats: COMPLETE Column stats: NONE
                 Filter Operator
-                  predicate: (_col13 <> upper(_col3)) (type: boolean)
+                  predicate: (_col12 <> _col3) (type: boolean)
                   Statistics: Num rows: 88000001 Data size: 75681779077 Basic 
stats: COMPLETE Column stats: NONE
                   Select Operator
-                    expressions: _col9 (type: int), _col11 (type: string), 
_col12 (type: string), _col1 (type: string), _col4 (type: int), _col5 (type: 
string), _col7 (type: string)
-                    outputColumnNames: _col0, _col2, _col3, _col6, _col9, 
_col10, _col12
+                    expressions: _col8 (type: int), _col10 (type: string), 
_col11 (type: string), _col1 (type: string), _col4 (type: int), _col5 (type: 
string), _col6 (type: string)
+                    outputColumnNames: _col0, _col2, _col3, _col6, _col9, 
_col10, _col11
                     Statistics: Num rows: 88000001 Data size: 75681779077 
Basic stats: COMPLETE Column stats: NONE
                     Reduce Output Operator
                       key expressions: _col0 (type: int), _col9 (type: int)
                       sort order: ++
                       Map-reduce partition columns: _col0 (type: int), _col9 
(type: int)
                       Statistics: Num rows: 88000001 Data size: 75681779077 
Basic stats: COMPLETE Column stats: NONE
-                      value expressions: _col2 (type: string), _col3 (type: 
string), _col6 (type: string), _col10 (type: string), _col12 (type: string)
+                      value expressions: _col2 (type: string), _col3 (type: 
string), _col6 (type: string), _col10 (type: string), _col11 (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/query25.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query25.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query25.q.out
index 5bee2a3..72fe357 100644
--- a/ql/src/test/results/clientpositive/perf/spark/query25.q.out
+++ b/ql/src/test/results/clientpositive/perf/spark/query25.q.out
@@ -295,14 +295,14 @@ STAGE PLANS:
                 keys:
                   0 _col2 (type: int), _col1 (type: int)
                   1 _col1 (type: int), _col2 (type: int)
-                outputColumnNames: _col3, _col8, _col9, _col10, _col11
+                outputColumnNames: _col3, _col6, _col7, _col8, _col9
                 Statistics: Num rows: 348467716 Data size: 47189528877 Basic 
stats: COMPLETE Column stats: NONE
                 Reduce Output Operator
-                  key expressions: _col8 (type: int), _col9 (type: int), 
_col10 (type: int)
+                  key expressions: _col6 (type: int), _col7 (type: int), _col8 
(type: int)
                   sort order: +++
-                  Map-reduce partition columns: _col8 (type: int), _col9 
(type: int), _col10 (type: int)
+                  Map-reduce partition columns: _col6 (type: int), _col7 
(type: int), _col8 (type: int)
                   Statistics: Num rows: 348467716 Data size: 47189528877 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col3 (type: decimal(7,2)), _col11 (type: 
decimal(7,2))
+                  value expressions: _col3 (type: decimal(7,2)), _col9 (type: 
decimal(7,2))
         Reducer 13 
             Reduce Operator Tree:
               Join Operator
@@ -342,15 +342,15 @@ STAGE PLANS:
                      Inner Join 0 to 1
                 keys:
                   0 _col1 (type: int), _col2 (type: int), _col4 (type: int)
-                  1 _col8 (type: int), _col9 (type: int), _col10 (type: int)
-                outputColumnNames: _col1, _col3, _col5, _col12, _col20
+                  1 _col6 (type: int), _col7 (type: int), _col8 (type: int)
+                outputColumnNames: _col1, _col3, _col5, _col10, _col16
                 Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
                 Reduce Output Operator
                   key expressions: _col1 (type: int)
                   sort order: +
                   Map-reduce partition columns: _col1 (type: int)
                   Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col3 (type: int), _col5 (type: 
decimal(7,2)), _col12 (type: decimal(7,2)), _col20 (type: decimal(7,2))
+                  value expressions: _col3 (type: int), _col5 (type: 
decimal(7,2)), _col10 (type: decimal(7,2)), _col16 (type: decimal(7,2))
         Reducer 4 
             Local Work:
               Map Reduce Local Work
@@ -361,7 +361,7 @@ STAGE PLANS:
                 keys:
                   0 _col1 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col3, _col5, _col12, _col20, _col25, _col26
+                outputColumnNames: _col3, _col5, _col10, _col16, _col19, _col20
                 Statistics: Num rows: 766650239 Data size: 67634106676 Basic 
stats: COMPLETE Column stats: NONE
                 Map Join Operator
                   condition map:
@@ -369,13 +369,13 @@ STAGE PLANS:
                   keys:
                     0 _col3 (type: int)
                     1 _col0 (type: int)
-                  outputColumnNames: _col5, _col12, _col20, _col25, _col26, 
_col28, _col29
+                  outputColumnNames: _col5, _col10, _col16, _col19, _col20, 
_col22, _col23
                   input vertices:
                     1 Map 16
                   Statistics: Num rows: 843315281 Data size: 74397518956 Basic 
stats: COMPLETE Column stats: NONE
                   Group By Operator
-                    aggregations: sum(_col5), sum(_col20), sum(_col12)
-                    keys: _col25 (type: string), _col26 (type: string), _col28 
(type: string), _col29 (type: string)
+                    aggregations: sum(_col5), sum(_col16), sum(_col10)
+                    keys: _col19 (type: string), _col20 (type: string), _col22 
(type: string), _col23 (type: string)
                     mode: hash
                     outputColumnNames: _col0, _col1, _col2, _col3, _col4, 
_col5, _col6
                     Statistics: Num rows: 843315281 Data size: 74397518956 
Basic stats: COMPLETE Column stats: NONE

Reply via email to