You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by om...@apache.org on 2015/11/23 18:23:30 UTC

[07/55] [partial] hive git commit: HIVE-12017: Do not disable CBO by default when number of joins in a query is equal or less than 1 (Jesus Camacho Rodriguez, reviewed by Ashutosh Chauhan)

http://git-wip-us.apache.org/repos/asf/hive/blob/855e43df/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_2.q.out b/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_2.q.out
index bcef03c..d8ade07 100644
--- a/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_2.q.out
+++ b/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_2.q.out
@@ -113,10 +113,14 @@ STAGE PLANS:
                   Filter Operator
                     predicate: key is not null (type: boolean)
                     Statistics: Num rows: 5 Data size: 35 Basic stats: COMPLETE Column stats: NONE
-                    Spark HashTable Sink Operator
-                      keys:
-                        0 key (type: int)
-                        1 key (type: int)
+                    Select Operator
+                      expressions: key (type: int), value (type: string)
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 5 Data size: 35 Basic stats: COMPLETE Column stats: NONE
+                      Spark HashTable Sink Operator
+                        keys:
+                          0 _col0 (type: int)
+                          1 _col0 (type: int)
             Local Work:
               Map Reduce Local Work
 
@@ -134,26 +138,30 @@ STAGE PLANS:
                   Filter Operator
                     predicate: key is not null (type: boolean)
                     Statistics: Num rows: 42 Data size: 368 Basic stats: COMPLETE Column stats: NONE
-                    Map Join Operator
-                      condition map:
-                           Inner Join 0 to 1
-                      keys:
-                        0 key (type: int)
-                        1 key (type: int)
-                      outputColumnNames: _col0, _col1, _col7
-                      input vertices:
-                        0 Map 1
-                      Statistics: Num rows: 46 Data size: 404 Basic stats: COMPLETE Column stats: NONE
-                      Select Operator
-                        expressions: _col0 (type: int), concat(_col1, _col7) (type: string)
-                        outputColumnNames: _col0, _col1
+                    Select Operator
+                      expressions: key (type: int), value (type: string)
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 42 Data size: 368 Basic stats: COMPLETE Column stats: NONE
+                      Map Join Operator
+                        condition map:
+                             Inner Join 0 to 1
+                        keys:
+                          0 _col0 (type: int)
+                          1 _col0 (type: int)
+                        outputColumnNames: _col0, _col1, _col4
+                        input vertices:
+                          0 Map 1
                         Statistics: Num rows: 46 Data size: 404 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: int)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: int)
+                        Select Operator
+                          expressions: _col0 (type: int), concat(_col1, _col4) (type: string)
+                          outputColumnNames: _col0, _col1
                           Statistics: Num rows: 46 Data size: 404 Basic stats: COMPLETE Column stats: NONE
-                          value expressions: _col1 (type: string)
+                          Reduce Output Operator
+                            key expressions: _col0 (type: int)
+                            sort order: +
+                            Map-reduce partition columns: _col0 (type: int)
+                            Statistics: Num rows: 46 Data size: 404 Basic stats: COMPLETE Column stats: NONE
+                            value expressions: _col1 (type: string)
             Local Work:
               Map Reduce Local Work
         Reducer 3 
@@ -285,10 +293,14 @@ STAGE PLANS:
                   Filter Operator
                     predicate: key is not null (type: boolean)
                     Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
-                    Spark HashTable Sink Operator
-                      keys:
-                        0 key (type: int)
-                        1 key (type: int)
+                    Select Operator
+                      expressions: key (type: int), value (type: string)
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
+                      Spark HashTable Sink Operator
+                        keys:
+                          0 _col0 (type: int)
+                          1 _col0 (type: int)
             Local Work:
               Map Reduce Local Work
 
@@ -306,26 +318,30 @@ STAGE PLANS:
                   Filter Operator
                     predicate: key is not null (type: boolean)
                     Statistics: Num rows: 42 Data size: 368 Basic stats: COMPLETE Column stats: NONE
-                    Map Join Operator
-                      condition map:
-                           Inner Join 0 to 1
-                      keys:
-                        0 key (type: int)
-                        1 key (type: int)
-                      outputColumnNames: _col0, _col1, _col7
-                      input vertices:
-                        0 Map 1
-                      Statistics: Num rows: 46 Data size: 404 Basic stats: COMPLETE Column stats: NONE
-                      Select Operator
-                        expressions: _col0 (type: int), concat(_col1, _col7) (type: string)
-                        outputColumnNames: _col0, _col1
+                    Select Operator
+                      expressions: key (type: int), value (type: string)
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 42 Data size: 368 Basic stats: COMPLETE Column stats: NONE
+                      Map Join Operator
+                        condition map:
+                             Inner Join 0 to 1
+                        keys:
+                          0 _col0 (type: int)
+                          1 _col0 (type: int)
+                        outputColumnNames: _col0, _col1, _col4
+                        input vertices:
+                          0 Map 1
                         Statistics: Num rows: 46 Data size: 404 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: int)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: int)
+                        Select Operator
+                          expressions: _col0 (type: int), concat(_col1, _col4) (type: string)
+                          outputColumnNames: _col0, _col1
                           Statistics: Num rows: 46 Data size: 404 Basic stats: COMPLETE Column stats: NONE
-                          value expressions: _col1 (type: string)
+                          Reduce Output Operator
+                            key expressions: _col0 (type: int)
+                            sort order: +
+                            Map-reduce partition columns: _col0 (type: int)
+                            Statistics: Num rows: 46 Data size: 404 Basic stats: COMPLETE Column stats: NONE
+                            value expressions: _col1 (type: string)
             Local Work:
               Map Reduce Local Work
         Reducer 3 
@@ -481,10 +497,14 @@ STAGE PLANS:
                   Filter Operator
                     predicate: key is not null (type: boolean)
                     Statistics: Num rows: 5 Data size: 35 Basic stats: COMPLETE Column stats: NONE
-                    Spark HashTable Sink Operator
-                      keys:
-                        0 key (type: int)
-                        1 key (type: int)
+                    Select Operator
+                      expressions: key (type: int), value (type: string)
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 5 Data size: 35 Basic stats: COMPLETE Column stats: NONE
+                      Spark HashTable Sink Operator
+                        keys:
+                          0 _col0 (type: int)
+                          1 _col0 (type: int)
             Local Work:
               Map Reduce Local Work
 
@@ -502,26 +522,30 @@ STAGE PLANS:
                   Filter Operator
                     predicate: key is not null (type: boolean)
                     Statistics: Num rows: 84 Data size: 736 Basic stats: COMPLETE Column stats: NONE
