http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/llap/bucketmapjoin3.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/bucketmapjoin3.q.out 
b/ql/src/test/results/clientpositive/llap/bucketmapjoin3.q.out
index 68fc903..4ed9b60 100644
--- a/ql/src/test/results/clientpositive/llap/bucketmapjoin3.q.out
+++ b/ql/src/test/results/clientpositive/llap/bucketmapjoin3.q.out
@@ -135,10 +135,10 @@ POSTHOOK: Input: default@srcbucket_mapjoin_part_n13
 POSTHOOK: Input: default@srcbucket_mapjoin_part_n13@ds=2008-04-08
 POSTHOOK: Output: default@bucketmapjoin_tmp_result_n6
 OPTIMIZED SQL: SELECT `t0`.`key`, `t0`.`value`, `t2`.`value` AS `value1`
-FROM (SELECT `key`, `value`, CAST('2008-04-08' AS STRING) AS `ds`
+FROM (SELECT `key`, `value`
 FROM `default`.`srcbucket_mapjoin_part_2_n11`
 WHERE `ds` = '2008-04-08' AND `key` IS NOT NULL) AS `t0`
-INNER JOIN (SELECT `key`, `value`, CAST('2008-04-08' AS STRING) AS `ds`
+INNER JOIN (SELECT `key`, `value`
 FROM `default`.`srcbucket_mapjoin_part_n13`
 WHERE `ds` = '2008-04-08' AND `key` IS NOT NULL) AS `t2` ON `t0`.`key` = 
`t2`.`key`
 STAGE DEPENDENCIES:
@@ -326,11 +326,11 @@ STAGE PLANS:
                 keys:
                   0 _col0 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col0, _col1, _col4
+                outputColumnNames: _col0, _col1, _col3
                 Position of Big Table: 1
                 Statistics: Num rows: 156 Data size: 89111 Basic stats: 
PARTIAL Column stats: NONE
                 Select Operator
-                  expressions: CAST( _col0 AS STRING) (type: string), _col1 
(type: string), _col4 (type: string)
+                  expressions: CAST( _col0 AS STRING) (type: string), _col1 
(type: string), _col3 (type: string)
                   outputColumnNames: _col0, _col1, _col2
                   Statistics: Num rows: 156 Data size: 89111 Basic stats: 
PARTIAL Column stats: NONE
                   File Output Operator
@@ -584,10 +584,10 @@ POSTHOOK: Input: default@srcbucket_mapjoin_part_n13
 POSTHOOK: Input: default@srcbucket_mapjoin_part_n13@ds=2008-04-08
 POSTHOOK: Output: default@bucketmapjoin_tmp_result_n6
 OPTIMIZED SQL: SELECT `t0`.`key`, `t0`.`value`, `t2`.`value` AS `value1`
-FROM (SELECT `key`, `value`, CAST('2008-04-08' AS STRING) AS `ds`
+FROM (SELECT `key`, `value`
 FROM `default`.`srcbucket_mapjoin_part_2_n11`
 WHERE `ds` = '2008-04-08' AND `key` IS NOT NULL) AS `t0`
-INNER JOIN (SELECT `key`, `value`, CAST('2008-04-08' AS STRING) AS `ds`
+INNER JOIN (SELECT `key`, `value`
 FROM `default`.`srcbucket_mapjoin_part_n13`
 WHERE `ds` = '2008-04-08' AND `key` IS NOT NULL) AS `t2` ON `t0`.`key` = 
`t2`.`key`
 STAGE DEPENDENCIES:
@@ -775,11 +775,11 @@ STAGE PLANS:
                 keys:
                   0 _col0 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col0, _col1, _col4
+                outputColumnNames: _col0, _col1, _col3
                 Position of Big Table: 1
                 Statistics: Num rows: 156 Data size: 89111 Basic stats: 
PARTIAL Column stats: NONE
                 Select Operator
-                  expressions: CAST( _col0 AS STRING) (type: string), _col1 
(type: string), _col4 (type: string)
+                  expressions: CAST( _col0 AS STRING) (type: string), _col1 
(type: string), _col3 (type: string)
                   outputColumnNames: _col0, _col1, _col2
                   Statistics: Num rows: 156 Data size: 89111 Basic stats: 
PARTIAL Column stats: NONE
                   File Output Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/llap/bucketsortoptimize_insert_2.q.out
----------------------------------------------------------------------
diff --git 
a/ql/src/test/results/clientpositive/llap/bucketsortoptimize_insert_2.q.out 
b/ql/src/test/results/clientpositive/llap/bucketsortoptimize_insert_2.q.out
index acb1e87..8039d0f 100644
--- a/ql/src/test/results/clientpositive/llap/bucketsortoptimize_insert_2.q.out
+++ b/ql/src/test/results/clientpositive/llap/bucketsortoptimize_insert_2.q.out
@@ -125,7 +125,7 @@ STAGE PLANS:
                     Select Operator
                       expressions: key (type: int), value (type: string)
                       outputColumnNames: _col0, _col1
-                      Statistics: Num rows: 84 Data size: 15036 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 84 Data size: 7896 Basic stats: 
COMPLETE Column stats: COMPLETE
             Map Operator Tree:
                 TableScan
                   alias: a
@@ -137,17 +137,17 @@ STAGE PLANS:
                     Select Operator
                       expressions: key (type: int), value (type: string)
                       outputColumnNames: _col0, _col1
-                      Statistics: Num rows: 10 Data size: 1780 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 10 Data size: 930 Basic stats: 
COMPLETE Column stats: COMPLETE
                       Merge Join Operator
                         condition map:
                              Inner Join 0 to 1
                         keys:
                           0 _col0 (type: int)
                           1 _col0 (type: int)
-                        outputColumnNames: _col0, _col1, _col4
+                        outputColumnNames: _col0, _col1, _col3
                         Statistics: Num rows: 14 Data size: 2562 Basic stats: 
COMPLETE Column stats: COMPLETE
                         Select Operator
-                          expressions: _col0 (type: int), concat(_col1, _col4) 
(type: string)
+                          expressions: _col0 (type: int), concat(_col1, _col3) 
(type: string)
                           outputColumnNames: _col0, _col1
                           Statistics: Num rows: 14 Data size: 2632 Basic 
stats: COMPLETE Column stats: COMPLETE
                           Reduce Output Operator
@@ -347,7 +347,7 @@ STAGE PLANS:
                     Select Operator
                       expressions: key (type: int), value (type: string)
                       outputColumnNames: _col0, _col1
-                      Statistics: Num rows: 84 Data size: 15036 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 84 Data size: 7896 Basic stats: 
COMPLETE Column stats: COMPLETE
             Map Operator Tree:
                 TableScan
                   alias: a
@@ -359,17 +359,17 @@ STAGE PLANS:
                     Select Operator
                       expressions: key (type: int), value (type: string)
                       outputColumnNames: _col0, _col1
-                      Statistics: Num rows: 20 Data size: 5540 Basic stats: 
COMPLETE Column stats: PARTIAL
+                      Statistics: Num rows: 20 Data size: 1860 Basic stats: 
COMPLETE Column stats: PARTIAL
                       Merge Join Operator
                         condition map:
                              Inner Join 0 to 1
                         keys:
                           0 _col0 (type: int)
                           1 _col0 (type: int)
-                        outputColumnNames: _col0, _col1, _col4
+                        outputColumnNames: _col0, _col1, _col3
                         Statistics: Num rows: 29 Data size: 5307 Basic stats: 
COMPLETE Column stats: PARTIAL
                         Select Operator
-                          expressions: _col0 (type: int), concat(_col1, _col4) 
(type: string)
+                          expressions: _col0 (type: int), concat(_col1, _col3) 
(type: string)
                           outputColumnNames: _col0, _col1
                           Statistics: Num rows: 29 Data size: 5452 Basic 
stats: COMPLETE Column stats: PARTIAL
                           Reduce Output Operator
@@ -593,7 +593,7 @@ STAGE PLANS:
                     Select Operator
                       expressions: key (type: int), value (type: string)
                       outputColumnNames: _col0, _col1
-                      Statistics: Num rows: 168 Data size: 46704 Basic stats: 
COMPLETE Column stats: PARTIAL
+                      Statistics: Num rows: 168 Data size: 15792 Basic stats: 
COMPLETE Column stats: PARTIAL
             Map Operator Tree:
                 TableScan
                   alias: a
@@ -605,17 +605,17 @@ STAGE PLANS:
                     Select Operator
                       expressions: key (type: int), value (type: string)
                       outputColumnNames: _col0, _col1
-                      Statistics: Num rows: 10 Data size: 1780 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 10 Data size: 930 Basic stats: 
COMPLETE Column stats: COMPLETE
                       Merge Join Operator
                         condition map:
                              Inner Join 0 to 1
                         keys:
                           0 _col0 (type: int)
                           1 _col0 (type: int)
-                        outputColumnNames: _col0, _col1, _col4
+                        outputColumnNames: _col0, _col1, _col3
                         Statistics: Num rows: 29 Data size: 5307 Basic stats: 
COMPLETE Column stats: PARTIAL
                         Select Operator
-                          expressions: _col0 (type: int), concat(_col1, _col4) 
(type: string)
+                          expressions: _col0 (type: int), concat(_col1, _col3) 
(type: string)
                           outputColumnNames: _col0, _col1
                           Statistics: Num rows: 29 Data size: 5452 Basic 
stats: COMPLETE Column stats: PARTIAL
                           Reduce Output Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/llap/bucketsortoptimize_insert_6.q.out
----------------------------------------------------------------------
diff --git 
a/ql/src/test/results/clientpositive/llap/bucketsortoptimize_insert_6.q.out 
b/ql/src/test/results/clientpositive/llap/bucketsortoptimize_insert_6.q.out
index 28e43cf..ce2ba5f 100644
--- a/ql/src/test/results/clientpositive/llap/bucketsortoptimize_insert_6.q.out
+++ b/ql/src/test/results/clientpositive/llap/bucketsortoptimize_insert_6.q.out
@@ -87,45 +87,57 @@ STAGE PLANS:
     Tez
 #### A masked pattern was here ####
       Edges:
-        Reducer 2 <- Map 1 (SIMPLE_EDGE)
-        Reducer 3 <- Reducer 2 (SIMPLE_EDGE)
+        Map 2 <- Map 1 (CUSTOM_EDGE)
+        Reducer 3 <- Map 2 (SIMPLE_EDGE)
+        Reducer 4 <- Reducer 3 (SIMPLE_EDGE)
 #### A masked pattern was here ####
       Vertices:
         Map 1 
             Map Operator Tree:
                 TableScan
-                  alias: b
+                  alias: a
                   filterExpr: (key is not null and key2 is not null) (type: 
boolean)
-                  Statistics: Num rows: 84 Data size: 8232 Basic stats: 
COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
                   Filter Operator
                     predicate: (key is not null and key2 is not null) (type: 
boolean)
-                    Statistics: Num rows: 84 Data size: 8232 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: key (type: int), key2 (type: int), value 
(type: string)
                       outputColumnNames: _col0, _col1, _col2
-                      Statistics: Num rows: 84 Data size: 15372 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      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: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
+                        value expressions: _col2 (type: string)
+            Execution mode: llap
+            LLAP IO: no inputs
+        Map 2 
             Map Operator Tree:
                 TableScan
-                  alias: a
+                  alias: b
                   filterExpr: (key is not null and key2 is not null) (type: 
boolean)
-                  Statistics: Num rows: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 84 Data size: 8232 Basic stats: 
COMPLETE Column stats: COMPLETE
                   Filter Operator
                     predicate: (key is not null and key2 is not null) (type: 
boolean)
-                    Statistics: Num rows: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 84 Data size: 8232 Basic stats: 
COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: key (type: int), key2 (type: int), value 
(type: string)
                       outputColumnNames: _col0, _col1, _col2
-                      Statistics: Num rows: 10 Data size: 1820 Basic stats: 
COMPLETE Column stats: COMPLETE
-                      Merge Join Operator
+                      Statistics: Num rows: 84 Data size: 8232 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      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
+                        outputColumnNames: _col0, _col1, _col2, _col5
+                        input vertices:
+                          0 Map 1
                         Statistics: Num rows: 14 Data size: 2618 Basic stats: 
COMPLETE Column stats: COMPLETE
                         Select Operator
-                          expressions: _col0 (type: int), _col1 (type: int), 
concat(_col2, _col6) (type: string)
+                          expressions: _col0 (type: int), _col1 (type: int), 
concat(_col2, _col5) (type: string)
                           outputColumnNames: _col0, _col1, _col2
                           Statistics: Num rows: 14 Data size: 2688 Basic 
stats: COMPLETE Column stats: COMPLETE
                           Reduce Output Operator
@@ -135,7 +147,8 @@ STAGE PLANS:
                             Statistics: Num rows: 14 Data size: 2688 Basic 
stats: COMPLETE Column stats: COMPLETE
                             value expressions: _col2 (type: string)
             Execution mode: llap
-        Reducer 2 
+            LLAP IO: no inputs
+        Reducer 3 
             Execution mode: llap
             Reduce Operator Tree:
               Select Operator
@@ -166,7 +179,7 @@ STAGE PLANS:
                       Map-reduce partition columns: _col0 (type: string)
                       Statistics: Num rows: 1 Data size: 1373 Basic stats: 
COMPLETE Column stats: COMPLETE
                       value expressions: _col1 (type: 
struct<columntype:string,min:bigint,max:bigint,countnulls:bigint,bitvector:binary>),
 _col2 (type: 
struct<columntype:string,min:bigint,max:bigint,countnulls:bigint,bitvector:binary>),
 _col3 (type: 
struct<columntype:string,maxlength:bigint,sumlength:bigint,count:bigint,countnulls:bigint,bitvector:binary>)
-        Reducer 3 
+        Reducer 4 
             Execution mode: llap
             Reduce Operator Tree:
               Group By Operator
@@ -314,45 +327,57 @@ STAGE PLANS:
     Tez
 #### A masked pattern was here ####
       Edges:
-        Reducer 2 <- Map 1 (SIMPLE_EDGE)
-        Reducer 3 <- Reducer 2 (SIMPLE_EDGE)
+        Map 2 <- Map 1 (CUSTOM_EDGE)
+        Reducer 3 <- Map 2 (SIMPLE_EDGE)
+        Reducer 4 <- Reducer 3 (SIMPLE_EDGE)
 #### A masked pattern was here ####
       Vertices:
         Map 1 
             Map Operator Tree:
                 TableScan
-                  alias: b
+                  alias: a
                   filterExpr: (key is not null and key2 is not null) (type: 
boolean)
-                  Statistics: Num rows: 84 Data size: 8232 Basic stats: 
COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
                   Filter Operator
                     predicate: (key is not null and key2 is not null) (type: 
boolean)
-                    Statistics: Num rows: 84 Data size: 8232 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: key (type: int), key2 (type: int), value 
(type: string)
                       outputColumnNames: _col0, _col1, _col2
-                      Statistics: Num rows: 84 Data size: 15372 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      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: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
+                        value expressions: _col2 (type: string)
+            Execution mode: llap
+            LLAP IO: no inputs
+        Map 2 
             Map Operator Tree:
                 TableScan
-                  alias: a
+                  alias: b
                   filterExpr: (key is not null and key2 is not null) (type: 
boolean)
-                  Statistics: Num rows: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 84 Data size: 8232 Basic stats: 
COMPLETE Column stats: COMPLETE
                   Filter Operator
                     predicate: (key is not null and key2 is not null) (type: 
boolean)
-                    Statistics: Num rows: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 84 Data size: 8232 Basic stats: 
COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: key (type: int), key2 (type: int), value 
(type: string)
                       outputColumnNames: _col0, _col1, _col2
-                      Statistics: Num rows: 10 Data size: 1820 Basic stats: 
COMPLETE Column stats: COMPLETE
-                      Merge Join Operator
+                      Statistics: Num rows: 84 Data size: 8232 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      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
+                        outputColumnNames: _col0, _col1, _col2, _col5
+                        input vertices:
+                          0 Map 1
                         Statistics: Num rows: 14 Data size: 2618 Basic stats: 
COMPLETE Column stats: COMPLETE
                         Select Operator
-                          expressions: _col0 (type: int), _col1 (type: int), 
concat(_col2, _col6) (type: string)
+                          expressions: _col0 (type: int), _col1 (type: int), 
concat(_col2, _col5) (type: string)
                           outputColumnNames: _col0, _col1, _col2
                           Statistics: Num rows: 14 Data size: 2688 Basic 
stats: COMPLETE Column stats: COMPLETE
                           Reduce Output Operator
@@ -362,7 +387,8 @@ STAGE PLANS:
                             Statistics: Num rows: 14 Data size: 2688 Basic 
stats: COMPLETE Column stats: COMPLETE
                             value expressions: _col2 (type: string)
             Execution mode: llap
-        Reducer 2 
+            LLAP IO: no inputs
+        Reducer 3 
             Execution mode: llap
             Reduce Operator Tree:
               Select Operator
@@ -393,7 +419,7 @@ STAGE PLANS:
                       Map-reduce partition columns: _col0 (type: string)
                       Statistics: Num rows: 1 Data size: 1373 Basic stats: 
COMPLETE Column stats: COMPLETE
                       value expressions: _col1 (type: 
struct<columntype:string,min:bigint,max:bigint,countnulls:bigint,bitvector:binary>),
 _col2 (type: 
struct<columntype:string,min:bigint,max:bigint,countnulls:bigint,bitvector:binary>),
 _col3 (type: 
struct<columntype:string,maxlength:bigint,sumlength:bigint,count:bigint,countnulls:bigint,bitvector:binary>)
-        Reducer 3 
+        Reducer 4 
             Execution mode: llap
             Reduce Operator Tree:
               Group By Operator
@@ -541,45 +567,57 @@ STAGE PLANS:
     Tez
 #### A masked pattern was here ####
       Edges:
-        Reducer 2 <- Map 1 (SIMPLE_EDGE)
-        Reducer 3 <- Reducer 2 (SIMPLE_EDGE)
+        Map 2 <- Map 1 (CUSTOM_EDGE)
+        Reducer 3 <- Map 2 (SIMPLE_EDGE)
+        Reducer 4 <- Reducer 3 (SIMPLE_EDGE)
 #### A masked pattern was here ####
       Vertices:
         Map 1 
             Map Operator Tree:
                 TableScan
-                  alias: b
+                  alias: a
                   filterExpr: (key is not null and key2 is not null) (type: 
boolean)
-                  Statistics: Num rows: 84 Data size: 8232 Basic stats: 
COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
                   Filter Operator
                     predicate: (key is not null and key2 is not null) (type: 
boolean)
-                    Statistics: Num rows: 84 Data size: 8232 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: key (type: int), key2 (type: int), value 
(type: string)
                       outputColumnNames: _col0, _col1, _col2
-                      Statistics: Num rows: 84 Data size: 15372 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      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: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
+                        value expressions: _col2 (type: string)
+            Execution mode: llap
+            LLAP IO: no inputs
+        Map 2 
             Map Operator Tree:
                 TableScan
-                  alias: a
+                  alias: b
                   filterExpr: (key is not null and key2 is not null) (type: 
boolean)
-                  Statistics: Num rows: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 84 Data size: 8232 Basic stats: 
COMPLETE Column stats: COMPLETE
                   Filter Operator
                     predicate: (key is not null and key2 is not null) (type: 
boolean)
-                    Statistics: Num rows: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 84 Data size: 8232 Basic stats: 
COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: key (type: int), key2 (type: int), value 
(type: string)
                       outputColumnNames: _col0, _col1, _col2
-                      Statistics: Num rows: 10 Data size: 1820 Basic stats: 
COMPLETE Column stats: COMPLETE
-                      Merge Join Operator
+                      Statistics: Num rows: 84 Data size: 8232 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      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
+                        outputColumnNames: _col0, _col1, _col2, _col5
+                        input vertices:
+                          0 Map 1
                         Statistics: Num rows: 14 Data size: 2618 Basic stats: 
COMPLETE Column stats: COMPLETE
                         Select Operator
-                          expressions: _col1 (type: int), _col0 (type: int), 
concat(_col2, _col6) (type: string)
+                          expressions: _col1 (type: int), _col0 (type: int), 
concat(_col2, _col5) (type: string)
                           outputColumnNames: _col0, _col1, _col2
                           Statistics: Num rows: 14 Data size: 2688 Basic 
stats: COMPLETE Column stats: COMPLETE
                           Reduce Output Operator
@@ -589,7 +627,8 @@ STAGE PLANS:
                             Statistics: Num rows: 14 Data size: 2688 Basic 
stats: COMPLETE Column stats: COMPLETE
                             value expressions: _col2 (type: string)
             Execution mode: llap
-        Reducer 2 
+            LLAP IO: no inputs
+        Reducer 3 
             Execution mode: llap
             Reduce Operator Tree:
               Select Operator
@@ -620,7 +659,7 @@ STAGE PLANS:
                       Map-reduce partition columns: _col0 (type: string)
                       Statistics: Num rows: 1 Data size: 1373 Basic stats: 
COMPLETE Column stats: COMPLETE
                       value expressions: _col1 (type: 
struct<columntype:string,min:bigint,max:bigint,countnulls:bigint,bitvector:binary>),
 _col2 (type: 
struct<columntype:string,min:bigint,max:bigint,countnulls:bigint,bitvector:binary>),
 _col3 (type: 
struct<columntype:string,maxlength:bigint,sumlength:bigint,count:bigint,countnulls:bigint,bitvector:binary>)
-        Reducer 3 
+        Reducer 4 
             Execution mode: llap
             Reduce Operator Tree:
               Group By Operator
@@ -703,45 +742,57 @@ STAGE PLANS:
     Tez
 #### A masked pattern was here ####
       Edges:
-        Reducer 2 <- Map 1 (SIMPLE_EDGE)
-        Reducer 3 <- Reducer 2 (SIMPLE_EDGE)
+        Map 2 <- Map 1 (CUSTOM_EDGE)
+        Reducer 3 <- Map 2 (SIMPLE_EDGE)
+        Reducer 4 <- Reducer 3 (SIMPLE_EDGE)
 #### A masked pattern was here ####
       Vertices:
         Map 1 
             Map Operator Tree:
                 TableScan
-                  alias: b
+                  alias: a
                   filterExpr: (key is not null and key2 is not null) (type: 
boolean)
-                  Statistics: Num rows: 84 Data size: 8232 Basic stats: 
COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
                   Filter Operator
                     predicate: (key is not null and key2 is not null) (type: 
boolean)
-                    Statistics: Num rows: 84 Data size: 8232 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: key (type: int), key2 (type: int), value 
(type: string)
                       outputColumnNames: _col0, _col1, _col2
-                      Statistics: Num rows: 84 Data size: 15372 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      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: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
+                        value expressions: _col2 (type: string)
+            Execution mode: llap
+            LLAP IO: no inputs
+        Map 2 
             Map Operator Tree:
                 TableScan
-                  alias: a
+                  alias: b
                   filterExpr: (key is not null and key2 is not null) (type: 
boolean)
-                  Statistics: Num rows: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 84 Data size: 8232 Basic stats: 
COMPLETE Column stats: COMPLETE
                   Filter Operator
                     predicate: (key is not null and key2 is not null) (type: 
boolean)
-                    Statistics: Num rows: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 84 Data size: 8232 Basic stats: 
COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: key (type: int), key2 (type: int), value 
(type: string)
                       outputColumnNames: _col0, _col1, _col2
-                      Statistics: Num rows: 10 Data size: 1820 Basic stats: 
COMPLETE Column stats: COMPLETE
-                      Merge Join Operator
+                      Statistics: Num rows: 84 Data size: 8232 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      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
+                        outputColumnNames: _col0, _col1, _col2, _col5
+                        input vertices:
+                          0 Map 1
                         Statistics: Num rows: 14 Data size: 2618 Basic stats: 
COMPLETE Column stats: COMPLETE
                         Select Operator
-                          expressions: _col1 (type: int), _col0 (type: int), 
concat(_col2, _col6) (type: string)
+                          expressions: _col1 (type: int), _col0 (type: int), 
concat(_col2, _col5) (type: string)
                           outputColumnNames: _col0, _col1, _col2
                           Statistics: Num rows: 14 Data size: 2688 Basic 
stats: COMPLETE Column stats: COMPLETE
                           Reduce Output Operator
@@ -751,7 +802,8 @@ STAGE PLANS:
                             Statistics: Num rows: 14 Data size: 2688 Basic 
stats: COMPLETE Column stats: COMPLETE
                             value expressions: _col2 (type: string)
             Execution mode: llap
-        Reducer 2 
+            LLAP IO: no inputs
+        Reducer 3 
             Execution mode: llap
             Reduce Operator Tree:
               Select Operator
@@ -782,7 +834,7 @@ STAGE PLANS:
                       Map-reduce partition columns: _col0 (type: string)
                       Statistics: Num rows: 1 Data size: 1373 Basic stats: 
COMPLETE Column stats: COMPLETE
                       value expressions: _col1 (type: 
struct<columntype:string,min:bigint,max:bigint,countnulls:bigint,bitvector:binary>),
 _col2 (type: 
struct<columntype:string,min:bigint,max:bigint,countnulls:bigint,bitvector:binary>),
 _col3 (type: 
struct<columntype:string,maxlength:bigint,sumlength:bigint,count:bigint,countnulls:bigint,bitvector:binary>)
-        Reducer 3 
+        Reducer 4 
             Execution mode: llap
             Reduce Operator Tree:
               Group By Operator
@@ -871,45 +923,57 @@ STAGE PLANS:
     Tez
 #### A masked pattern was here ####
       Edges:
-        Reducer 2 <- Map 1 (SIMPLE_EDGE)
-        Reducer 3 <- Reducer 2 (SIMPLE_EDGE)
+        Map 2 <- Map 1 (CUSTOM_EDGE)
+        Reducer 3 <- Map 2 (SIMPLE_EDGE)
+        Reducer 4 <- Reducer 3 (SIMPLE_EDGE)
 #### A masked pattern was here ####
       Vertices:
         Map 1 
             Map Operator Tree:
                 TableScan
-                  alias: b
+                  alias: a
                   filterExpr: (key is not null and key2 is not null) (type: 
boolean)
-                  Statistics: Num rows: 84 Data size: 8232 Basic stats: 
COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
                   Filter Operator
                     predicate: (key is not null and key2 is not null) (type: 
boolean)
-                    Statistics: Num rows: 84 Data size: 8232 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: key (type: int), key2 (type: int), value 
(type: string)
                       outputColumnNames: _col0, _col1, _col2
-                      Statistics: Num rows: 84 Data size: 15372 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      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: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
+                        value expressions: _col2 (type: string)
+            Execution mode: llap
+            LLAP IO: no inputs
+        Map 2 
             Map Operator Tree:
                 TableScan
-                  alias: a
+                  alias: b
                   filterExpr: (key is not null and key2 is not null) (type: 
boolean)
-                  Statistics: Num rows: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 84 Data size: 8232 Basic stats: 
COMPLETE Column stats: COMPLETE
                   Filter Operator
                     predicate: (key is not null and key2 is not null) (type: 
boolean)
-                    Statistics: Num rows: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 84 Data size: 8232 Basic stats: 
COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: key (type: int), key2 (type: int), value 
(type: string)
                       outputColumnNames: _col0, _col1, _col2
-                      Statistics: Num rows: 10 Data size: 1820 Basic stats: 
COMPLETE Column stats: COMPLETE
-                      Merge Join Operator
+                      Statistics: Num rows: 84 Data size: 8232 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      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
+                        outputColumnNames: _col0, _col1, _col2, _col5
+                        input vertices:
+                          0 Map 1
                         Statistics: Num rows: 14 Data size: 2618 Basic stats: 
COMPLETE Column stats: COMPLETE
                         Select Operator
-                          expressions: _col0 (type: int), _col1 (type: int), 
concat(_col2, _col6) (type: string)
+                          expressions: _col0 (type: int), _col1 (type: int), 
concat(_col2, _col5) (type: string)
                           outputColumnNames: _col0, _col1, _col2
                           Statistics: Num rows: 14 Data size: 2688 Basic 
stats: COMPLETE Column stats: COMPLETE
                           Reduce Output Operator
@@ -919,7 +983,8 @@ STAGE PLANS:
                             Statistics: Num rows: 14 Data size: 2688 Basic 
stats: COMPLETE Column stats: COMPLETE
                             value expressions: _col2 (type: string)
             Execution mode: llap
-        Reducer 2 
+            LLAP IO: no inputs
+        Reducer 3 
             Execution mode: llap
             Reduce Operator Tree:
               Select Operator
@@ -950,7 +1015,7 @@ STAGE PLANS:
                       Map-reduce partition columns: _col0 (type: string)
                       Statistics: Num rows: 1 Data size: 1373 Basic stats: 
COMPLETE Column stats: COMPLETE
                       value expressions: _col1 (type: 
struct<columntype:string,min:bigint,max:bigint,countnulls:bigint,bitvector:binary>),
 _col2 (type: 
struct<columntype:string,min:bigint,max:bigint,countnulls:bigint,bitvector:binary>),
 _col3 (type: 
struct<columntype:string,maxlength:bigint,sumlength:bigint,count:bigint,countnulls:bigint,bitvector:binary>)
-        Reducer 3 
+        Reducer 4 
             Execution mode: llap
             Reduce Operator Tree:
               Group By Operator
@@ -1116,45 +1181,57 @@ STAGE PLANS:
     Tez
 #### A masked pattern was here ####
       Edges:
-        Reducer 2 <- Map 1 (SIMPLE_EDGE)
-        Reducer 3 <- Reducer 2 (SIMPLE_EDGE)
+        Map 2 <- Map 1 (CUSTOM_EDGE)
+        Reducer 3 <- Map 2 (SIMPLE_EDGE)
+        Reducer 4 <- Reducer 3 (SIMPLE_EDGE)
 #### A masked pattern was here ####
       Vertices:
         Map 1 
             Map Operator Tree:
                 TableScan
-                  alias: b
+                  alias: a
                   filterExpr: (key is not null and key2 is not null) (type: 
boolean)
-                  Statistics: Num rows: 84 Data size: 8232 Basic stats: 
COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
                   Filter Operator
                     predicate: (key is not null and key2 is not null) (type: 
boolean)
-                    Statistics: Num rows: 84 Data size: 8232 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: key (type: int), key2 (type: int), value 
(type: string)
                       outputColumnNames: _col0, _col1, _col2
-                      Statistics: Num rows: 84 Data size: 15372 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      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: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
+                        value expressions: _col2 (type: string)
+            Execution mode: llap
+            LLAP IO: no inputs
+        Map 2 
             Map Operator Tree:
                 TableScan
-                  alias: a
+                  alias: b
                   filterExpr: (key is not null and key2 is not null) (type: 
boolean)
-                  Statistics: Num rows: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 84 Data size: 8232 Basic stats: 
COMPLETE Column stats: COMPLETE
                   Filter Operator
                     predicate: (key is not null and key2 is not null) (type: 
boolean)
-                    Statistics: Num rows: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 84 Data size: 8232 Basic stats: 
COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: key (type: int), key2 (type: int), value 
(type: string)
                       outputColumnNames: _col0, _col1, _col2
-                      Statistics: Num rows: 10 Data size: 1820 Basic stats: 
COMPLETE Column stats: COMPLETE
-                      Merge Join Operator
+                      Statistics: Num rows: 84 Data size: 8232 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      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
+                        outputColumnNames: _col0, _col1, _col2, _col5
+                        input vertices:
+                          0 Map 1
                         Statistics: Num rows: 14 Data size: 2618 Basic stats: 
COMPLETE Column stats: COMPLETE
                         Select Operator
-                          expressions: _col0 (type: int), _col1 (type: int), 
concat(_col2, _col6) (type: string)
+                          expressions: _col0 (type: int), _col1 (type: int), 
concat(_col2, _col5) (type: string)
                           outputColumnNames: _col0, _col1, _col2
                           Statistics: Num rows: 14 Data size: 2688 Basic 
stats: COMPLETE Column stats: COMPLETE
                           Reduce Output Operator
@@ -1164,7 +1241,8 @@ STAGE PLANS:
                             Statistics: Num rows: 14 Data size: 2688 Basic 
stats: COMPLETE Column stats: COMPLETE
                             value expressions: _col2 (type: string)
             Execution mode: llap
-        Reducer 2 
+            LLAP IO: no inputs
+        Reducer 3 
             Execution mode: llap
             Reduce Operator Tree:
               Select Operator
@@ -1195,7 +1273,7 @@ STAGE PLANS:
                       Map-reduce partition columns: _col0 (type: string)
                       Statistics: Num rows: 1 Data size: 1373 Basic stats: 
COMPLETE Column stats: COMPLETE
                       value expressions: _col1 (type: 
struct<columntype:string,min:bigint,max:bigint,countnulls:bigint,bitvector:binary>),
 _col2 (type: 
struct<columntype:string,min:bigint,max:bigint,countnulls:bigint,bitvector:binary>),
 _col3 (type: 
struct<columntype:string,maxlength:bigint,sumlength:bigint,count:bigint,countnulls:bigint,bitvector:binary>)
-        Reducer 3 
+        Reducer 4 
             Execution mode: llap
             Reduce Operator Tree:
               Group By Operator
@@ -1371,45 +1449,57 @@ STAGE PLANS:
     Tez
 #### A masked pattern was here ####
       Edges:
-        Reducer 2 <- Map 1 (SIMPLE_EDGE)
-        Reducer 3 <- Reducer 2 (SIMPLE_EDGE)
+        Map 2 <- Map 1 (CUSTOM_EDGE)
+        Reducer 3 <- Map 2 (SIMPLE_EDGE)
+        Reducer 4 <- Reducer 3 (SIMPLE_EDGE)
 #### A masked pattern was here ####
       Vertices:
         Map 1 
             Map Operator Tree:
                 TableScan
-                  alias: b
+                  alias: a
                   filterExpr: (key is not null and key2 is not null) (type: 
boolean)
-                  Statistics: Num rows: 84 Data size: 8232 Basic stats: 
COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
                   Filter Operator
                     predicate: (key is not null and key2 is not null) (type: 
boolean)
-                    Statistics: Num rows: 84 Data size: 8232 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: key (type: int), key2 (type: int), value 
(type: string)
                       outputColumnNames: _col0, _col1, _col2
-                      Statistics: Num rows: 84 Data size: 15372 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      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: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
+                        value expressions: _col2 (type: string)
+            Execution mode: llap
+            LLAP IO: no inputs
+        Map 2 
             Map Operator Tree:
                 TableScan
-                  alias: a
+                  alias: b
                   filterExpr: (key is not null and key2 is not null) (type: 
boolean)
-                  Statistics: Num rows: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 84 Data size: 8232 Basic stats: 
COMPLETE Column stats: COMPLETE
                   Filter Operator
                     predicate: (key is not null and key2 is not null) (type: 
boolean)
-                    Statistics: Num rows: 10 Data size: 970 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 84 Data size: 8232 Basic stats: 
COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: key (type: int), key2 (type: int), value 
(type: string)
                       outputColumnNames: _col0, _col1, _col2
-                      Statistics: Num rows: 10 Data size: 1820 Basic stats: 
COMPLETE Column stats: COMPLETE
-                      Merge Join Operator
+                      Statistics: Num rows: 84 Data size: 8232 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      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
+                        outputColumnNames: _col0, _col1, _col2, _col5
+                        input vertices:
+                          0 Map 1
                         Statistics: Num rows: 14 Data size: 2618 Basic stats: 
COMPLETE Column stats: COMPLETE
                         Select Operator
-                          expressions: _col0 (type: int), _col1 (type: int), 
concat(_col2, _col6) (type: string)
+                          expressions: _col0 (type: int), _col1 (type: int), 
concat(_col2, _col5) (type: string)
                           outputColumnNames: _col0, _col1, _col2
                           Statistics: Num rows: 14 Data size: 2688 Basic 
stats: COMPLETE Column stats: COMPLETE
                           Reduce Output Operator
@@ -1419,7 +1509,8 @@ STAGE PLANS:
                             Statistics: Num rows: 14 Data size: 2688 Basic 
stats: COMPLETE Column stats: COMPLETE
                             value expressions: _col2 (type: string)
             Execution mode: llap
-        Reducer 2 
+            LLAP IO: no inputs
+        Reducer 3 
             Execution mode: llap
             Reduce Operator Tree:
               Select Operator
@@ -1450,7 +1541,7 @@ STAGE PLANS:
                       Map-reduce partition columns: _col0 (type: string)
                       Statistics: Num rows: 1 Data size: 1373 Basic stats: 
COMPLETE Column stats: COMPLETE
                       value expressions: _col1 (type: 
struct<columntype:string,min:bigint,max:bigint,countnulls:bigint,bitvector:binary>),
 _col2 (type: 
struct<columntype:string,min:bigint,max:bigint,countnulls:bigint,bitvector:binary>),
 _col3 (type: 
struct<columntype:string,maxlength:bigint,sumlength:bigint,count:bigint,countnulls:bigint,bitvector:binary>)
-        Reducer 3 
+        Reducer 4 
             Execution mode: llap
             Reduce Operator Tree:
               Group By Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/llap/bucketsortoptimize_insert_7.q.out
----------------------------------------------------------------------
diff --git 
a/ql/src/test/results/clientpositive/llap/bucketsortoptimize_insert_7.q.out 
b/ql/src/test/results/clientpositive/llap/bucketsortoptimize_insert_7.q.out
index afd2975..11de705 100644
--- a/ql/src/test/results/clientpositive/llap/bucketsortoptimize_insert_7.q.out
+++ b/ql/src/test/results/clientpositive/llap/bucketsortoptimize_insert_7.q.out
@@ -103,7 +103,7 @@ STAGE PLANS:
                     Select Operator
                       expressions: key (type: int), value (type: string)
                       outputColumnNames: _col0, _col1
-                      Statistics: Num rows: 3 Data size: 537 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 3 Data size: 282 Basic stats: 
COMPLETE Column stats: COMPLETE
             Map Operator Tree:
                 TableScan
                   alias: a
@@ -115,17 +115,17 @@ STAGE PLANS:
                     Select Operator
                       expressions: key (type: int), value (type: string)
                       outputColumnNames: _col0, _col1
-                      Statistics: Num rows: 3 Data size: 534 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 3 Data size: 279 Basic stats: 
COMPLETE Column stats: COMPLETE
                       Merge Join Operator
                         condition map:
                              Inner Join 0 to 1
                         keys:
                           0 _col0 (type: int)
                           1 _col0 (type: int)
-                        outputColumnNames: _col0, _col1, _col4
+                        outputColumnNames: _col0, _col1, _col3
                         Statistics: Num rows: 3 Data size: 549 Basic stats: 
COMPLETE Column stats: COMPLETE
                         Select Operator
-                          expressions: _col0 (type: int), concat(_col1, _col4) 
(type: string)
+                          expressions: _col0 (type: int), concat(_col1, _col3) 
(type: string)
                           outputColumnNames: _col0, _col1
                           Statistics: Num rows: 3 Data size: 564 Basic stats: 
COMPLETE Column stats: COMPLETE
                           Reduce Output Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/llap/check_constraint.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/check_constraint.q.out 
b/ql/src/test/results/clientpositive/llap/check_constraint.q.out
index 7273680..2b15648 100644
--- a/ql/src/test/results/clientpositive/llap/check_constraint.q.out
+++ b/ql/src/test/results/clientpositive/llap/check_constraint.q.out
@@ -1548,15 +1548,15 @@ STAGE PLANS:
                     predicate: (value > 'val') (type: boolean)
                     Statistics: Num rows: 166 Data size: 29548 Basic stats: 
COMPLETE Column stats: COMPLETE
                     Select Operator
-                      expressions: key (type: string), value (type: string)
-                      outputColumnNames: _col0, _col1
-                      Statistics: Num rows: 166 Data size: 29548 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      expressions: key (type: string), value (type: string), 
UDFToInteger(key) (type: int)
+                      outputColumnNames: _col0, _col1, _col2
+                      Statistics: Num rows: 166 Data size: 30212 Basic stats: 
COMPLETE Column stats: COMPLETE
                       Reduce Output Operator
                         key expressions: _col0 (type: string)
                         sort order: +
                         Map-reduce partition columns: _col0 (type: string)
-                        Statistics: Num rows: 166 Data size: 29548 Basic 
stats: COMPLETE Column stats: COMPLETE
-                        value expressions: _col1 (type: string)
+                        Statistics: Num rows: 166 Data size: 30212 Basic 
stats: COMPLETE Column stats: COMPLETE
+                        value expressions: _col1 (type: string), _col2 (type: 
int)
             Execution mode: vectorized, llap
             LLAP IO: no inputs
         Map 5 
@@ -1565,14 +1565,15 @@ STAGE PLANS:
                   alias: s2
                   Statistics: Num rows: 500 Data size: 43500 Basic stats: 
COMPLETE Column stats: COMPLETE
                   Select Operator
-                    expressions: key (type: string)
-                    outputColumnNames: _col0
-                    Statistics: Num rows: 500 Data size: 43500 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    expressions: key (type: string), CAST( key AS 
decimal(5,2)) (type: decimal(5,2))
+                    outputColumnNames: _col0, _col1
+                    Statistics: Num rows: 500 Data size: 99500 Basic stats: 
COMPLETE Column stats: COMPLETE
                     Reduce Output Operator
                       key expressions: _col0 (type: string)
                       sort order: +
                       Map-reduce partition columns: _col0 (type: string)
-                      Statistics: Num rows: 500 Data size: 43500 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 500 Data size: 99500 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      value expressions: _col1 (type: decimal(5,2))
             Execution mode: vectorized, llap
             LLAP IO: no inputs
         Reducer 2 
@@ -1584,18 +1585,18 @@ STAGE PLANS:
                 keys:
                   0 _col0 (type: string)
                   1 _col0 (type: string)
-                outputColumnNames: _col0, _col1, _col2
-                Statistics: Num rows: 428 Data size: 99065 Basic stats: 
COMPLETE Column stats: COMPLETE
+                outputColumnNames: _col1, _col2, _col4
+                Statistics: Num rows: 412 Data size: 68596 Basic stats: 
COMPLETE Column stats: COMPLETE
                 Select Operator
-                  expressions: UDFToInteger(_col0) (type: int), CAST( _col2 AS 
decimal(5,2)) (type: decimal(5,2)), _col1 (type: string)
+                  expressions: _col2 (type: int), _col4 (type: decimal(5,2)), 
_col1 (type: string)
                   outputColumnNames: _col0, _col1, _col2
-                  Statistics: Num rows: 428 Data size: 88596 Basic stats: 
COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 412 Data size: 68596 Basic stats: 
COMPLETE Column stats: COMPLETE
                   Limit
                     Number of rows: 10
-                    Statistics: Num rows: 10 Data size: 2070 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 10 Data size: 1734 Basic stats: 
COMPLETE Column stats: COMPLETE
                     Reduce Output Operator
                       sort order: 
-                      Statistics: Num rows: 10 Data size: 2070 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 10 Data size: 1734 Basic stats: 
COMPLETE Column stats: COMPLETE
                       TopN Hash Memory Usage: 0.1
                       value expressions: _col0 (type: int), _col1 (type: 
decimal(5,2)), _col2 (type: string)
         Reducer 3 
@@ -1604,17 +1605,17 @@ STAGE PLANS:
               Select Operator
                 expressions: VALUE._col0 (type: int), VALUE._col1 (type: 
decimal(5,2)), VALUE._col2 (type: string)
                 outputColumnNames: _col0, _col1, _col2
-                Statistics: Num rows: 10 Data size: 2070 Basic stats: COMPLETE 
Column stats: COMPLETE
+                Statistics: Num rows: 10 Data size: 1734 Basic stats: COMPLETE 
Column stats: COMPLETE
                 Limit
                   Number of rows: 10
-                  Statistics: Num rows: 10 Data size: 2070 Basic stats: 
COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 10 Data size: 1734 Basic stats: 
COMPLETE Column stats: COMPLETE
                   Filter Operator
                     predicate: enforce_constraint((_col1 is not null and 
(_col1 >= CAST( _col0 AS decimal(5,2))) is not false)) (type: boolean)
-                    Statistics: Num rows: 5 Data size: 1035 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 5 Data size: 923 Basic stats: 
COMPLETE Column stats: COMPLETE
                     Reduce Output Operator
                       sort order: 
                       Map-reduce partition columns: _col0 (type: int)
-                      Statistics: Num rows: 5 Data size: 1035 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 5 Data size: 923 Basic stats: 
COMPLETE Column stats: COMPLETE
                       value expressions: _col0 (type: int), _col1 (type: 
decimal(5,2)), _col2 (type: string)
         Reducer 4 
             Execution mode: vectorized, llap
@@ -1622,10 +1623,10 @@ STAGE PLANS:
               Select Operator
                 expressions: VALUE._col0 (type: int), VALUE._col1 (type: 
decimal(5,2)), CAST( VALUE._col2 AS varchar(128)) (type: varchar(128))
                 outputColumnNames: _col0, _col1, _col2
-                Statistics: Num rows: 5 Data size: 1640 Basic stats: COMPLETE 
Column stats: COMPLETE
+                Statistics: Num rows: 5 Data size: 1528 Basic stats: COMPLETE 
Column stats: COMPLETE
                 File Output Operator
                   compressed: false
-                  Statistics: Num rows: 5 Data size: 1640 Basic stats: 
COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 5 Data size: 1528 Basic stats: 
COMPLETE Column stats: COMPLETE
                   table:
                       input format: 
org.apache.hadoop.hive.ql.io.orc.OrcInputFormat
                       output format: 
org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/llap/constprog_semijoin.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/constprog_semijoin.q.out 
b/ql/src/test/results/clientpositive/llap/constprog_semijoin.q.out
index 54a73cd..ea46b72 100644
--- a/ql/src/test/results/clientpositive/llap/constprog_semijoin.q.out
+++ b/ql/src/test/results/clientpositive/llap/constprog_semijoin.q.out
@@ -205,52 +205,52 @@ POSTHOOK: Input: default@table3_n0
 Plan optimized by CBO.
 
 Vertex dependency in root stage
-Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 4 (SIMPLE_EDGE)
-Reducer 3 <- Map 5 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE)
+Reducer 4 <- Map 3 (SIMPLE_EDGE), Map 5 (SIMPLE_EDGE)
 
 Stage-0
   Fetch Operator
     limit:-1
     Stage-1
-      Reducer 3 llap
-      File Output Operator [FS_18]
-        Select Operator [SEL_17] (rows=2 width=187)
+      Reducer 2 llap
+      File Output Operator [FS_19]
+        Select Operator [SEL_18] (rows=2 width=187)
           Output:["_col0","_col1","_col2"]
-          Merge Join Operator [MERGEJOIN_48] (rows=2 width=96)
-            Conds:RS_14._col0=RS_58._col0(Inner),Output:["_col0","_col4"]
-          <-Map 5 [SIMPLE_EDGE] vectorized, llap
-            SHUFFLE [RS_58]
+          Merge Join Operator [MERGEJOIN_49] (rows=2 width=96)
+            Conds:RS_52._col0=RS_16._col0(Inner),Output:["_col1","_col2"]
+          <-Map 1 [SIMPLE_EDGE] vectorized, llap
+            SHUFFLE [RS_52]
               PartitionCols:_col0
-              Select Operator [SEL_57] (rows=3 width=96)
+              Select Operator [SEL_51] (rows=3 width=96)
                 Output:["_col0","_col1"]
-                Filter Operator [FIL_56] (rows=3 width=96)
+                Filter Operator [FIL_50] (rows=3 width=96)
                   predicate:id is not null
-                  TableScan [TS_6] (rows=3 width=96)
+                  TableScan [TS_0] (rows=3 width=96)
                     
default@table2_n6,table2_n6,Tbl:COMPLETE,Col:COMPLETE,Output:["id","val2"]
-          <-Reducer 2 [SIMPLE_EDGE] llap
-            SHUFFLE [RS_14]
+          <-Reducer 4 [SIMPLE_EDGE] llap
+            SHUFFLE [RS_16]
               PartitionCols:_col0
-              Merge Join Operator [MERGEJOIN_47] (rows=2 width=4)
-                Conds:RS_51._col2=RS_55._col0(Left Semi),Output:["_col0"]
-              <-Map 1 [SIMPLE_EDGE] vectorized, llap
-                SHUFFLE [RS_51]
+              Merge Join Operator [MERGEJOIN_48] (rows=2 width=4)
+                Conds:RS_55._col2=RS_59._col0(Left Semi),Output:["_col0"]
+              <-Map 3 [SIMPLE_EDGE] vectorized, llap
+                SHUFFLE [RS_55]
                   PartitionCols:_col2
-                  Select Operator [SEL_50] (rows=2 width=99)
+                  Select Operator [SEL_54] (rows=2 width=99)
                     Output:["_col0","_col2"]
-                    Filter Operator [FIL_49] (rows=2 width=99)
+                    Filter Operator [FIL_53] (rows=2 width=99)
                       predicate:((val = 't1val01') and dimid is not null and 
id is not null)
-                      TableScan [TS_0] (rows=10 width=99)
+                      TableScan [TS_3] (rows=10 width=99)
                         
default@table1_n10,table1_n10,Tbl:COMPLETE,Col:COMPLETE,Output:["id","val","dimid"]
-              <-Map 4 [SIMPLE_EDGE] vectorized, llap
-                SHUFFLE [RS_55]
+              <-Map 5 [SIMPLE_EDGE] vectorized, llap
+                SHUFFLE [RS_59]
                   PartitionCols:_col0
-                  Group By Operator [GBY_54] (rows=2 width=4)
+                  Group By Operator [GBY_58] (rows=2 width=4)
                     Output:["_col0"],keys:_col0
-                    Select Operator [SEL_53] (rows=5 width=4)
+                    Select Operator [SEL_57] (rows=5 width=4)
                       Output:["_col0"]
-                      Filter Operator [FIL_52] (rows=5 width=4)
+                      Filter Operator [FIL_56] (rows=5 width=4)
                         predicate:id is not null
-                        TableScan [TS_3] (rows=5 width=4)
+                        TableScan [TS_6] (rows=5 width=4)
                           
default@table3_n0,table3_n0,Tbl:COMPLETE,Col:COMPLETE,Output:["id"]
 
 PREHOOK: query: select table1_n10.id, table1_n10.val, table2_n6.val2 from 
table1_n10 left semi join table3_n0 on table1_n10.dimid = table3_n0.id inner 
join table2_n6 on table1_n10.val = 't1val01' and table1_n10.id = table2_n6.id

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/llap/constraints_optimization.q.out
----------------------------------------------------------------------
diff --git 
a/ql/src/test/results/clientpositive/llap/constraints_optimization.q.out 
b/ql/src/test/results/clientpositive/llap/constraints_optimization.q.out
index 23bab34..bf60646 100644
--- a/ql/src/test/results/clientpositive/llap/constraints_optimization.q.out
+++ b/ql/src/test/results/clientpositive/llap/constraints_optimization.q.out
@@ -1103,12 +1103,12 @@ STAGE PLANS:
                     Select Operator
                       expressions: key1 (type: int)
                       outputColumnNames: _col0
-                      Statistics: Num rows: 2 Data size: 24 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 2 Data size: 8 Basic stats: 
COMPLETE Column stats: COMPLETE
                       Reduce Output Operator
                         key expressions: _col0 (type: int)
                         sort order: +
                         Map-reduce partition columns: _col0 (type: int)
-                        Statistics: Num rows: 2 Data size: 24 Basic stats: 
COMPLETE Column stats: COMPLETE
+                        Statistics: Num rows: 2 Data size: 8 Basic stats: 
COMPLETE Column stats: COMPLETE
             Execution mode: vectorized, llap
             LLAP IO: no inputs
         Reducer 2 
@@ -1194,12 +1194,12 @@ STAGE PLANS:
                     Select Operator
                       expressions: key1 (type: int)
                       outputColumnNames: _col0
-                      Statistics: Num rows: 2 Data size: 24 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 2 Data size: 8 Basic stats: 
COMPLETE Column stats: COMPLETE
                       Reduce Output Operator
                         key expressions: _col0 (type: int)
                         sort order: +
                         Map-reduce partition columns: _col0 (type: int)
-                        Statistics: Num rows: 2 Data size: 24 Basic stats: 
COMPLETE Column stats: COMPLETE
+                        Statistics: Num rows: 2 Data size: 8 Basic stats: 
COMPLETE Column stats: COMPLETE
             Execution mode: vectorized, llap
             LLAP IO: no inputs
         Reducer 2 

Reply via email to