-                    Map Join Operator
-                      condition map:
-                           Inner Join 0 to 1
-                      keys:
-                        0 key (type: int)
-                        1 key (type: int)
-                      outputColumnNames: _col0, _col1, _col7
-                      input vertices:
-                        0 Map 1
-                      Statistics: Num rows: 92 Data size: 809 Basic stats: COMPLETE Column stats: NONE
-                      Select Operator
-                        expressions: _col0 (type: int), concat(_col1, _col7) (type: string)
-                        outputColumnNames: _col0, _col1
+                    Select Operator
+                      expressions: key (type: int), value (type: string)
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 84 Data size: 736 Basic stats: COMPLETE Column stats: NONE
+                      Map Join Operator
+                        condition map:
+                             Inner Join 0 to 1
+                        keys:
+                          0 _col0 (type: int)
+                          1 _col0 (type: int)
+                        outputColumnNames: _col0, _col1, _col4
+                        input vertices:
+                          0 Map 1
                         Statistics: Num rows: 92 Data size: 809 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: int)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: int)
+                        Select Operator
+                          expressions: _col0 (type: int), concat(_col1, _col4) (type: string)
+                          outputColumnNames: _col0, _col1
                           Statistics: Num rows: 92 Data size: 809 Basic stats: COMPLETE Column stats: NONE
-                          value expressions: _col1 (type: string)
+                          Reduce Output Operator
+                            key expressions: _col0 (type: int)
+                            sort order: +
+                            Map-reduce partition columns: _col0 (type: int)
+                            Statistics: Num rows: 92 Data size: 809 Basic stats: COMPLETE Column stats: NONE
+                            value expressions: _col1 (type: string)
             Local Work:
               Map Reduce Local Work
         Reducer 3 

http://git-wip-us.apache.org/repos/asf/hive/blob/855e43df/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_4.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_4.q.out b/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_4.q.out
index f3c8f04..0c8e3bf 100644
--- a/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_4.q.out
+++ b/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_4.q.out
@@ -280,10 +280,14 @@ STAGE PLANS:
                   Filter Operator
                     predicate: key is not null (type: boolean)
                     Statistics: Num rows: 5 Data size: 35 Basic stats: COMPLETE Column stats: NONE
-                    Spark HashTable Sink Operator
-                      keys:
-                        0 key (type: int)
-                        1 key (type: int)
+                    Select Operator
+                      expressions: key (type: int), value (type: string)
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 5 Data size: 35 Basic stats: COMPLETE Column stats: NONE
+                      Spark HashTable Sink Operator
+                        keys:
+                          0 _col0 (type: int)
+                          1 _col0 (type: int)
             Local Work:
               Map Reduce Local Work
 
@@ -301,22 +305,26 @@ STAGE PLANS:
                   Filter Operator
                     predicate: key is not null (type: boolean)
                     Statistics: Num rows: 42 Data size: 368 Basic stats: COMPLETE Column stats: NONE
-                    Map Join Operator
-                      condition map:
-                           Inner Join 0 to 1
-                      keys:
-                        0 key (type: int)
-                        1 key (type: int)
-                      outputColumnNames: _col0, _col1
-                      input vertices:
-                        0 Map 1
-                      Statistics: Num rows: 46 Data size: 404 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: _col1 (type: string)
-                        sort order: +
-                        Map-reduce partition columns: _col1 (type: string)
+                    Select Operator
+                      expressions: key (type: int)
+                      outputColumnNames: _col0
+                      Statistics: Num rows: 42 Data size: 368 Basic stats: COMPLETE Column stats: NONE
+                      Map Join Operator
+                        condition map:
+                             Inner Join 0 to 1
+                        keys:
+                          0 _col0 (type: int)
+                          1 _col0 (type: int)
+                        outputColumnNames: _col0, _col1
+                        input vertices:
+                          0 Map 1
                         Statistics: Num rows: 46 Data size: 404 Basic stats: COMPLETE Column stats: NONE
-                        value expressions: _col0 (type: int)
+                        Reduce Output Operator
+                          key expressions: _col1 (type: string)
+                          sort order: +
+                          Map-reduce partition columns: _col1 (type: string)
+                          Statistics: Num rows: 46 Data size: 404 Basic stats: COMPLETE Column stats: NONE
+                          value expressions: _col0 (type: int)
             Local Work:
               Map Reduce Local Work
         Reducer 3 

http://git-wip-us.apache.org/repos/asf/hive/blob/855e43df/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_6.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_6.q.out b/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_6.q.out
index 25f61b8..c445d9d 100644
--- a/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_6.q.out
+++ b/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_6.q.out
@@ -91,10 +91,14 @@ STAGE PLANS:
                   Filter Operator
                     predicate: (key is not null and key2 is not null) (type: boolean)
                     Statistics: Num rows: 3 Data size: 27 Basic stats: COMPLETE Column stats: NONE
-                    Spark HashTable Sink Operator
-                      keys:
-                        0 key (type: int), key2 (type: int)
-                        1 key (type: int), key2 (type: int)
+                    Select Operator
+                      expressions: key (type: int), key2 (type: int), value (type: string)
+                      outputColumnNames: _col0, _col1, _col2
+                      Statistics: Num rows: 3 Data size: 27 Basic stats: COMPLETE Column stats: NONE
+                      Spark HashTable Sink Operator
+                        keys:
+                          0 _col0 (type: int), _col1 (type: int)
+                          1 _col0 (type: int), _col1 (type: int)
             Local Work:
               Map Reduce Local Work
 
@@ -112,26 +116,30 @@ STAGE PLANS:
                   Filter Operator
                     predicate: (key is not null and key2 is not null) (type: boolean)
                     Statistics: Num rows: 21 Data size: 244 Basic stats: COMPLETE Column stats: NONE
-                    Map Join Operator
-                      condition map:
-                           Inner Join 0 to 1
-                      keys:
-                        0 key (type: int), key2 (type: int)
-                        1 key (type: int), key2 (type: int)
-                      outputColumnNames: _col0, _col1, _col2, _col9
-                      input vertices:
-                        0 Map 1
-                      Statistics: Num rows: 23 Data size: 268 Basic stats: COMPLETE Column stats: NONE
-                      Select Operator
-                        expressions: _col0 (type: int), _col1 (type: int), concat(_col2, _col9) (type: string)
-                        outputColumnNames: _col0, _col1, _col2
+                    Select Operator
+                      expressions: key (type: int), key2 (type: int), value (type: string)
+                      outputColumnNames: _col0, _col1, _col2
+                      Statistics: Num rows: 21 Data size: 244 Basic stats: COMPLETE Column stats: NONE
+                      Map Join Operator
+                        condition map:
+                             Inner Join 0 to 1
+                        keys:
+                          0 _col0 (type: int), _col1 (type: int)
+                          1 _col0 (type: int), _col1 (type: int)
+                        outputColumnNames: _col0, _col1, _col2, _col6
+                        input vertices:
+                          0 Map 1
                         Statistics: Num rows: 23 Data size: 268 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: int), _col1 (type: int)
-                          sort order: +-
-                          Map-reduce partition columns: _col0 (type: int), _col1 (type: int)
+                        Select Operator
+                          expressions: _col0 (type: int), _col1 (type: int), concat(_col2, _col6) (type: string)
+                          outputColumnNames: _col0, _col1, _col2
                           Statistics: Num rows: 23 Data size: 268 Basic stats: COMPLETE Column stats: NONE
-                          value expressions: _col2 (type: string)
+                          Reduce Output Operator
+                            key expressions: _col0 (type: int), _col1 (type: int)
+                            sort order: +-
+                            Map-reduce partition columns: _col0 (type: int), _col1 (type: int)
+                            Statistics: Num rows: 23 Data size: 268 Basic stats: COMPLETE Column stats: NONE
+                            value expressions: _col2 (type: string)
             Local Work:
               Map Reduce Local Work
         Reducer 3 
@@ -270,10 +278,14 @@ STAGE PLANS:
                   Filter Operator
                     predicate: (key is not null and key2 is not null) (type: boolean)
                     Statistics: Num rows: 3 Data size: 27 Basic stats: COMPLETE Column stats: NONE
-                    Spark HashTable Sink Operator
-                      keys:
-                        0 key (type: int), key2 (type: int)
-                        1 key (type: int), key2 (type: int)
+                    Select Operator
+                      expressions: key (type: int), key2 (type: int), value (type: string)
+                      outputColumnNames: _col0, _col1, _col2
+                      Statistics: Num rows: 3 Data size: 27 Basic stats: COMPLETE Column stats: NONE
+                      Spark HashTable Sink Operator
+                        keys:
+                          0 _col0 (type: int), _col1 (type: int)
+                          1 _col0 (type: int), _col1 (type: int)
             Local Work:
               Map Reduce Local Work
 
@@ -291,26 +303,30 @@ STAGE PLANS:
                   Filter Operator
                     predicate: (key is not null and key2 is not null) (type: boolean)
                     Statistics: Num rows: 21 Data size: 244 Basic stats: COMPLETE Column stats: NONE
-                    Map Join Operator
-                      condition map:
-                           Inner Join 0 to 1
-                      keys:
-                        0 key (type: int), key2 (type: int)
-                        1 key (type: int), key2 (type: int)
-                      outputColumnNames: _col0, _col1, _col2, _col9
-                      input vertices:
-                        0 Map 1
-                      Statistics: Num rows: 23 Data size: 268 Basic stats: COMPLETE Column stats: NONE
-                      Select Operator
-                        expressions: _col0 (type: int), _col1 (type: int), concat(_col2, _col9) (type: string)
-                        outputColumnNames: _col0, _col1, _col2
+                    Select Operator
+                      expressions: key (type: int), key2 (type: int), value (type: string)
+                      outputColumnNames: _col0, _col1, _col2
+                      Statistics: Num rows: 21 Data size: 244 Basic stats: COMPLETE Column stats: NONE
+                      Map Join Operator
+                        condition map:
+                             Inner Join 0 to 1
+                        keys:
+                          0 _col0 (type: int), _col1 (type: int)
+                          1 _col0 (type: int), _col1 (type: int)
+                        outputColumnNames: _col0, _col1, _col2, _col6
+                        input vertices:
+                          0 Map 1
                         Statistics: Num rows: 23 Data size: 268 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: int), _col1 (type: int)
-                          sort order: +-
-                          Map-reduce partition columns: _col0 (type: int), _col1 (type: int)
+                        Select Operator
+                          expressions: _col0 (type: int), _col1 (type: int), concat(_col2, _col6) (type: string)
+                          outputColumnNames: _col0, _col1, _col2
                           Statistics: Num rows: 23 Data size: 268 Basic stats: COMPLETE Column stats: NONE
-                          value expressions: _col2 (type: string)
+                          Reduce Output Operator
+                            key expressions: _col0 (type: int), _col1 (type: int)
+                            sort order: +-
+                            Map-reduce partition columns: _col0 (type: int), _col1 (type: int)
+                            Statistics: Num rows: 23 Data size: 268 Basic stats: COMPLETE Column stats: NONE
+                            value expressions: _col2 (type: string)
             Local Work:
               Map Reduce Local Work
         Reducer 3 
@@ -449,10 +465,14 @@ STAGE PLANS:
                   Filter Operator
                     predicate: (key is not null and key2 is not null) (type: boolean)
                     Statistics: Num rows: 3 Data size: 27 Basic stats: COMPLETE Column stats: NONE
-                    Spark HashTable Sink Operator
-                      keys:
-                        0 key (type: int), key2 (type: int)
-                        1 key (type: int), key2 (type: int)
+                    Select Operator
+                      expressions: key (type: int), key2 (type: int), value (type: string)
+                      outputColumnNames: _col0, _col1, _col2
+                      Statistics: Num rows: 3 Data size: 27 Basic stats: COMPLETE Column stats: NONE
+                      Spark HashTable Sink Operator
+                        keys:
+                          0 _col0 (type: int), _col1 (type: int)
+                          1 _col0 (type: int), _col1 (type: int)
             Local Work:
               Map Reduce Local Work
 
@@ -470,26 +490,30 @@ STAGE PLANS:
                   Filter Operator
                     predicate: (key is not null and key2 is not null) (type: boolean)
                     Statistics: Num rows: 21 Data size: 244 Basic stats: COMPLETE Column stats: NONE
-                    Map Join Operator
-                      condition map:
-                           Inner Join 0 to 1
-                      keys:
-                        0 key (type: int), key2 (type: int)
-                        1 key (type: int), key2 (type: int)
-                      outputColumnNames: _col0, _col1, _col2, _col9
-                      input vertices:
-                        0 Map 1
-                      Statistics: Num rows: 23 Data size: 268 Basic stats: COMPLETE Column stats: NONE
-                      Select Operator
-                        expressions: _col1 (type: int), _col0 (type: int), concat(_col2, _col9) (type: string)
-                        outputColumnNames: _col0, _col1, _col2
+                    Select Operator
+                      expressions: key (type: int), key2 (type: int), value (type: string)
+                      outputColumnNames: _col0, _col1, _col2
+                      Statistics: Num rows: 21 Data size: 244 Basic stats: COMPLETE Column stats: NONE
+                      Map Join Operator
+                        condition map:
+                             Inner Join 0 to 1
+                        keys:
+                          0 _col0 (type: int), _col1 (type: int)
+                          1 _col0 (type: int), _col1 (type: int)
+                        outputColumnNames: _col0, _col1, _col2, _col6
+                        input vertices:
+                          0 Map 1
                         Statistics: Num rows: 23 Data size: 268 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: int), _col1 (type: int)
-                          sort order: +-
-                          Map-reduce partition columns: _col0 (type: int), _col1 (type: int)
+                        Select Operator
+                          expressions: _col1 (type: int), _col0 (type: int), concat(_col2, _col6) (type: string)
+                          outputColumnNames: _col0, _col1, _col2
                           Statistics: Num rows: 23 Data size: 268 Basic stats: COMPLETE Column stats: NONE
-                          value expressions: _col2 (type: string)
+                          Reduce Output Operator
+                            key expressions: _col0 (type: int), _col1 (type: int)
+                            sort order: +-
+                            Map-reduce partition columns: _col0 (type: int), _col1 (type: int)
+                            Statistics: Num rows: 23 Data size: 268 Basic stats: COMPLETE Column stats: NONE
+                            value expressions: _col2 (type: string)
             Local Work:
               Map Reduce Local Work
         Reducer 3 
@@ -563,10 +587,14 @@ STAGE PLANS:
                   Filter Operator
                     predicate: (key is not null and key2 is not null) (type: boolean)
                     Statistics: Num rows: 3 Data size: 27 Basic stats: COMPLETE Column stats: NONE
-                    Spark HashTable Sink Operator
-                      keys:
-                        0 key (type: int), key2 (type: int)
-                        1 key (type: int), key2 (type: int)
+                    Select Operator
+                      expressions: key (type: int), key2 (type: int), value (type: string)
+                      outputColumnNames: _col0, _col1, _col2
+                      Statistics: Num rows: 3 Data size: 27 Basic stats: COMPLETE Column stats: NONE
+                      Spark HashTable Sink Operator
+                        keys:
+                          0 _col0 (type: int), _col1 (type: int)
+                          1 _col0 (type: int), _col1 (type: int)
             Local Work:
               Map Reduce Local Work
 
@@ -584,26 +612,30 @@ STAGE PLANS:
                   Filter Operator
                     predicate: (key is not null and key2 is not null) (type: boolean)
                     Statistics: Num rows: 21 Data size: 244 Basic stats: COMPLETE Column stats: NONE
-                    Map Join Operator
-                      condition map:
-                           Inner Join 0 to 1
-                      keys:
-                        0 key (type: int), key2 (type: int)
-                        1 key (type: int), key2 (type: int)
-                      outputColumnNames: _col0, _col1, _col2, _col9
-                      input vertices:
-                        0 Map 1
-                      Statistics: Num rows: 23 Data size: 268 Basic stats: COMPLETE Column stats: NONE
-                      Select Operator
-                        expressions: _col1 (type: int), _col0 (type: int), concat(_col2, _col9) (type: string)
-                        outputColumnNames: _col0, _col1, _col2
+                    Select Operator
+                      expressions: key (type: int), key2 (type: int), value (type: string)
+                      outputColumnNames: _col0, _col1, _col2
+                      Statistics: Num rows: 21 Data size: 244 Basic stats: COMPLETE Column stats: NONE
+                      Map Join Operator
+                        condition map:
+                             Inner Join 0 to 1
+                        keys:
+                          0 _col0 (type: int), _col1 (type: int)
+                          1 _col0 (type: int), _col1 (type: int)
+                        outputColumnNames: _col0, _col1, _col2, _col6
+                        input vertices:
+                          0 Map 1
                         Statistics: Num rows: 23 Data size: 268 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: int), _col1 (type: int)
-                          sort order: +-
-                          Map-reduce partition columns: _col0 (type: int), _col1 (type: int)
+                        Select Operator
+                          expressions: _col1 (type: int), _col0 (type: int), concat(_col2, _col6) (type: string)
+                          outputColumnNames: _col0, _col1, _col2
                           Statistics: Num rows: 23 Data size: 268 Basic stats: COMPLETE Column stats: NONE
-                          value expressions: _col2 (type: string)
+                          Reduce Output Operator
+                            key expressions: _col0 (type: int), _col1 (type: int)
+                            sort order: +-
+                            Map-reduce partition columns: _col0 (type: int), _col1 (type: int)
+                            Statistics: Num rows: 23 Data size: 268 Basic stats: COMPLETE Column stats: NONE
+                            value expressions: _col2 (type: string)
             Local Work:
               Map Reduce Local Work
         Reducer 3 
@@ -683,10 +715,14 @@ STAGE PLANS:
                   Filter Operator
                     predicate: (key is not null and key2 is not null) (type: boolean)
                     Statistics: Num rows: 3 Data size: 27 Basic stats: COMPLETE Column stats: NONE
-                    Spark HashTable Sink Operator
-                      keys:
-                        0 key (type: int), key2 (type: int)
-                        1 key (type: int), key2 (type: int)
+                    Select Operator
+                      expressions: key (type: int), key2 (type: int), value (type: string)
+                      outputColumnNames: _col0, _col1, _col2
+                      Statistics: Num rows: 3 Data size: 27 Basic stats: COMPLETE Column stats: NONE
+                      Spark HashTable Sink Operator
+                        keys:
+                          0 _col0 (type: int), _col1 (type: int)
+                          1 _col0 (type: int), _col1 (type: int)
             Local Work:
               Map Reduce Local Work
 
@@ -704,26 +740,30 @@ STAGE PLANS:
                   Filter Operator
                     predicate: (key is not null and key2 is not null) (type: boolean)
                     Statistics: Num rows: 21 Data size: 244 Basic stats: COMPLETE Column stats: NONE
-                    Map Join Operator
-                      condition map:
-                           Inner Join 0 to 1
-                      keys:
-                        0 key (type: int), key2 (type: int)
-                        1 key (type: int), key2 (type: int)
-                      outputColumnNames: _col0, _col1, _col2, _col9
-                      input vertices:
-                        0 Map 1
-                      Statistics: Num rows: 23 Data size: 268 Basic stats: COMPLETE Column stats: NONE
-                      Select Operator
-                        expressions: _col0 (type: int), _col1 (type: int), concat(_col2, _col9) (type: string)
-                        outputColumnNames: _col0, _col1, _col2
+                    Select Operator
+                      expressions: key (type: int), key2 (type: int), value (type: string)
+                      outputColumnNames: _col0, _col1, _col2
+                      Statistics: Num rows: 21 Data size: 244 Basic stats: COMPLETE Column stats: NONE
+                      Map Join Operator
+                        condition map:
+                             Inner Join 0 to 1
+                        keys:
+                          0 _col0 (type: int), _col1 (type: int)
+                          1 _col0 (type: int), _col1 (type: int)
+                        outputColumnNames: _col0, _col1, _col2, _col6
+                        input vertices:
+                          0 Map 1
                         Statistics: Num rows: 23 Data size: 268 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: int), _col1 (type: int)
-                          sort order: +-
-                          Map-reduce partition columns: _col0 (type: int), _col1 (type: int)
+                        Select Operator
+                          expressions: _col0 (type: int), _col1 (type: int), concat(_col2, _col6) (type: string)
+                          outputColumnNames: _col0, _col1, _col2
                           Statistics: Num rows: 23 Data size: 268 Basic stats: COMPLETE Column stats: NONE
-                          value expressions: _col2 (type: string)
+                          Reduce Output Operator
+                            key expressions: _col0 (type: int), _col1 (type: int)
+                            sort order: +-
+                            Map-reduce partition columns: _col0 (type: int), _col1 (type: int)
+                            Statistics: Num rows: 23 Data size: 268 Basic stats: COMPLETE Column stats: NONE
+                            value expressions: _col2 (type: string)
             Local Work:
               Map Reduce Local Work
         Reducer 3 
@@ -880,10 +920,14 @@ STAGE PLANS:
                   Filter Operator
                     predicate: (key is not null and key2 is not null) (type: boolean)
                     Statistics: Num rows: 3 Data size: 27 Basic stats: COMPLETE Column stats: NONE
-                    Spark HashTable Sink Operator
-                      keys:
-                        0 key (type: int), key2 (type: int)
-                        1 key (type: int), key2 (type: int)
+                    Select Operator
+                      expressions: key (type: int), key2 (type: int), value (type: string)
+                      outputColumnNames: _col0, _col1, _col2
+                      Statistics: Num rows: 3 Data size: 27 Basic stats: COMPLETE Column stats: NONE
+                      Spark HashTable Sink Operator
+                        keys:
+                          0 _col0 (type: int), _col1 (type: int)
+                          1 _col0 (type: int), _col1 (type: int)
             Local Work:
               Map Reduce Local Work
 
@@ -901,26 +945,30 @@ STAGE PLANS:
                   Filter Operator
                     predicate: (key is not null and key2 is not null) (type: boolean)
                     Statistics: Num rows: 21 Data size: 244 Basic stats: COMPLETE Column stats: NONE
-                    Map Join Operator
-                      condition map:
-                           Inner Join 0 to 1
-                      keys:
-                        0 key (type: int), key2 (type: int)
-                        1 key (type: int), key2 (type: int)
-                      outputColumnNames: _col0, _col1, _col2, _col9
-                      input vertices:
-                        0 Map 1
-                      Statistics: Num rows: 23 Data size: 268 Basic stats: COMPLETE Column stats: NONE
-                      Select Operator
-                        expressions: _col0 (type: int), _col1 (type: int), concat(_col2, _col9) (type: string)
-                        outputColumnNames: _col0, _col1, _col2
+                    Select Operator
+                      expressions: key (type: int), key2 (type: int), value (type: string)
+                      outputColumnNames: _col0, _col1, _col2
+                      Statistics: Num rows: 21 Data size: 244 Basic stats: COMPLETE Column stats: NONE
+                      Map Join Operator
+                        condition map:
+                             Inner Join 0 to 1
+                        keys:
+                          0 _col0 (type: int), _col1 (type: int)
+                          1 _col0 (type: int), _col1 (type: int)
+                        outputColumnNames: _col0, _col1, _col2, _col6
+                        input vertices:
+                          0 Map 1
                         Statistics: Num rows: 23 Data size: 268 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: int), _col1 (type: int)
-                          sort order: +-
-                          Map-reduce partition columns: _col0 (type: int), _col1 (type: int)
+                        Select Operator
+                          expressions: _col0 (type: int), _col1 (type: int), concat(_col2, _col6) (type: string)
+                          outputColumnNames: _col0, _col1, _col2
                           Statistics: Num rows: 23 Data size: 268 Basic stats: COMPLETE Column stats: NONE
-                          value expressions: _col2 (type: string)
+                          Reduce Output Operator
+                            key expressions: _col0 (type: int), _col1 (type: int)
+                            sort order: +-
+                            Map-reduce partition columns: _col0 (type: int), _col1 (type: int)
+                            Statistics: Num rows: 23 Data size: 268 Basic stats: COMPLETE Column stats: NONE
+                            value expressions: _col2 (type: string)
             Local Work:
               Map Reduce Local Work
         Reducer 3 
@@ -1087,10 +1135,14 @@ STAGE PLANS:
                   Filter Operator
                     predicate: (key is not null and key2 is not null) (type: boolean)
                     Statistics: Num rows: 3 Data size: 27 Basic stats: COMPLETE Column stats: NONE
-                    Spark HashTable Sink Operator
-                      keys:
-                        0 key (type: int), key2 (type: int)
-                        1 key (type: int), key2 (type: int)
+                    Select Operator
+                      expressions: key (type: int), key2 (type: int), value (type: string)
+                      outputColumnNames: _col0, _col1, _col2
+                      Statistics: Num rows: 3 Data size: 27 Basic stats: COMPLETE Column stats: NONE
+                      Spark HashTable Sink Operator
+                        keys:
+                          0 _col0 (type: int), _col1 (type: int)
+                          1 _col0 (type: int), _col1 (type: int)
             Local Work:
               Map Reduce Local Work
 
@@ -1108,26 +1160,30 @@ STAGE PLANS:
                   Filter Operator
                     predicate: (key is not null and key2 is not null) (type: boolean)
                     Statistics: Num rows: 21 Data size: 244 Basic stats: COMPLETE Column stats: NONE
-                    Map Join Operator
-                      condition map:
-                           Inner Join 0 to 1
-                      keys:
-                        0 key (type: int), key2 (type: int)
-                        1 key (type: int), key2 (type: int)
-                      outputColumnNames: _col0, _col1, _col2, _col9
-                      input vertices:
-                        0 Map 1
-                      Statistics: Num rows: 23 Data size: 268 Basic stats: COMPLETE Column stats: NONE
-                      Select Operator
-                        expressions: _col0 (type: int), _col1 (type: int), concat(_col2, _col9) (type: string)
-                        outputColumnNames: _col0, _col1, _col2
+                    Select Operator
+                      expressions: key (type: int), key2 (type: int), value (type: string)
+                      outputColumnNames: _col0, _col1, _col2
+                      Statistics: Num rows: 21 Data size: 244 Basic stats: COMPLETE Column stats: NONE
+                      Map Join Operator
+                        condition map:
+                             Inner Join 0 to 1
+                        keys:
+                          0 _col0 (type: int), _col1 (type: int)
+                          1 _col0 (type: int), _col1 (type: int)
+                        outputColumnNames: _col0, _col1, _col2, _col6
+                        input vertices:
+                          0 Map 1
                         Statistics: Num rows: 23 Data size: 268 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: int), _col1 (type: int)
-                          sort order: --
-                          Map-reduce partition columns: _col0 (type: int), _col1 (type: int)
+                        Select Operator
+                          expressions: _col0 (type: int), _col1 (type: int), concat(_col2, _col6) (type: string)
+                          outputColumnNames: _col0, _col1, _col2
                           Statistics: Num rows: 23 Data size: 268 Basic stats: COMPLETE Column stats: NONE
-                          value expressions: _col2 (type: string)
+                          Reduce Output Operator
+                            key expressions: _col0 (type: int), _col1 (type: int)
+                            sort order: --
+                            Map-reduce partition columns: _col0 (type: int), _col1 (type: int)
+                            Statistics: Num rows: 23 Data size: 268 Basic stats: COMPLETE Column stats: NONE
+                            value expressions: _col2 (type: string)
             Local Work:
               Map Reduce Local Work
         Reducer 3 

http://git-wip-us.apache.org/repos/asf/hive/blob/855e43df/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_7.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_7.q.out b/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_7.q.out
index 2b919a0..e04f453 100644
--- a/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_7.q.out
+++ b/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_7.q.out
@@ -89,12 +89,16 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and ((key = 0) or (key = 5))) (type: boolean)
-                    Statistics: Num rows: 4 Data size: 28 Basic stats: COMPLETE Column stats: NONE
-                    Spark HashTable Sink Operator
-                      keys:
-                        0 key (type: int)
-                        1 key (type: int)
+                    predicate: (((key = 0) or (key = 5)) and key is not null) (type: boolean)
+                    Statistics: Num rows: 5 Data size: 35 Basic stats: COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: key (type: int), value (type: string)
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 5 Data size: 35 Basic stats: COMPLETE Column stats: NONE
+                      Spark HashTable Sink Operator
+                        keys:
+                          0 _col0 (type: int)
+                          1 _col0 (type: int)
             Local Work:
               Map Reduce Local Work
 
@@ -110,28 +114,32 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 84 Data size: 736 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and ((key = 0) or (key = 5))) (type: boolean)
+                    predicate: (((key = 0) or (key = 5)) and key is not null) (type: boolean)
                     Statistics: Num rows: 42 Data size: 368 Basic stats: COMPLETE Column stats: NONE
-                    Map Join Operator
-                      condition map:
-                           Inner Join 0 to 1
-                      keys:
-                        0 key (type: int)
-                        1 key (type: int)
-                      outputColumnNames: _col0, _col1, _col7
-                      input vertices:
-                        0 Map 1
-                      Statistics: Num rows: 46 Data size: 404 Basic stats: COMPLETE Column stats: NONE
-                      Select Operator
-                        expressions: _col0 (type: int), concat(_col1, _col7) (type: string)
-                        outputColumnNames: _col0, _col1
+                    Select Operator
+                      expressions: key (type: int), value (type: string)
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 42 Data size: 368 Basic stats: COMPLETE Column stats: NONE
+                      Map Join Operator
+                        condition map:
+                             Inner Join 0 to 1
+                        keys:
+                          0 _col0 (type: int)
+                          1 _col0 (type: int)
+                        outputColumnNames: _col0, _col1, _col4
+                        input vertices:
+                          0 Map 1
                         Statistics: Num rows: 46 Data size: 404 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: int)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: int)
+                        Select Operator
+                          expressions: _col0 (type: int), concat(_col1, _col4) (type: string)
+                          outputColumnNames: _col0, _col1
                           Statistics: Num rows: 46 Data size: 404 Basic stats: COMPLETE Column stats: NONE
-                          value expressions: _col1 (type: string)
+                          Reduce Output Operator
+                            key expressions: _col0 (type: int)
+                            sort order: +
+                            Map-reduce partition columns: _col0 (type: int)
+                            Statistics: Num rows: 46 Data size: 404 Basic stats: COMPLETE Column stats: NONE
+                            value expressions: _col1 (type: string)
             Local Work:
               Map Reduce Local Work
         Reducer 3 
@@ -451,12 +459,12 @@ STAGE PLANS:
                   alias: test_table1
                   Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((key < 8) and ((key = 0) or (key = 5))) (type: boolean)
-                    Statistics: Num rows: 2 Data size: 14 Basic stats: COMPLETE Column stats: NONE
+                    predicate: (((key < 8) and ((key = 0) or (key = 5))) and key is not null) (type: boolean)
+                    Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int), value (type: string)
                       outputColumnNames: _col0, _col1
-                      Statistics: Num rows: 2 Data size: 14 Basic stats: COMPLETE Column stats: NONE
+                      Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
                       Spark HashTable Sink Operator
                         keys:
                           0 _col0 (type: int)
@@ -476,12 +484,12 @@ STAGE PLANS:
                   alias: test_table2
                   Statistics: Num rows: 84 Data size: 736 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((key < 8) and ((key = 0) or (key = 5))) (type: boolean)
-                    Statistics: Num rows: 28 Data size: 245 Basic stats: COMPLETE Column stats: NONE
+                    predicate: (((key < 8) and ((key = 0) or (key = 5))) and key is not null) (type: boolean)
+                    Statistics: Num rows: 14 Data size: 122 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int), value (type: string)
                       outputColumnNames: _col0, _col1
-                      Statistics: Num rows: 28 Data size: 245 Basic stats: COMPLETE Column stats: NONE
+                      Statistics: Num rows: 14 Data size: 122 Basic stats: COMPLETE Column stats: NONE
                       Map Join Operator
                         condition map:
                              Inner Join 0 to 1
@@ -491,16 +499,16 @@ STAGE PLANS:
                         outputColumnNames: _col0, _col1, _col3
                         input vertices:
                           0 Map 1
-                        Statistics: Num rows: 30 Data size: 269 Basic stats: COMPLETE Column stats: NONE
+                        Statistics: Num rows: 15 Data size: 134 Basic stats: COMPLETE Column stats: NONE
                         Select Operator
                           expressions: _col0 (type: int), concat(_col1, _col3) (type: string)
                           outputColumnNames: _col0, _col1
-                          Statistics: Num rows: 30 Data size: 269 Basic stats: COMPLETE Column stats: NONE
+                          Statistics: Num rows: 15 Data size: 134 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: 30 Data size: 269 Basic stats: COMPLETE Column stats: NONE
+                            Statistics: Num rows: 15 Data size: 134 Basic stats: COMPLETE Column stats: NONE
                             value expressions: _col1 (type: string)
             Local Work:
               Map Reduce Local Work
@@ -509,10 +517,10 @@ STAGE PLANS:
               Select Operator
                 expressions: KEY.reducesinkkey0 (type: int), VALUE._col0 (type: string)
                 outputColumnNames: _col0, _col1
-                Statistics: Num rows: 30 Data size: 269 Basic stats: COMPLETE Column stats: NONE
+                Statistics: Num rows: 15 Data size: 134 Basic stats: COMPLETE Column stats: NONE
                 File Output Operator
                   compressed: false
-                  Statistics: Num rows: 30 Data size: 269 Basic stats: COMPLETE Column stats: NONE
+                  Statistics: Num rows: 15 Data size: 134 Basic stats: COMPLETE Column stats: NONE
                   table:
                       input format: org.apache.hadoop.mapred.TextInputFormat
                       output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat

http://git-wip-us.apache.org/repos/asf/hive/blob/855e43df/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_8.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_8.q.out b/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_8.q.out
index dade75c..ea1d58a 100644
--- a/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_8.q.out
+++ b/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_8.q.out
@@ -89,10 +89,14 @@ STAGE PLANS:
                   Filter Operator
                     predicate: key is not null (type: boolean)
                     Statistics: Num rows: 5 Data size: 35 Basic stats: COMPLETE Column stats: NONE
-                    Spark HashTable Sink Operator
-                      keys:
-                        0 key (type: int)
-                        1 key (type: int)
+                    Select Operator
+                      expressions: key (type: int), value (type: string)
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 5 Data size: 35 Basic stats: COMPLETE Column stats: NONE
+                      Spark HashTable Sink Operator
+                        keys:
+                          0 _col0 (type: int)
+                          1 _col0 (type: int)
             Local Work:
               Map Reduce Local Work
 
@@ -110,26 +114,30 @@ STAGE PLANS:
                   Filter Operator
                     predicate: key is not null (type: boolean)
                     Statistics: Num rows: 42 Data size: 368 Basic stats: COMPLETE Column stats: NONE
-                    Map Join Operator
-                      condition map:
-                           Inner Join 0 to 1
-                      keys:
-                        0 key (type: int)
-                        1 key (type: int)
-                      outputColumnNames: _col0, _col1, _col6, _col7
-                      input vertices:
-                        0 Map 1
-                      Statistics: Num rows: 46 Data size: 404 Basic stats: COMPLETE Column stats: NONE
-                      Select Operator
-                        expressions: _col0 (type: int), _col6 (type: int), concat(_col1, _col7) (type: string)
-                        outputColumnNames: _col0, _col1, _col2
+                    Select Operator
+                      expressions: key (type: int), value (type: string)
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 42 Data size: 368 Basic stats: COMPLETE Column stats: NONE
+                      Map Join Operator
+                        condition map:
+                             Inner Join 0 to 1
+                        keys:
+                          0 _col0 (type: int)
+                          1 _col0 (type: int)
+                        outputColumnNames: _col0, _col1, _col3, _col4
+                        input vertices:
+                          0 Map 1
                         Statistics: Num rows: 46 Data size: 404 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: int)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: int)
+                        Select Operator
+                          expressions: _col0 (type: int), _col3 (type: int), concat(_col1, _col4) (type: string)
+                          outputColumnNames: _col0, _col1, _col2
                           Statistics: Num rows: 46 Data size: 404 Basic stats: COMPLETE Column stats: NONE
-                          value expressions: _col1 (type: int), _col2 (type: string)
+                          Reduce Output Operator
+                            key expressions: _col0 (type: int)
+                            sort order: +
+                            Map-reduce partition columns: _col0 (type: int)
+                            Statistics: Num rows: 46 Data size: 404 Basic stats: COMPLETE Column stats: NONE
+                            value expressions: _col1 (type: int), _col2 (type: string)
             Local Work:
               Map Reduce Local Work
         Reducer 3 
@@ -262,10 +270,14 @@ STAGE PLANS:
                   Filter Operator
                     predicate: key is not null (type: boolean)
                     Statistics: Num rows: 5 Data size: 35 Basic stats: COMPLETE Column stats: NONE
-                    Spark HashTable Sink Operator
-                      keys:
-                        0 key (type: int)
-                        1 key (type: int)
+                    Select Operator
+                      expressions: key (type: int), value (type: string)
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 5 Data size: 35 Basic stats: COMPLETE Column stats: NONE
+                      Spark HashTable Sink Operator
+                        keys:
+                          0 _col0 (type: int)
+                          1 _col0 (type: int)
             Local Work:
               Map Reduce Local Work
 
@@ -283,26 +295,30 @@ STAGE PLANS:
                   Filter Operator
                     predicate: key is not null (type: boolean)
                     Statistics: Num rows: 42 Data size: 368 Basic stats: COMPLETE Column stats: NONE
-                    Map Join Operator
-                      condition map:
-                           Inner Join 0 to 1
-                      keys:
-                        0 key (type: int)
-                        1 key (type: int)
-                      outputColumnNames: _col0, _col1, _col6, _col7
-                      input vertices:
-                        0 Map 1
-                      Statistics: Num rows: 46 Data size: 404 Basic stats: COMPLETE Column stats: NONE
-                      Select Operator
-                        expressions: _col6 (type: int), _col0 (type: int), concat(_col1, _col7) (type: string)
-                        outputColumnNames: _col0, _col1, _col2
+                    Select Operator
+                      expressions: key (type: int), value (type: string)
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 42 Data size: 368 Basic stats: COMPLETE Column stats: NONE
+                      Map Join Operator
+                        condition map:
+                             Inner Join 0 to 1
+                        keys:
+                          0 _col0 (type: int)
+                          1 _col0 (type: int)
+                        outputColumnNames: _col0, _col1, _col3, _col4
+                        input vertices:
+                          0 Map 1
                         Statistics: Num rows: 46 Data size: 404 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: int)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: int)
+                        Select Operator
+                          expressions: _col3 (type: int), _col0 (type: int), concat(_col1, _col4) (type: string)
+                          outputColumnNames: _col0, _col1, _col2
                           Statistics: Num rows: 46 Data size: 404 Basic stats: COMPLETE Column stats: NONE
-                          value expressions: _col1 (type: int), _col2 (type: string)
+                          Reduce Output Operator
+                            key expressions: _col0 (type: int)
+                            sort order: +
+                            Map-reduce partition columns: _col0 (type: int)
+                            Statistics: Num rows: 46 Data size: 404 Basic stats: COMPLETE Column stats: NONE
+                            value expressions: _col1 (type: int), _col2 (type: string)
             Local Work:
               Map Reduce Local Work
         Reducer 3 

http://git-wip-us.apache.org/repos/asf/hive/blob/855e43df/ql/src/test/results/clientpositive/spark/column_access_stats.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/column_access_stats.q.out b/ql/src/test/results/clientpositive/spark/column_access_stats.q.out
index 869d6cb..4429531 100644
--- a/ql/src/test/results/clientpositive/spark/column_access_stats.q.out
+++ b/ql/src/test/results/clientpositive/spark/column_access_stats.q.out
@@ -378,11 +378,15 @@ STAGE PLANS:
                   Filter Operator
                     predicate: key is not null (type: boolean)
                     Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
-                    Reduce Output Operator
-                      key expressions: key (type: string)
-                      sort order: +
-                      Map-reduce partition columns: key (type: string)
+                    Select Operator
+                      expressions: key (type: string)
+                      outputColumnNames: _col0
                       Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
+                        Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
         Map 3 
             Map Operator Tree:
                 TableScan
@@ -391,19 +395,23 @@ STAGE PLANS:
                   Filter Operator
                     predicate: key is not null (type: boolean)
                     Statistics: Num rows: 3 Data size: 9 Basic stats: COMPLETE Column stats: NONE
-                    Reduce Output Operator
-                      key expressions: key (type: string)
-                      sort order: +
-                      Map-reduce partition columns: key (type: string)
+                    Select Operator
+                      expressions: key (type: string)
+                      outputColumnNames: _col0
                       Statistics: Num rows: 3 Data size: 9 Basic stats: COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
+                        Statistics: Num rows: 3 Data size: 9 Basic stats: COMPLETE Column stats: NONE
         Reducer 2 
             Reduce Operator Tree:
               Join Operator
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 key (type: string)
-                  1 key (type: string)
+                  0 _col0 (type: string)
+                  1 _col0 (type: string)
                 outputColumnNames: _col0
                 Statistics: Num rows: 3 Data size: 9 Basic stats: COMPLETE Column stats: NONE
                 File Output Operator
@@ -495,38 +503,46 @@ STAGE PLANS:
                   alias: t1
                   Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((val = 3) and key is not null) (type: boolean)
+                    predicate: ((UDFToDouble(val) = 3.0) and key is not null) (type: boolean)
                     Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
-                    Reduce Output Operator
-                      key expressions: key (type: string)
-                      sort order: +
-                      Map-reduce partition columns: key (type: string)
+                    Select Operator
+                      expressions: key (type: string)
+                      outputColumnNames: _col0
                       Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
+                        Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
         Map 3 
             Map Operator Tree:
                 TableScan
                   alias: t2
                   Statistics: Num rows: 5 Data size: 15 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((val = 3) and key is not null) (type: boolean)
+                    predicate: ((UDFToDouble(val) = 3.0) and key is not null) (type: boolean)
                     Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE
-                    Reduce Output Operator
-                      key expressions: key (type: string)
-                      sort order: +
-                      Map-reduce partition columns: key (type: string)
+                    Select Operator
+                      expressions: key (type: string)
+                      outputColumnNames: _col0
                       Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
+                        Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE
         Reducer 2 
             Reduce Operator Tree:
               Join Operator
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 key (type: string)
-                  1 key (type: string)
-                outputColumnNames: _col0, _col5
+                  0 _col0 (type: string)
+                  1 _col0 (type: string)
+                outputColumnNames: _col0, _col2
                 Statistics: Num rows: 1 Data size: 33 Basic stats: COMPLETE Column stats: NONE
                 Select Operator
-                  expressions: _col0 (type: string), '3' (type: string), _col5 (type: string), '3' (type: string)
+                  expressions: _col0 (type: string), '3' (type: string), _col2 (type: string), '3' (type: string)
                   outputColumnNames: _col0, _col1, _col2, _col3
                   Statistics: Num rows: 1 Data size: 33 Basic stats: COMPLETE Column stats: NONE
                   File Output Operator
@@ -585,7 +601,7 @@ STAGE PLANS:
                   alias: t1
                   Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((key = 5) and val is not null) (type: boolean)
+                    predicate: ((UDFToDouble(key) = 5.0) and val is not null) (type: boolean)
                     Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: val (type: string)
@@ -602,7 +618,7 @@ STAGE PLANS:
                   alias: t2
                   Statistics: Num rows: 5 Data size: 15 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((key = 6) and val is not null) (type: boolean)
+                    predicate: ((UDFToDouble(key) = 6.0) and val is not null) (type: boolean)
                     Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: val (type: string)
@@ -730,12 +746,16 @@ STAGE PLANS:
                   Filter Operator
                     predicate: key is not null (type: boolean)
                     Statistics: Num rows: 3 Data size: 18 Basic stats: COMPLETE Column stats: NONE
-                    Reduce Output Operator
-                      key expressions: key (type: string)
-                      sort order: +
-                      Map-reduce partition columns: key (type: string)
+                    Select Operator
+                      expressions: key (type: string), val (type: string)
+                      outputColumnNames: _col0, _col1
                       Statistics: Num rows: 3 Data size: 18 Basic stats: COMPLETE Column stats: NONE
-                      value expressions: val (type: string)
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
+                        Statistics: Num rows: 3 Data size: 18 Basic stats: COMPLETE Column stats: NONE
+                        value expressions: _col1 (type: string)
         Reducer 2 
             Reduce Operator Tree:
               Join Operator
@@ -758,7 +778,7 @@ STAGE PLANS:
                      Inner Join 0 to 1
                 keys:
                   0 _col0 (type: string)
-                  1 key (type: string)
+                  1 _col0 (type: string)
                 outputColumnNames: _col0, _col1, _col2
                 Statistics: Num rows: 3 Data size: 9 Basic stats: COMPLETE Column stats: NONE
                 File Output Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/855e43df/ql/src/test/results/clientpositive/spark/constprog_partitioner.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/constprog_partitioner.q.out b/ql/src/test/results/clientpositive/spark/constprog_partitioner.q.out
index 3a3a751..d760e14 100644
--- a/ql/src/test/results/clientpositive/spark/constprog_partitioner.q.out
+++ b/ql/src/test/results/clientpositive/spark/constprog_partitioner.q.out
@@ -26,15 +26,12 @@ STAGE PLANS:
                     predicate: (UDFToDouble(key) = 100.0) (type: boolean)
                     Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: value (type: string)
-                      outputColumnNames: _col1
                       Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
                       Reduce Output Operator
                         key expressions: '100' (type: string)
                         sort order: +
                         Map-reduce partition columns: '100' (type: string)
                         Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
-                        value expressions: _col1 (type: string)
         Map 3 
             Map Operator Tree:
                 TableScan
@@ -44,12 +41,15 @@ STAGE PLANS:
                     predicate: (UDFToDouble(key) = 100.0) (type: boolean)
                     Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
+                      expressions: value (type: string)
+                      outputColumnNames: _col1
                       Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
                       Reduce Output Operator
                         key expressions: '100' (type: string)
                         sort order: +
                         Map-reduce partition columns: '100' (type: string)
                         Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
+                        value expressions: _col1 (type: string)
         Reducer 2 
             Reduce Operator Tree:
               Join Operator
@@ -58,10 +58,10 @@ STAGE PLANS:
                 keys:
                   0 _col0 (type: string)
                   1 _col0 (type: string)
-                outputColumnNames: _col1
+                outputColumnNames: _col2
                 Statistics: Num rows: 275 Data size: 2921 Basic stats: COMPLETE Column stats: NONE
                 Select Operator
-                  expressions: '100' (type: string), 101.0 (type: double), _col1 (type: string)
+                  expressions: '100' (type: string), 101.0 (type: double), _col2 (type: string)
                   outputColumnNames: _col0, _col1, _col2
                   Statistics: Num rows: 275 Data size: 2921 Basic stats: COMPLETE Column stats: NONE
                   File Output Operator