http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/join_filters_overlap.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/join_filters_overlap.q.out 
b/ql/src/test/results/clientpositive/join_filters_overlap.q.out
index 7b5c9f2..847b45d 100644
--- a/ql/src/test/results/clientpositive/join_filters_overlap.q.out
+++ b/ql/src/test/results/clientpositive/join_filters_overlap.q.out
@@ -18,15 +18,6 @@ POSTHOOK: query: explain extended select * from a_n4 left 
outer join a_n4 b on (
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@a_n4
 #### A masked pattern was here ####
-OPTIMIZED SQL: SELECT *
-FROM (SELECT `key`, `value`
-FROM `default`.`a_n4`) AS `t`
-LEFT JOIN (SELECT `key`, CAST(50 AS INTEGER) AS `value`
-FROM `default`.`a_n4`
-WHERE `value` = 50) AS `t1` ON `t`.`key` = `t1`.`key` AND `t`.`value` = 50
-LEFT JOIN (SELECT `key`, CAST(60 AS INTEGER) AS `value`
-FROM `default`.`a_n4`
-WHERE `value` = 60) AS `t3` ON `t`.`key` = `t3`.`key` AND `t`.`value` = 60
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
   Stage-0 depends on stages: Stage-1
@@ -40,8 +31,8 @@ STAGE PLANS:
             Statistics: Num rows: 3 Data size: 18 Basic stats: COMPLETE Column 
stats: NONE
             GatherStats: false
             Select Operator
-              expressions: key (type: int), value (type: int)
-              outputColumnNames: _col0, _col1
+              expressions: key (type: int), value (type: int), (value = 60) 
(type: boolean), (value = 50) (type: boolean)
+              outputColumnNames: _col0, _col1, _col2, _col3
               Statistics: Num rows: 3 Data size: 18 Basic stats: COMPLETE 
Column stats: NONE
               Reduce Output Operator
                 key expressions: _col0 (type: int)
@@ -50,7 +41,7 @@ STAGE PLANS:
                 Map-reduce partition columns: _col0 (type: int)
                 Statistics: Num rows: 3 Data size: 18 Basic stats: COMPLETE 
Column stats: NONE
                 tag: 0
-                value expressions: _col1 (type: int)
+                value expressions: _col1 (type: int), _col2 (type: boolean), 
_col3 (type: boolean)
                 auto parallelism: false
           TableScan
             alias: b
@@ -158,37 +149,41 @@ STAGE PLANS:
           filter mappings:
             0 [1, 1, 2, 1]
           filter predicates:
-            0 {(VALUE._col0 = 50)} {(VALUE._col0 = 60)}
+            0 {VALUE._col2} {VALUE._col1}
             1 
             2 
           keys:
             0 _col0 (type: int)
             1 _col0 (type: int)
             2 _col0 (type: int)
-          outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
+          outputColumnNames: _col0, _col1, _col4, _col5, _col6, _col7
           Statistics: Num rows: 6 Data size: 39 Basic stats: COMPLETE Column 
stats: NONE
-          File Output Operator
-            compressed: false
-            GlobalTableId: 0
-#### A masked pattern was here ####
-            NumFilesPerFileSink: 1
+          Select Operator
+            expressions: _col0 (type: int), _col1 (type: int), _col4 (type: 
int), _col5 (type: int), _col6 (type: int), _col7 (type: int)
+            outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
             Statistics: Num rows: 6 Data size: 39 Basic stats: COMPLETE Column 
stats: NONE
-#### A masked pattern was here ####
-            table:
-                input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                output format: 
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                properties:
-                  columns _col0,_col1,_col2,_col3,_col4,_col5
-                  columns.types int:int:int:int:int:int
-                  escape.delim \
-                  hive.serialization.extend.additional.nesting.levels true
-                  serialization.escape.crlf true
-                  serialization.format 1
-                  serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-            TotalFiles: 1
-            GatherStats: false
-            MultiFileSpray: false
+            File Output Operator
+              compressed: false
+              GlobalTableId: 0
+#### A masked pattern was here ####
+              NumFilesPerFileSink: 1
+              Statistics: Num rows: 6 Data size: 39 Basic stats: COMPLETE 
Column stats: NONE
+#### A masked pattern was here ####
+              table:
+                  input format: 
org.apache.hadoop.mapred.SequenceFileInputFormat
+                  output format: 
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                  properties:
+                    columns _col0,_col1,_col2,_col3,_col4,_col5
+                    columns.types int:int:int:int:int:int
+                    escape.delim \
+                    hive.serialization.extend.additional.nesting.levels true
+                    serialization.escape.crlf true
+                    serialization.format 1
+                    serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                  serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              TotalFiles: 1
+              GatherStats: false
+              MultiFileSpray: false
 
   Stage: Stage-0
     Fetch Operator
@@ -226,15 +221,6 @@ POSTHOOK: query: explain extended select * from a_n4 right 
outer join a_n4 b on
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@a_n4
 #### A masked pattern was here ####
-OPTIMIZED SQL: SELECT *
-FROM (SELECT `key`, CAST(50 AS INTEGER) AS `value`
-FROM `default`.`a_n4`
-WHERE `value` = 50) AS `t0`
-RIGHT JOIN (SELECT `key`, `value`
-FROM `default`.`a_n4`) AS `t1` ON `t0`.`key` = `t1`.`key` AND `t1`.`value` = 50
-LEFT JOIN (SELECT `key`, CAST(60 AS INTEGER) AS `value`
-FROM `default`.`a_n4`
-WHERE `value` = 60) AS `t3` ON `t1`.`key` = `t3`.`key` AND `t1`.`value` = 60
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
   Stage-0 depends on stages: Stage-1
@@ -270,8 +256,8 @@ STAGE PLANS:
             Statistics: Num rows: 3 Data size: 18 Basic stats: COMPLETE Column 
stats: NONE
             GatherStats: false
             Select Operator
-              expressions: key (type: int), value (type: int)
-              outputColumnNames: _col0, _col1
+              expressions: key (type: int), value (type: int), (value = 60) 
(type: boolean), (value = 50) (type: boolean)
+              outputColumnNames: _col0, _col1, _col2, _col3
               Statistics: Num rows: 3 Data size: 18 Basic stats: COMPLETE 
Column stats: NONE
               Reduce Output Operator
                 key expressions: _col0 (type: int)
@@ -280,7 +266,7 @@ STAGE PLANS:
                 Map-reduce partition columns: _col0 (type: int)
                 Statistics: Num rows: 3 Data size: 18 Basic stats: COMPLETE 
Column stats: NONE
                 tag: 1
-                value expressions: _col1 (type: int)
+                value expressions: _col1 (type: int), _col2 (type: boolean), 
_col3 (type: boolean)
                 auto parallelism: false
           TableScan
             alias: c
@@ -367,36 +353,40 @@ STAGE PLANS:
             1 [0, 1, 2, 1]
           filter predicates:
             0 
-            1 {(VALUE._col0 = 50)} {(VALUE._col0 = 60)}
+            1 {VALUE._col2} {VALUE._col1}
             2 
           keys:
             0 _col0 (type: int)
             1 _col0 (type: int)
             2 _col0 (type: int)
-          outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
+          outputColumnNames: _col0, _col1, _col2, _col3, _col6, _col7
           Statistics: Num rows: 6 Data size: 39 Basic stats: COMPLETE Column 
stats: NONE
-          File Output Operator
-            compressed: false
-            GlobalTableId: 0
-#### A masked pattern was here ####
-            NumFilesPerFileSink: 1
+          Select Operator
+            expressions: _col0 (type: int), _col1 (type: int), _col2 (type: 
int), _col3 (type: int), _col6 (type: int), _col7 (type: int)
+            outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
             Statistics: Num rows: 6 Data size: 39 Basic stats: COMPLETE Column 
stats: NONE
-#### A masked pattern was here ####
-            table:
-                input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                output format: 
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                properties:
-                  columns _col0,_col1,_col2,_col3,_col4,_col5
-                  columns.types int:int:int:int:int:int
-                  escape.delim \
-                  hive.serialization.extend.additional.nesting.levels true
-                  serialization.escape.crlf true
-                  serialization.format 1
-                  serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-            TotalFiles: 1
-            GatherStats: false
-            MultiFileSpray: false
+            File Output Operator
+              compressed: false
+              GlobalTableId: 0
+#### A masked pattern was here ####
+              NumFilesPerFileSink: 1
+              Statistics: Num rows: 6 Data size: 39 Basic stats: COMPLETE 
Column stats: NONE
+#### A masked pattern was here ####
+              table:
+                  input format: 
org.apache.hadoop.mapred.SequenceFileInputFormat
+                  output format: 
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                  properties:
+                    columns _col0,_col1,_col2,_col3,_col4,_col5
+                    columns.types int:int:int:int:int:int
+                    escape.delim \
+                    hive.serialization.extend.additional.nesting.levels true
+                    serialization.escape.crlf true
+                    serialization.format 1
+                    serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                  serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              TotalFiles: 1
+              GatherStats: false
+              MultiFileSpray: false
 
   Stage: Stage-0
     Fetch Operator
@@ -434,15 +424,6 @@ POSTHOOK: query: explain extended select * from a_n4 right 
outer join a_n4 b on
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@a_n4
 #### A masked pattern was here ####
-OPTIMIZED SQL: SELECT *
-FROM (SELECT `key`, CAST(50 AS INTEGER) AS `value`
-FROM `default`.`a_n4`
-WHERE `value` = 50) AS `t0`
-RIGHT JOIN (SELECT `key`, `value`
-FROM `default`.`a_n4`) AS `t1` ON `t0`.`key` = `t1`.`key` AND `t1`.`value` = 50
-LEFT JOIN (SELECT `key`, CAST(60 AS INTEGER) AS `value`
-FROM `default`.`a_n4`
-WHERE `value` = 60) AS `t3` ON `t1`.`key` = `t3`.`key` AND `t1`.`value` = 60
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
   Stage-0 depends on stages: Stage-1
@@ -478,8 +459,8 @@ STAGE PLANS:
             Statistics: Num rows: 3 Data size: 18 Basic stats: COMPLETE Column 
stats: NONE
             GatherStats: false
             Select Operator
-              expressions: key (type: int), value (type: int)
-              outputColumnNames: _col0, _col1
+              expressions: key (type: int), value (type: int), (value = 60) 
(type: boolean), (value = 50) (type: boolean)
+              outputColumnNames: _col0, _col1, _col2, _col3
               Statistics: Num rows: 3 Data size: 18 Basic stats: COMPLETE 
Column stats: NONE
               Reduce Output Operator
                 key expressions: _col0 (type: int)
@@ -488,7 +469,7 @@ STAGE PLANS:
                 Map-reduce partition columns: _col0 (type: int)
                 Statistics: Num rows: 3 Data size: 18 Basic stats: COMPLETE 
Column stats: NONE
                 tag: 1
-                value expressions: _col1 (type: int)
+                value expressions: _col1 (type: int), _col2 (type: boolean), 
_col3 (type: boolean)
                 auto parallelism: false
           TableScan
             alias: c
@@ -575,36 +556,40 @@ STAGE PLANS:
             1 [0, 1, 2, 1]
           filter predicates:
             0 
-            1 {(VALUE._col0 = 50)} {(VALUE._col0 = 60)}
+            1 {VALUE._col2} {VALUE._col1}
             2 
           keys:
             0 _col0 (type: int)
             1 _col0 (type: int)
             2 _col0 (type: int)
-          outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
+          outputColumnNames: _col0, _col1, _col2, _col3, _col6, _col7
           Statistics: Num rows: 6 Data size: 39 Basic stats: COMPLETE Column 
stats: NONE
-          File Output Operator
-            compressed: false
-            GlobalTableId: 0
-#### A masked pattern was here ####
-            NumFilesPerFileSink: 1
+          Select Operator
+            expressions: _col0 (type: int), _col1 (type: int), _col2 (type: 
int), _col3 (type: int), _col6 (type: int), _col7 (type: int)
+            outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
             Statistics: Num rows: 6 Data size: 39 Basic stats: COMPLETE Column 
stats: NONE
-#### A masked pattern was here ####
-            table:
-                input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                output format: 
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                properties:
-                  columns _col0,_col1,_col2,_col3,_col4,_col5
-                  columns.types int:int:int:int:int:int
-                  escape.delim \
-                  hive.serialization.extend.additional.nesting.levels true
-                  serialization.escape.crlf true
-                  serialization.format 1
-                  serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-            TotalFiles: 1
-            GatherStats: false
-            MultiFileSpray: false
+            File Output Operator
+              compressed: false
+              GlobalTableId: 0
+#### A masked pattern was here ####
+              NumFilesPerFileSink: 1
+              Statistics: Num rows: 6 Data size: 39 Basic stats: COMPLETE 
Column stats: NONE
+#### A masked pattern was here ####
+              table:
+                  input format: 
org.apache.hadoop.mapred.SequenceFileInputFormat
+                  output format: 
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                  properties:
+                    columns _col0,_col1,_col2,_col3,_col4,_col5
+                    columns.types int:int:int:int:int:int
+                    escape.delim \
+                    hive.serialization.extend.additional.nesting.levels true
+                    serialization.escape.crlf true
+                    serialization.format 1
+                    serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                  serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              TotalFiles: 1
+              GatherStats: false
+              MultiFileSpray: false
 
   Stage: Stage-0
     Fetch Operator
@@ -642,17 +627,6 @@ POSTHOOK: query: explain extended select * from a_n4 full 
outer join a_n4 b on (
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@a_n4
 #### A masked pattern was here ####
-OPTIMIZED SQL: SELECT *
-FROM (SELECT `key`, `value`
-FROM `default`.`a_n4`) AS `t`
-FULL JOIN (SELECT `key`, `value`
-FROM `default`.`a_n4`) AS `t0` ON `t`.`key` = `t0`.`key` AND `t`.`value` = 50 
AND `t0`.`value` = 50
-LEFT JOIN (SELECT `key`, CAST(60 AS INTEGER) AS `value`
-FROM `default`.`a_n4`
-WHERE `value` = 60) AS `t2` ON `t0`.`key` = `t2`.`key` AND `t0`.`value` = 60
-LEFT JOIN (SELECT `key`, CAST(40 AS INTEGER) AS `value`
-FROM `default`.`a_n4`
-WHERE `value` = 40) AS `t4` ON `t`.`key` = `t4`.`key` AND `t`.`value` = 40
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
   Stage-0 depends on stages: Stage-1
@@ -666,8 +640,8 @@ STAGE PLANS:
             Statistics: Num rows: 3 Data size: 18 Basic stats: COMPLETE Column 
stats: NONE
             GatherStats: false
             Select Operator
-              expressions: key (type: int), value (type: int)
-              outputColumnNames: _col0, _col1
+              expressions: key (type: int), value (type: int), (value = 40) 
(type: boolean), (value = 50) (type: boolean)
+              outputColumnNames: _col0, _col1, _col2, _col3
               Statistics: Num rows: 3 Data size: 18 Basic stats: COMPLETE 
Column stats: NONE
               Reduce Output Operator
                 key expressions: _col0 (type: int)
@@ -676,15 +650,15 @@ STAGE PLANS:
                 Map-reduce partition columns: _col0 (type: int)
                 Statistics: Num rows: 3 Data size: 18 Basic stats: COMPLETE 
Column stats: NONE
                 tag: 0
-                value expressions: _col1 (type: int)
+                value expressions: _col1 (type: int), _col2 (type: boolean), 
_col3 (type: boolean)
                 auto parallelism: false
           TableScan
             alias: b
             Statistics: Num rows: 3 Data size: 18 Basic stats: COMPLETE Column 
stats: NONE
             GatherStats: false
             Select Operator
-              expressions: key (type: int), value (type: int)
-              outputColumnNames: _col0, _col1
+              expressions: key (type: int), value (type: int), (value = 60) 
(type: boolean), (value = 50) (type: boolean)
+              outputColumnNames: _col0, _col1, _col2, _col3
               Statistics: Num rows: 3 Data size: 18 Basic stats: COMPLETE 
Column stats: NONE
               Reduce Output Operator
                 key expressions: _col0 (type: int)
@@ -693,7 +667,7 @@ STAGE PLANS:
                 Map-reduce partition columns: _col0 (type: int)
                 Statistics: Num rows: 3 Data size: 18 Basic stats: COMPLETE 
Column stats: NONE
                 tag: 1
-                value expressions: _col1 (type: int)
+                value expressions: _col1 (type: int), _col2 (type: boolean), 
_col3 (type: boolean)
                 auto parallelism: false
           TableScan
             alias: c
@@ -803,8 +777,8 @@ STAGE PLANS:
             0 [1, 1, 3, 1]
             1 [0, 1, 2, 1]
           filter predicates:
-            0 {(VALUE._col0 = 50)} {(VALUE._col0 = 40)}
-            1 {(VALUE._col0 = 50)} {(VALUE._col0 = 60)}
+            0 {VALUE._col2} {VALUE._col1}
+            1 {VALUE._col2} {VALUE._col1}
             2 
             3 
           keys:
@@ -812,30 +786,34 @@ STAGE PLANS:
             1 _col0 (type: int)
             2 _col0 (type: int)
             3 _col0 (type: int)
-          outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, 
_col7
+          outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9, _col10, 
_col11
           Statistics: Num rows: 9 Data size: 59 Basic stats: COMPLETE Column 
stats: NONE
-          File Output Operator
-            compressed: false
-            GlobalTableId: 0
-#### A masked pattern was here ####
-            NumFilesPerFileSink: 1
+          Select Operator
+            expressions: _col0 (type: int), _col1 (type: int), _col4 (type: 
int), _col5 (type: int), _col8 (type: int), _col9 (type: int), _col10 (type: 
int), _col11 (type: int)
+            outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7
             Statistics: Num rows: 9 Data size: 59 Basic stats: COMPLETE Column 
stats: NONE
-#### A masked pattern was here ####
-            table:
-                input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                output format: 
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                properties:
-                  columns _col0,_col1,_col2,_col3,_col4,_col5,_col6,_col7
-                  columns.types int:int:int:int:int:int:int:int
-                  escape.delim \
-                  hive.serialization.extend.additional.nesting.levels true
-                  serialization.escape.crlf true
-                  serialization.format 1
-                  serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-            TotalFiles: 1
-            GatherStats: false
-            MultiFileSpray: false
+            File Output Operator
+              compressed: false
+              GlobalTableId: 0
+#### A masked pattern was here ####
+              NumFilesPerFileSink: 1
+              Statistics: Num rows: 9 Data size: 59 Basic stats: COMPLETE 
Column stats: NONE
+#### A masked pattern was here ####
+              table:
+                  input format: 
org.apache.hadoop.mapred.SequenceFileInputFormat
+                  output format: 
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                  properties:
+                    columns _col0,_col1,_col2,_col3,_col4,_col5,_col6,_col7
+                    columns.types int:int:int:int:int:int:int:int
+                    escape.delim \
+                    hive.serialization.extend.additional.nesting.levels true
+                    serialization.escape.crlf true
+                    serialization.format 1
+                    serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                  serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              TotalFiles: 1
+              GatherStats: false
+              MultiFileSpray: false
 
   Stage: Stage-0
     Fetch Operator
@@ -864,18 +842,6 @@ POSTHOOK: query: explain extended select * from a_n4 left 
outer join a_n4 b on (
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@a_n4
 #### A masked pattern was here ####
-OPTIMIZED SQL: SELECT *
-FROM (SELECT `key`, `value`
-FROM `default`.`a_n4`) AS `t`
-LEFT JOIN (SELECT `key`, CAST(50 AS INTEGER) AS `value`
-FROM `default`.`a_n4`
-WHERE `value` = 50) AS `t1` ON `t`.`key` = `t1`.`key` AND `t`.`value` = 50
-LEFT JOIN (SELECT `key`, CAST(60 AS INTEGER) AS `value`
-FROM `default`.`a_n4`
-WHERE `value` = 60) AS `t3` ON `t`.`key` = `t3`.`key` AND `t`.`value` = 60
-LEFT JOIN (SELECT `key`, CAST(40 AS INTEGER) AS `value`
-FROM `default`.`a_n4`
-WHERE `value` = 40) AS `t5` ON `t`.`key` = `t5`.`key` AND `t`.`value` = 40
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
   Stage-0 depends on stages: Stage-1
@@ -889,8 +855,8 @@ STAGE PLANS:
             Statistics: Num rows: 3 Data size: 18 Basic stats: COMPLETE Column 
stats: NONE
             GatherStats: false
             Select Operator
-              expressions: key (type: int), value (type: int)
-              outputColumnNames: _col0, _col1
+              expressions: key (type: int), value (type: int), (value = 40) 
(type: boolean), (value = 60) (type: boolean), (value = 50) (type: boolean)
+              outputColumnNames: _col0, _col1, _col2, _col3, _col4
               Statistics: Num rows: 3 Data size: 18 Basic stats: COMPLETE 
Column stats: NONE
               Reduce Output Operator
                 key expressions: _col0 (type: int)
@@ -899,7 +865,7 @@ STAGE PLANS:
                 Map-reduce partition columns: _col0 (type: int)
                 Statistics: Num rows: 3 Data size: 18 Basic stats: COMPLETE 
Column stats: NONE
                 tag: 0
-                value expressions: _col1 (type: int)
+                value expressions: _col1 (type: int), _col2 (type: boolean), 
_col3 (type: boolean), _col4 (type: boolean)
                 auto parallelism: false
           TableScan
             alias: b
@@ -1030,7 +996,7 @@ STAGE PLANS:
           filter mappings:
             0 [1, 1, 2, 1, 3, 1]
           filter predicates:
-            0 {(VALUE._col0 = 50)} {(VALUE._col0 = 60)} {(VALUE._col0 = 40)}
+            0 {VALUE._col3} {VALUE._col2} {VALUE._col1}
             1 
             2 
             3 
@@ -1039,30 +1005,34 @@ STAGE PLANS:
             1 _col0 (type: int)
             2 _col0 (type: int)
             3 _col0 (type: int)
-          outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, 
_col7
+          outputColumnNames: _col0, _col1, _col5, _col6, _col7, _col8, _col9, 
_col10
           Statistics: Num rows: 9 Data size: 59 Basic stats: COMPLETE Column 
stats: NONE
-          File Output Operator
-            compressed: false
-            GlobalTableId: 0
-#### A masked pattern was here ####
-            NumFilesPerFileSink: 1
+          Select Operator
+            expressions: _col0 (type: int), _col1 (type: int), _col5 (type: 
int), _col6 (type: int), _col7 (type: int), _col8 (type: int), _col9 (type: 
int), _col10 (type: int)
+            outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7
             Statistics: Num rows: 9 Data size: 59 Basic stats: COMPLETE Column 
stats: NONE
-#### A masked pattern was here ####
-            table:
-                input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                output format: 
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                properties:
-                  columns _col0,_col1,_col2,_col3,_col4,_col5,_col6,_col7
-                  columns.types int:int:int:int:int:int:int:int
-                  escape.delim \
-                  hive.serialization.extend.additional.nesting.levels true
-                  serialization.escape.crlf true
-                  serialization.format 1
-                  serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-            TotalFiles: 1
-            GatherStats: false
-            MultiFileSpray: false
+            File Output Operator
+              compressed: false
+              GlobalTableId: 0
+#### A masked pattern was here ####
+              NumFilesPerFileSink: 1
+              Statistics: Num rows: 9 Data size: 59 Basic stats: COMPLETE 
Column stats: NONE
+#### A masked pattern was here ####
+              table:
+                  input format: 
org.apache.hadoop.mapred.SequenceFileInputFormat
+                  output format: 
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                  properties:
+                    columns _col0,_col1,_col2,_col3,_col4,_col5,_col6,_col7
+                    columns.types int:int:int:int:int:int:int:int
+                    escape.delim \
+                    hive.serialization.extend.additional.nesting.levels true
+                    serialization.escape.crlf true
+                    serialization.format 1
+                    serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                  serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              TotalFiles: 1
+              GatherStats: false
+              MultiFileSpray: false
 
   Stage: Stage-0
     Fetch Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/join_merging.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/join_merging.q.out 
b/ql/src/test/results/clientpositive/join_merging.q.out
index 80bde7f..17764ba 100644
--- a/ql/src/test/results/clientpositive/join_merging.q.out
+++ b/ql/src/test/results/clientpositive/join_merging.q.out
@@ -13,14 +13,28 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@part
 #### A masked pattern was here ####
 STAGE DEPENDENCIES:
-  Stage-1 is a root stage
+  Stage-2 is a root stage
+  Stage-1 depends on stages: Stage-2
   Stage-0 depends on stages: Stage-1
 
 STAGE PLANS:
-  Stage: Stage-1
+  Stage: Stage-2
     Map Reduce
       Map Operator Tree:
           TableScan
+            alias: p2
+            Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
+            Select Operator
+              expressions: p_partkey (type: int), p_size (type: int)
+              outputColumnNames: _col0, _col1
+              Statistics: Num rows: 26 Data size: 3147 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: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
+                value expressions: _col1 (type: int)
+          TableScan
             alias: p1
             filterExpr: (p_size > 10) (type: boolean)
             Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
@@ -37,19 +51,29 @@ STAGE PLANS:
                   Map-reduce partition columns: _col0 (type: int)
                   Statistics: Num rows: 8 Data size: 968 Basic stats: COMPLETE 
Column stats: NONE
                   value expressions: _col1 (type: int)
-          TableScan
-            alias: p2
-            Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
-            Select Operator
-              expressions: p_partkey (type: int), p_size (type: int)
-              outputColumnNames: _col0, _col1
-              Statistics: Num rows: 26 Data size: 3147 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: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
-                value expressions: _col1 (type: int)
+      Reduce Operator Tree:
+        Join Operator
+          condition map:
+               Right Outer Join 0 to 1
+          keys:
+            0 _col0 (type: int)
+            1 _col0 (type: int)
+          outputColumnNames: _col0, _col1, _col3
+          Statistics: Num rows: 28 Data size: 3461 Basic stats: COMPLETE 
Column stats: NONE
+          Select Operator
+            expressions: _col3 (type: int), _col0 (type: int), _col1 (type: 
int)
+            outputColumnNames: _col0, _col1, _col2
+            Statistics: Num rows: 28 Data size: 3461 Basic stats: COMPLETE 
Column stats: NONE
+            File Output Operator
+              compressed: false
+              table:
+                  input format: 
org.apache.hadoop.mapred.SequenceFileInputFormat
+                  output format: 
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                  serde: 
org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+
+  Stage: Stage-1
+    Map Reduce
+      Map Operator Tree:
           TableScan
             alias: p3
             Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
@@ -62,24 +86,29 @@ STAGE PLANS:
                 sort order: +
                 Map-reduce partition columns: _col0 (type: int)
                 Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
+          TableScan
+            Reduce Output Operator
+              key expressions: _col1 (type: int)
+              sort order: +
+              Map-reduce partition columns: _col1 (type: int)
+              Statistics: Num rows: 28 Data size: 3461 Basic stats: COMPLETE 
Column stats: NONE
+              value expressions: _col0 (type: int), _col2 (type: int)
       Reduce Operator Tree:
         Join Operator
           condition map:
                Left Outer Join 0 to 1
-               Right Outer Join 1 to 2
           keys:
             0 _col0 (type: int)
-            1 _col0 (type: int)
-            2 _col0 (type: int)
+            1 _col1 (type: int)
           outputColumnNames: _col1, _col3
-          Statistics: Num rows: 57 Data size: 6923 Basic stats: COMPLETE 
Column stats: NONE
+          Statistics: Num rows: 30 Data size: 3807 Basic stats: COMPLETE 
Column stats: NONE
           Select Operator
             expressions: _col1 (type: int), _col3 (type: int)
             outputColumnNames: _col0, _col1
-            Statistics: Num rows: 57 Data size: 6923 Basic stats: COMPLETE 
Column stats: NONE
+            Statistics: Num rows: 30 Data size: 3807 Basic stats: COMPLETE 
Column stats: NONE
             File Output Operator
               compressed: false
-              Statistics: Num rows: 57 Data size: 6923 Basic stats: COMPLETE 
Column stats: NONE
+              Statistics: Num rows: 30 Data size: 3807 Basic stats: COMPLETE 
Column stats: NONE
               table:
                   input format: 
org.apache.hadoop.mapred.SequenceFileInputFormat
                   output format: 
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
@@ -106,47 +135,74 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@part
 #### A masked pattern was here ####
 STAGE DEPENDENCIES:
-  Stage-1 is a root stage
+  Stage-2 is a root stage
+  Stage-1 depends on stages: Stage-2
   Stage-0 depends on stages: Stage-1
 
 STAGE PLANS:
-  Stage: Stage-1
+  Stage: Stage-2
     Map Reduce
       Map Operator Tree:
           TableScan
-            alias: p1
-            filterExpr: ((p_size > 10) and p_partkey is not null) (type: 
boolean)
+            alias: p2
+            filterExpr: p_partkey is not null (type: boolean)
             Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
             Filter Operator
-              predicate: ((p_size > 10) and p_partkey is not null) (type: 
boolean)
-              Statistics: Num rows: 8 Data size: 968 Basic stats: COMPLETE 
Column stats: NONE
+              predicate: p_partkey is not null (type: boolean)
+              Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
               Select Operator
-                expressions: p_partkey (type: int), p_size (type: int)
-                outputColumnNames: _col0, _col1
-                Statistics: Num rows: 8 Data size: 968 Basic stats: COMPLETE 
Column stats: NONE
+                expressions: p_partkey (type: int), p_size (type: int), 
(p_size + 10) (type: int)
+                outputColumnNames: _col0, _col1, _col2
+                Statistics: Num rows: 26 Data size: 3147 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: 8 Data size: 968 Basic stats: COMPLETE 
Column stats: NONE
-                  value expressions: _col1 (type: int)
+                  Statistics: Num rows: 26 Data size: 3147 Basic stats: 
COMPLETE Column stats: NONE
+                  value expressions: _col1 (type: int), _col2 (type: int)
           TableScan
-            alias: p2
-            filterExpr: p_partkey is not null (type: boolean)
+            alias: p1
+            filterExpr: ((p_size > 10) and p_partkey is not null) (type: 
boolean)
             Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
             Filter Operator
-              predicate: p_partkey is not null (type: boolean)
-              Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
+              predicate: ((p_size > 10) and p_partkey is not null) (type: 
boolean)
+              Statistics: Num rows: 8 Data size: 968 Basic stats: COMPLETE 
Column stats: NONE
               Select Operator
                 expressions: p_partkey (type: int), p_size (type: int)
                 outputColumnNames: _col0, _col1
-                Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
+                Statistics: Num rows: 8 Data size: 968 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: 26 Data size: 3147 Basic stats: 
COMPLETE Column stats: NONE
+                  Statistics: Num rows: 8 Data size: 968 Basic stats: COMPLETE 
Column stats: NONE
                   value expressions: _col1 (type: int)
+      Reduce Operator Tree:
+        Join Operator
+          condition map:
+               Inner Join 0 to 1
+          keys:
+            0 _col0 (type: int)
+            1 _col0 (type: int)
+          outputColumnNames: _col0, _col1, _col2, _col4
+          Statistics: Num rows: 28 Data size: 3461 Basic stats: COMPLETE 
Column stats: NONE
+          Filter Operator
+            predicate: (_col4 > _col2) (type: boolean)
+            Statistics: Num rows: 9 Data size: 1112 Basic stats: COMPLETE 
Column stats: NONE
+            Select Operator
+              expressions: _col4 (type: int), _col0 (type: int), _col1 (type: 
int)
+              outputColumnNames: _col0, _col1, _col2
+              Statistics: Num rows: 9 Data size: 1112 Basic stats: COMPLETE 
Column stats: NONE
+              File Output Operator
+                compressed: false
+                table:
+                    input format: 
org.apache.hadoop.mapred.SequenceFileInputFormat
+                    output format: 
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                    serde: 
org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+
+  Stage: Stage-1
+    Map Reduce
+      Map Operator Tree:
           TableScan
             alias: p3
             Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
@@ -159,25 +215,29 @@ STAGE PLANS:
                 sort order: +
                 Map-reduce partition columns: _col0 (type: int)
                 Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
+          TableScan
+            Reduce Output Operator
+              key expressions: _col1 (type: int)
+              sort order: +
+              Map-reduce partition columns: _col1 (type: int)
+              Statistics: Num rows: 9 Data size: 1112 Basic stats: COMPLETE 
Column stats: NONE
+              value expressions: _col0 (type: int), _col2 (type: int)
       Reduce Operator Tree:
         Join Operator
           condition map:
-               Inner Join 0 to 1
-               Right Outer Join 1 to 2
+               Left Outer Join 0 to 1
           keys:
             0 _col0 (type: int)
-            1 _col0 (type: int)
-            2 _col0 (type: int)
+            1 _col1 (type: int)
           outputColumnNames: _col1, _col3
-          residual filter predicates: {(_col1 > (_col3 + 10))}
-          Statistics: Num rows: 57 Data size: 6923 Basic stats: COMPLETE 
Column stats: NONE
+          Statistics: Num rows: 28 Data size: 3461 Basic stats: COMPLETE 
Column stats: NONE
           Select Operator
             expressions: _col1 (type: int), _col3 (type: int)
             outputColumnNames: _col0, _col1
-            Statistics: Num rows: 57 Data size: 6923 Basic stats: COMPLETE 
Column stats: NONE
+            Statistics: Num rows: 28 Data size: 3461 Basic stats: COMPLETE 
Column stats: NONE
             File Output Operator
               compressed: false
-              Statistics: Num rows: 57 Data size: 6923 Basic stats: COMPLETE 
Column stats: NONE
+              Statistics: Num rows: 28 Data size: 3461 Basic stats: COMPLETE 
Column stats: NONE
               table:
                   input format: 
org.apache.hadoop.mapred.SequenceFileInputFormat
                   output format: 
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/join_view.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/join_view.q.out 
b/ql/src/test/results/clientpositive/join_view.q.out
index c6241e1..da9ad9e 100644
--- a/ql/src/test/results/clientpositive/join_view.q.out
+++ b/ql/src/test/results/clientpositive/join_view.q.out
@@ -99,10 +99,10 @@ STAGE PLANS:
           keys:
             0 
             1 
-          outputColumnNames: _col0, _col2
+          outputColumnNames: _col0, _col1
           Statistics: Num rows: 1 Data size: 1 Basic stats: PARTIAL Column 
stats: NONE
           Select Operator
-            expressions: _col0 (type: string), _col2 (type: int), '2011-09-01' 
(type: string)
+            expressions: _col0 (type: string), _col1 (type: int), '2011-09-01' 
(type: string)
             outputColumnNames: _col0, _col1, _col2
             Statistics: Num rows: 1 Data size: 1 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/auto_join_filters.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/auto_join_filters.q.out 
b/ql/src/test/results/clientpositive/llap/auto_join_filters.q.out
index d605110..8be0433 100644
--- a/ql/src/test/results/clientpositive/llap/auto_join_filters.q.out
+++ b/ql/src/test/results/clientpositive/llap/auto_join_filters.q.out
@@ -82,13 +82,13 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
                   Select Operator
-                    expressions: key (type: int), value (type: int)
-                    outputColumnNames: _col0, _col1
+                    expressions: key (type: int), value (type: int), (key > 
40) (type: boolean), (value > 50) (type: boolean), (key = value) (type: boolean)
+                    outputColumnNames: _col0, _col1, _col2, _col3, _col4
                     Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
                     Reduce Output Operator
                       sort order: 
                       Statistics: Num rows: 1 Data size: 8 Basic stats: 
COMPLETE Column stats: NONE
-                      value expressions: _col0 (type: int), _col1 (type: int)
+                      value expressions: _col0 (type: int), _col1 (type: int), 
_col2 (type: boolean), _col3 (type: boolean), _col4 (type: boolean)
             Execution mode: vectorized, llap
             LLAP IO: no inputs
         Map 4 
@@ -97,13 +97,13 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
                   Select Operator
-                    expressions: key (type: int), value (type: int)
-                    outputColumnNames: _col0, _col1
+                    expressions: key (type: int), value (type: int), (key > 
40) (type: boolean), (value > 50) (type: boolean), (key = value) (type: boolean)
+                    outputColumnNames: _col0, _col1, _col2, _col3, _col4
                     Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
                     Reduce Output Operator
                       sort order: 
                       Statistics: Num rows: 1 Data size: 8 Basic stats: 
COMPLETE Column stats: NONE
-                      value expressions: _col0 (type: int), _col1 (type: int)
+                      value expressions: _col0 (type: int), _col1 (type: int), 
_col2 (type: boolean), _col3 (type: boolean), _col4 (type: boolean)
             Execution mode: vectorized, llap
             LLAP IO: no inputs
         Reducer 2 
@@ -113,15 +113,15 @@ STAGE PLANS:
                 condition map:
                      Full Outer Join 0 to 1
                 filter predicates:
-                  0 {(VALUE._col0 > 40)} {(VALUE._col1 > 50)} {(VALUE._col0 = 
VALUE._col1)}
-                  1 {(VALUE._col0 > 40)} {(VALUE._col1 > 50)} {(VALUE._col0 = 
VALUE._col1)}
+                  0 {VALUE._col2} {VALUE._col3} {VALUE._col4}
+                  1 {VALUE._col2} {VALUE._col3} {VALUE._col4}
                 keys:
                   0 
                   1 
-                outputColumnNames: _col0, _col1, _col2, _col3
+                outputColumnNames: _col0, _col1, _col5, _col6
                 Statistics: Num rows: 1 Data size: 17 Basic stats: COMPLETE 
Column stats: NONE
                 Select Operator
-                  expressions: hash(_col0,_col1,_col2,_col3) (type: int)
+                  expressions: hash(_col0,_col1,_col5,_col6) (type: int)
                   outputColumnNames: _col0
                   Statistics: Num rows: 1 Data size: 17 Basic stats: COMPLETE 
Column stats: NONE
                   Group By Operator
@@ -336,15 +336,15 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
                   Select Operator
-                    expressions: key (type: int), value (type: int)
-                    outputColumnNames: _col0, _col1
+                    expressions: key (type: int), value (type: int), (key > 
40) (type: boolean), (value > 50) (type: boolean), (key = value) (type: boolean)
+                    outputColumnNames: _col0, _col1, _col2, _col3, _col4
                     Statistics: Num rows: 1 Data size: 8 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: 1 Data size: 8 Basic stats: 
COMPLETE Column stats: NONE
-                      value expressions: _col1 (type: int)
+                      value expressions: _col1 (type: int), _col2 (type: 
boolean), _col3 (type: boolean), _col4 (type: boolean)
             Execution mode: vectorized, llap
             LLAP IO: no inputs
         Map 4 
@@ -353,15 +353,15 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
                   Select Operator
-                    expressions: key (type: int), value (type: int)
-                    outputColumnNames: _col0, _col1
+                    expressions: key (type: int), value (type: int), (key > 
40) (type: boolean), (value > 50) (type: boolean), (key = value) (type: boolean)
+                    outputColumnNames: _col0, _col1, _col2, _col3, _col4
                     Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
                     Reduce Output Operator
                       key expressions: _col1 (type: int)
                       sort order: +
                       Map-reduce partition columns: _col1 (type: int)
                       Statistics: Num rows: 1 Data size: 8 Basic stats: 
COMPLETE Column stats: NONE
-                      value expressions: _col0 (type: int)
+                      value expressions: _col0 (type: int), _col2 (type: 
boolean), _col3 (type: boolean), _col4 (type: boolean)
             Execution mode: vectorized, llap
             LLAP IO: no inputs
         Reducer 2 
@@ -371,15 +371,15 @@ STAGE PLANS:
                 condition map:
                      Full Outer Join 0 to 1
                 filter predicates:
-                  0 {(KEY.reducesinkkey0 > 40)} {(VALUE._col0 > 50)} 
{(KEY.reducesinkkey0 = VALUE._col0)}
-                  1 {(VALUE._col0 > 40)} {(KEY.reducesinkkey0 > 50)} 
{(VALUE._col0 = KEY.reducesinkkey0)}
+                  0 {VALUE._col1} {VALUE._col2} {VALUE._col3}
+                  1 {VALUE._col1} {VALUE._col2} {VALUE._col3}
                 keys:
                   0 _col0 (type: int)
                   1 _col1 (type: int)
-                outputColumnNames: _col0, _col1, _col2, _col3
+                outputColumnNames: _col0, _col1, _col5, _col6
                 Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
                 Select Operator
-                  expressions: hash(_col0,_col1,_col2,_col3) (type: int)
+                  expressions: hash(_col0,_col1,_col5,_col6) (type: int)
                   outputColumnNames: _col0
                   Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
                   Group By Operator
@@ -772,15 +772,15 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
                   Select Operator
-                    expressions: key (type: int), value (type: int)
-                    outputColumnNames: _col0, _col1
+                    expressions: key (type: int), value (type: int), (key > 
40) (type: boolean), (value > 50) (type: boolean), (key = value) (type: boolean)
+                    outputColumnNames: _col0, _col1, _col2, _col3, _col4
                     Statistics: Num rows: 1 Data size: 8 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: 1 Data size: 8 Basic stats: 
COMPLETE Column stats: NONE
-                      value expressions: _col1 (type: int)
+                      value expressions: _col1 (type: int), _col2 (type: 
boolean), _col3 (type: boolean), _col4 (type: boolean)
             Execution mode: vectorized, llap
             LLAP IO: no inputs
         Map 4 
@@ -789,15 +789,15 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
                   Select Operator
-                    expressions: key (type: int), value (type: int)
-                    outputColumnNames: _col0, _col1
+                    expressions: key (type: int), value (type: int), (key > 
40) (type: boolean), (value > 50) (type: boolean), (key = value) (type: boolean)
+                    outputColumnNames: _col0, _col1, _col2, _col3, _col4
                     Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
                     Reduce Output Operator
                       key expressions: _col1 (type: int)
                       sort order: +
                       Map-reduce partition columns: _col1 (type: int)
                       Statistics: Num rows: 1 Data size: 8 Basic stats: 
COMPLETE Column stats: NONE
-                      value expressions: _col0 (type: int)
+                      value expressions: _col0 (type: int), _col2 (type: 
boolean), _col3 (type: boolean), _col4 (type: boolean)
             Execution mode: vectorized, llap
             LLAP IO: no inputs
         Reducer 2 
@@ -807,15 +807,15 @@ STAGE PLANS:
                 condition map:
                      Full Outer Join 0 to 1
                 filter predicates:
-                  0 {(KEY.reducesinkkey0 > 40)} {(VALUE._col0 > 50)} 
{(KEY.reducesinkkey0 = VALUE._col0)}
-                  1 {(VALUE._col0 > 40)} {(KEY.reducesinkkey0 > 50)} 
{(VALUE._col0 = KEY.reducesinkkey0)}
+                  0 {VALUE._col1} {VALUE._col2} {VALUE._col3}
+                  1 {VALUE._col1} {VALUE._col2} {VALUE._col3}
                 keys:
                   0 _col0 (type: int)
                   1 _col1 (type: int)
-                outputColumnNames: _col0, _col1, _col2, _col3
+                outputColumnNames: _col0, _col1, _col5, _col6
                 Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
                 Select Operator
-                  expressions: hash(_col0,_col1,_col2,_col3) (type: int)
+                  expressions: hash(_col0,_col1,_col5,_col6) (type: int)
                   outputColumnNames: _col0
                   Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
                   Group By Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/llap/auto_sortmerge_join_6.q.out
----------------------------------------------------------------------
diff --git 
a/ql/src/test/results/clientpositive/llap/auto_sortmerge_join_6.q.out 
b/ql/src/test/results/clientpositive/llap/auto_sortmerge_join_6.q.out
index c1c611a..ebb8246 100644
--- a/ql/src/test/results/clientpositive/llap/auto_sortmerge_join_6.q.out
+++ b/ql/src/test/results/clientpositive/llap/auto_sortmerge_join_6.q.out
@@ -563,14 +563,13 @@ STAGE PLANS:
 #### A masked pattern was here ####
       Edges:
         Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 5 (SIMPLE_EDGE)
-        Reducer 3 <- Map 6 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
-        Reducer 4 <- Reducer 3 (CUSTOM_SIMPLE_EDGE)
+        Reducer 3 <- Reducer 2 (CUSTOM_SIMPLE_EDGE)
 #### A masked pattern was here ####
       Vertices:
         Map 1 
             Map Operator Tree:
                 TableScan
-                  alias: a
+                  alias: b
                   filterExpr: key is not null (type: boolean)
                   Statistics: Num rows: 500 Data size: 2000 Basic stats: 
COMPLETE Column stats: COMPLETE
                   Filter Operator
@@ -580,52 +579,50 @@ STAGE PLANS:
                       expressions: key (type: int)
                       outputColumnNames: _col0
                       Statistics: Num rows: 500 Data size: 2000 Basic stats: 
COMPLETE Column stats: COMPLETE
-                      Reduce Output Operator
-                        key expressions: UDFToDouble(_col0) (type: double)
-                        sort order: +
-                        Map-reduce partition columns: UDFToDouble(_col0) 
(type: double)
-                        Statistics: Num rows: 500 Data size: 2000 Basic stats: 
COMPLETE Column stats: COMPLETE
-                        value expressions: _col0 (type: int)
-            Execution mode: vectorized, llap
-            LLAP IO: no inputs
-        Map 5 
             Map Operator Tree:
                 TableScan
-                  alias: c
+                  alias: a
                   filterExpr: key is not null (type: boolean)
-                  Statistics: Num rows: 500 Data size: 43500 Basic stats: 
COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 500 Data size: 2000 Basic stats: 
COMPLETE Column stats: COMPLETE
                   Filter Operator
                     predicate: key is not null (type: boolean)
-                    Statistics: Num rows: 500 Data size: 43500 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 500 Data size: 2000 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
-                      Reduce Output Operator
-                        key expressions: UDFToDouble(_col0) (type: double)
-                        sort order: +
-                        Map-reduce partition columns: UDFToDouble(_col0) 
(type: double)
-                        Statistics: Num rows: 500 Data size: 43500 Basic 
stats: COMPLETE Column stats: COMPLETE
-            Execution mode: vectorized, llap
-            LLAP IO: no inputs
-        Map 6 
+                      expressions: key (type: int), UDFToDouble(key) (type: 
double)
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 500 Data size: 6000 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: _col1
+                        Statistics: Num rows: 825 Data size: 6600 Basic stats: 
COMPLETE Column stats: COMPLETE
+                        Reduce Output Operator
+                          key expressions: _col1 (type: double)
+                          sort order: +
+                          Map-reduce partition columns: _col1 (type: double)
+                          Statistics: Num rows: 825 Data size: 6600 Basic 
stats: COMPLETE Column stats: COMPLETE
+            Execution mode: llap
+        Map 5 
             Map Operator Tree:
                 TableScan
-                  alias: b
+                  alias: c
                   filterExpr: key is not null (type: boolean)
-                  Statistics: Num rows: 500 Data size: 2000 Basic stats: 
COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 500 Data size: 43500 Basic stats: 
COMPLETE Column stats: COMPLETE
                   Filter Operator
                     predicate: key is not null (type: boolean)
-                    Statistics: Num rows: 500 Data size: 2000 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 500 Data size: 43500 Basic stats: 
COMPLETE Column stats: COMPLETE
                     Select Operator
-                      expressions: key (type: int)
+                      expressions: UDFToDouble(key) (type: double)
                       outputColumnNames: _col0
-                      Statistics: Num rows: 500 Data size: 2000 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 500 Data size: 4000 Basic stats: 
COMPLETE Column stats: COMPLETE
                       Reduce Output Operator
-                        key expressions: _col0 (type: int)
+                        key expressions: _col0 (type: double)
                         sort order: +
-                        Map-reduce partition columns: _col0 (type: int)
-                        Statistics: Num rows: 500 Data size: 2000 Basic stats: 
COMPLETE Column stats: COMPLETE
+                        Map-reduce partition columns: _col0 (type: double)
+                        Statistics: Num rows: 500 Data size: 4000 Basic stats: 
COMPLETE Column stats: COMPLETE
             Execution mode: vectorized, llap
             LLAP IO: no inputs
         Reducer 2 
@@ -635,24 +632,8 @@ STAGE PLANS:
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 UDFToDouble(_col0) (type: double)
-                  1 UDFToDouble(_col0) (type: double)
-                outputColumnNames: _col0
-                Statistics: Num rows: 791 Data size: 3164 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: 791 Data size: 3164 Basic stats: 
COMPLETE Column stats: COMPLETE
-        Reducer 3 
-            Execution mode: llap
-            Reduce Operator Tree:
-              Merge Join Operator
-                condition map:
-                     Inner Join 0 to 1
-                keys:
-                  0 _col0 (type: int)
-                  1 _col0 (type: int)
+                  0 _col1 (type: double)
+                  1 _col0 (type: double)
                 Statistics: Num rows: 1305 Data size: 10440 Basic stats: 
COMPLETE Column stats: COMPLETE
                 Group By Operator
                   aggregations: count()
@@ -663,7 +644,7 @@ STAGE PLANS:
                     sort order: 
                     Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: COMPLETE
                     value expressions: _col0 (type: bigint)
-        Reducer 4 
+        Reducer 3 
             Execution mode: vectorized, llap
             Reduce Operator Tree:
               Group By Operator
@@ -1149,14 +1130,13 @@ STAGE PLANS:
 #### A masked pattern was here ####
       Edges:
         Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 5 (SIMPLE_EDGE)
-        Reducer 3 <- Map 6 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
-        Reducer 4 <- Reducer 3 (CUSTOM_SIMPLE_EDGE)
+        Reducer 3 <- Reducer 2 (CUSTOM_SIMPLE_EDGE)
 #### A masked pattern was here ####
       Vertices:
         Map 1 
             Map Operator Tree:
                 TableScan
-                  alias: a
+                  alias: b
                   filterExpr: key is not null (type: boolean)
                   Statistics: Num rows: 500 Data size: 2000 Basic stats: 
COMPLETE Column stats: COMPLETE
                   Filter Operator
@@ -1166,52 +1146,50 @@ STAGE PLANS:
                       expressions: key (type: int)
                       outputColumnNames: _col0
                       Statistics: Num rows: 500 Data size: 2000 Basic stats: 
COMPLETE Column stats: COMPLETE
-                      Reduce Output Operator
-                        key expressions: UDFToDouble(_col0) (type: double)
-                        sort order: +
-                        Map-reduce partition columns: UDFToDouble(_col0) 
(type: double)
-                        Statistics: Num rows: 500 Data size: 2000 Basic stats: 
COMPLETE Column stats: COMPLETE
-                        value expressions: _col0 (type: int)
-            Execution mode: vectorized, llap
-            LLAP IO: no inputs
-        Map 5 
             Map Operator Tree:
                 TableScan
-                  alias: c
+                  alias: a
                   filterExpr: key is not null (type: boolean)
-                  Statistics: Num rows: 500 Data size: 43500 Basic stats: 
COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 500 Data size: 2000 Basic stats: 
COMPLETE Column stats: COMPLETE
                   Filter Operator
                     predicate: key is not null (type: boolean)
-                    Statistics: Num rows: 500 Data size: 43500 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 500 Data size: 2000 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
-                      Reduce Output Operator
-                        key expressions: UDFToDouble(_col0) (type: double)
-                        sort order: +
-                        Map-reduce partition columns: UDFToDouble(_col0) 
(type: double)
-                        Statistics: Num rows: 500 Data size: 43500 Basic 
stats: COMPLETE Column stats: COMPLETE
-            Execution mode: vectorized, llap
-            LLAP IO: no inputs
-        Map 6 
+                      expressions: key (type: int), UDFToDouble(key) (type: 
double)
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 500 Data size: 6000 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: _col1
+                        Statistics: Num rows: 825 Data size: 6600 Basic stats: 
COMPLETE Column stats: COMPLETE
+                        Reduce Output Operator
+                          key expressions: _col1 (type: double)
+                          sort order: +
+                          Map-reduce partition columns: _col1 (type: double)
+                          Statistics: Num rows: 825 Data size: 6600 Basic 
stats: COMPLETE Column stats: COMPLETE
+            Execution mode: llap
+        Map 5 
             Map Operator Tree:
                 TableScan
-                  alias: b
+                  alias: c
                   filterExpr: key is not null (type: boolean)
-                  Statistics: Num rows: 500 Data size: 2000 Basic stats: 
COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 500 Data size: 43500 Basic stats: 
COMPLETE Column stats: COMPLETE
                   Filter Operator
                     predicate: key is not null (type: boolean)
-                    Statistics: Num rows: 500 Data size: 2000 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 500 Data size: 43500 Basic stats: 
COMPLETE Column stats: COMPLETE
                     Select Operator
-                      expressions: key (type: int)
+                      expressions: UDFToDouble(key) (type: double)
                       outputColumnNames: _col0
-                      Statistics: Num rows: 500 Data size: 2000 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 500 Data size: 4000 Basic stats: 
COMPLETE Column stats: COMPLETE
                       Reduce Output Operator
-                        key expressions: _col0 (type: int)
+                        key expressions: _col0 (type: double)
                         sort order: +
-                        Map-reduce partition columns: _col0 (type: int)
-                        Statistics: Num rows: 500 Data size: 2000 Basic stats: 
COMPLETE Column stats: COMPLETE
+                        Map-reduce partition columns: _col0 (type: double)
+                        Statistics: Num rows: 500 Data size: 4000 Basic stats: 
COMPLETE Column stats: COMPLETE
             Execution mode: vectorized, llap
             LLAP IO: no inputs
         Reducer 2 
@@ -1221,24 +1199,8 @@ STAGE PLANS:
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 UDFToDouble(_col0) (type: double)
-                  1 UDFToDouble(_col0) (type: double)
-                outputColumnNames: _col0
-                Statistics: Num rows: 791 Data size: 3164 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: 791 Data size: 3164 Basic stats: 
COMPLETE Column stats: COMPLETE
-        Reducer 3 
-            Execution mode: llap
-            Reduce Operator Tree:
-              Merge Join Operator
-                condition map:
-                     Inner Join 0 to 1
-                keys:
-                  0 _col0 (type: int)
-                  1 _col0 (type: int)
+                  0 _col1 (type: double)
+                  1 _col0 (type: double)
                 Statistics: Num rows: 1305 Data size: 10440 Basic stats: 
COMPLETE Column stats: COMPLETE
                 Group By Operator
                   aggregations: count()
@@ -1249,7 +1211,7 @@ STAGE PLANS:
                     sort order: 
                     Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: COMPLETE
                     value expressions: _col0 (type: bigint)
-        Reducer 4 
+        Reducer 3 
             Execution mode: vectorized, llap
             Reduce Operator Tree:
               Group By Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/llap/bucket_map_join_tez2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/bucket_map_join_tez2.q.out 
b/ql/src/test/results/clientpositive/llap/bucket_map_join_tez2.q.out
index 8fe30f0..5de5a69 100644
--- a/ql/src/test/results/clientpositive/llap/bucket_map_join_tez2.q.out
+++ b/ql/src/test/results/clientpositive/llap/bucket_map_join_tez2.q.out
@@ -494,14 +494,14 @@ STAGE PLANS:
                     predicate: key is not null (type: boolean)
                     Statistics: Num rows: 242 Data size: 22990 Basic stats: 
COMPLETE Column stats: COMPLETE
                     Select Operator
-                      expressions: key (type: int), value (type: string)
-                      outputColumnNames: _col0, _col1
-                      Statistics: Num rows: 242 Data size: 22990 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      expressions: key (type: int), value (type: string), 
UDFToDouble(key) (type: double)
+                      outputColumnNames: _col0, _col1, _col2
+                      Statistics: Num rows: 242 Data size: 24926 Basic stats: 
COMPLETE Column stats: COMPLETE
                       Reduce Output Operator
-                        key expressions: UDFToDouble(_col0) (type: double)
+                        key expressions: _col2 (type: double)
                         sort order: +
-                        Map-reduce partition columns: UDFToDouble(_col0) 
(type: double)
-                        Statistics: Num rows: 242 Data size: 22990 Basic 
stats: COMPLETE Column stats: COMPLETE
+                        Map-reduce partition columns: _col2 (type: double)
+                        Statistics: Num rows: 242 Data size: 24926 Basic 
stats: COMPLETE Column stats: COMPLETE
                         value expressions: _col0 (type: int), _col1 (type: 
string)
             Execution mode: vectorized, llap
             LLAP IO: no inputs
@@ -515,15 +515,15 @@ STAGE PLANS:
                     predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 89000 Basic stats: 
COMPLETE Column stats: COMPLETE
                     Select Operator
-                      expressions: key (type: string), value (type: string)
+                      expressions: value (type: string), UDFToDouble(key) 
(type: double)
                       outputColumnNames: _col0, _col1
-                      Statistics: Num rows: 500 Data size: 89000 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 500 Data size: 49500 Basic stats: 
COMPLETE Column stats: COMPLETE
                       Map Join Operator
                         condition map:
                              Inner Join 0 to 1
                         keys:
-                          0 UDFToDouble(_col0) (type: double)
-                          1 UDFToDouble(_col0) (type: double)
+                          0 _col2 (type: double)
+                          1 _col1 (type: double)
                         outputColumnNames: _col0, _col1, _col3
                         input vertices:
                           0 Map 1
@@ -584,14 +584,14 @@ STAGE PLANS:
                     predicate: key is not null (type: boolean)
                     Statistics: Num rows: 242 Data size: 22990 Basic stats: 
COMPLETE Column stats: COMPLETE
                     Select Operator
-                      expressions: key (type: int), value (type: string)
-                      outputColumnNames: _col0, _col1
-                      Statistics: Num rows: 242 Data size: 22990 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      expressions: key (type: int), value (type: string), 
UDFToDouble(key) (type: double)
+                      outputColumnNames: _col0, _col1, _col2
+                      Statistics: Num rows: 242 Data size: 24926 Basic stats: 
COMPLETE Column stats: COMPLETE
                       Reduce Output Operator
-                        key expressions: UDFToDouble(_col0) (type: double)
+                        key expressions: _col2 (type: double)
                         sort order: +
-                        Map-reduce partition columns: UDFToDouble(_col0) 
(type: double)
-                        Statistics: Num rows: 242 Data size: 22990 Basic 
stats: COMPLETE Column stats: COMPLETE
+                        Map-reduce partition columns: _col2 (type: double)
+                        Statistics: Num rows: 242 Data size: 24926 Basic 
stats: COMPLETE Column stats: COMPLETE
                         value expressions: _col0 (type: int), _col1 (type: 
string)
             Execution mode: vectorized, llap
             LLAP IO: no inputs
@@ -605,15 +605,15 @@ STAGE PLANS:
                     predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 89000 Basic stats: 
COMPLETE Column stats: COMPLETE
                     Select Operator
-                      expressions: key (type: string), value (type: string)
+                      expressions: value (type: string), UDFToDouble(key) 
(type: double)
                       outputColumnNames: _col0, _col1
-                      Statistics: Num rows: 500 Data size: 89000 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 500 Data size: 49500 Basic stats: 
COMPLETE Column stats: COMPLETE
                       Map Join Operator
                         condition map:
                              Inner Join 0 to 1
                         keys:
-                          0 UDFToDouble(_col0) (type: double)
-                          1 UDFToDouble(_col0) (type: double)
+                          0 _col2 (type: double)
+                          1 _col1 (type: double)
                         outputColumnNames: _col0, _col1, _col3
                         input vertices:
                           0 Map 1
@@ -1395,15 +1395,15 @@ STAGE PLANS:
                     predicate: key is not null (type: boolean)
                     Statistics: Num rows: 242 Data size: 22990 Basic stats: 
COMPLETE Column stats: COMPLETE
                     Select Operator
-                      expressions: key (type: int), value (type: string)
+                      expressions: value (type: string), UDFToDouble(key) 
(type: double)
                       outputColumnNames: _col0, _col1
-                      Statistics: Num rows: 242 Data size: 22990 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 242 Data size: 23958 Basic stats: 
COMPLETE Column stats: COMPLETE
                       Reduce Output Operator
-                        key expressions: UDFToDouble(_col0) (type: double)
+                        key expressions: _col1 (type: double)
                         sort order: +
-                        Map-reduce partition columns: UDFToDouble(_col0) 
(type: double)
-                        Statistics: Num rows: 242 Data size: 22990 Basic 
stats: COMPLETE Column stats: COMPLETE
-                        value expressions: _col1 (type: string)
+                        Map-reduce partition columns: _col1 (type: double)
+                        Statistics: Num rows: 242 Data size: 23958 Basic 
stats: COMPLETE Column stats: COMPLETE
+                        value expressions: _col0 (type: string)
             Execution mode: vectorized, llap
             LLAP IO: no inputs
         Reducer 2 
@@ -1414,12 +1414,16 @@ STAGE PLANS:
                 mode: mergepartial
                 outputColumnNames: _col0
                 Statistics: Num rows: 121 Data size: 11011 Basic stats: 
COMPLETE Column stats: COMPLETE
-                Reduce Output Operator
-                  key expressions: UDFToDouble(_col0) (type: double)
-                  sort order: +
-                  Map-reduce partition columns: UDFToDouble(_col0) (type: 
double)
-                  Statistics: Num rows: 121 Data size: 11011 Basic stats: 
COMPLETE Column stats: COMPLETE
-                  value expressions: _col0 (type: string)
+                Select Operator
+                  expressions: _col0 (type: string), UDFToDouble(_col0) (type: 
double)
+                  outputColumnNames: _col0, _col1
+                  Statistics: Num rows: 121 Data size: 11979 Basic stats: 
COMPLETE Column stats: COMPLETE
+                  Reduce Output Operator
+                    key expressions: _col1 (type: double)
+                    sort order: +
+                    Map-reduce partition columns: _col1 (type: double)
+                    Statistics: Num rows: 121 Data size: 11979 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    value expressions: _col0 (type: string)
         Reducer 3 
             Execution mode: llap
             Reduce Operator Tree:
@@ -1427,8 +1431,8 @@ STAGE PLANS:
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 UDFToDouble(_col0) (type: double)
-                  1 UDFToDouble(_col0) (type: double)
+                  0 _col1 (type: double)
+                  1 _col1 (type: double)
                 outputColumnNames: _col0, _col2
                 Statistics: Num rows: 200 Data size: 36400 Basic stats: 
COMPLETE Column stats: COMPLETE
                 Select Operator
@@ -1503,15 +1507,15 @@ STAGE PLANS:
                     predicate: key is not null (type: boolean)
                     Statistics: Num rows: 242 Data size: 22990 Basic stats: 
COMPLETE Column stats: COMPLETE
                     Select Operator
-                      expressions: key (type: int), value (type: string)
+                      expressions: value (type: string), UDFToDouble(key) 
(type: double)
                       outputColumnNames: _col0, _col1
-                      Statistics: Num rows: 242 Data size: 22990 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 242 Data size: 23958 Basic stats: 
COMPLETE Column stats: COMPLETE
                       Reduce Output Operator
-                        key expressions: UDFToDouble(_col0) (type: double)
+                        key expressions: _col1 (type: double)
                         sort order: +
-                        Map-reduce partition columns: UDFToDouble(_col0) 
(type: double)
-                        Statistics: Num rows: 242 Data size: 22990 Basic 
stats: COMPLETE Column stats: COMPLETE
-                        value expressions: _col1 (type: string)
+                        Map-reduce partition columns: _col1 (type: double)
+                        Statistics: Num rows: 242 Data size: 23958 Basic 
stats: COMPLETE Column stats: COMPLETE
+                        value expressions: _col0 (type: string)
             Execution mode: vectorized, llap
             LLAP IO: no inputs
         Reducer 2 
@@ -1522,12 +1526,16 @@ STAGE PLANS:
                 mode: mergepartial
                 outputColumnNames: _col0
                 Statistics: Num rows: 121 Data size: 11011 Basic stats: 
COMPLETE Column stats: COMPLETE
-                Reduce Output Operator
-                  key expressions: UDFToDouble(_col0) (type: double)
-                  sort order: +
-                  Map-reduce partition columns: UDFToDouble(_col0) (type: 
double)
-                  Statistics: Num rows: 121 Data size: 11011 Basic stats: 
COMPLETE Column stats: COMPLETE
-                  value expressions: _col0 (type: string)
+                Select Operator
+                  expressions: _col0 (type: string), UDFToDouble(_col0) (type: 
double)
+                  outputColumnNames: _col0, _col1
+                  Statistics: Num rows: 121 Data size: 11979 Basic stats: 
COMPLETE Column stats: COMPLETE
+                  Reduce Output Operator
+                    key expressions: _col1 (type: double)
+                    sort order: +
+                    Map-reduce partition columns: _col1 (type: double)
+                    Statistics: Num rows: 121 Data size: 11979 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    value expressions: _col0 (type: string)
         Reducer 3 
             Execution mode: llap
             Reduce Operator Tree:
@@ -1535,8 +1543,8 @@ STAGE PLANS:
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 UDFToDouble(_col0) (type: double)
-                  1 UDFToDouble(_col0) (type: double)
+                  0 _col1 (type: double)
+                  1 _col1 (type: double)
                 outputColumnNames: _col0, _col2
                 Statistics: Num rows: 200 Data size: 36400 Basic stats: 
COMPLETE Column stats: COMPLETE
                 Select Operator
@@ -2375,16 +2383,16 @@ STAGE PLANS:
                     Statistics: Num rows: 1 Data size: 736 Basic stats: 
COMPLETE Column stats: PARTIAL
                     Select Operator
                       expressions: bucket_col (type: string), join_col (type: 
string), accounting_period (type: string)
-                      outputColumnNames: _col0, _col1, _col3
-                      Statistics: Num rows: 1 Data size: 640 Basic stats: 
COMPLETE Column stats: PARTIAL
+                      outputColumnNames: _col0, _col1, _col2
+                      Statistics: Num rows: 1 Data size: 552 Basic stats: 
COMPLETE Column stats: PARTIAL
                       Reduce Output Operator
                         key expressions: _col1 (type: string)
                         null sort order: a
                         sort order: +
                         Map-reduce partition columns: _col1 (type: string)
-                        Statistics: Num rows: 1 Data size: 640 Basic stats: 
COMPLETE Column stats: PARTIAL
+                        Statistics: Num rows: 1 Data size: 552 Basic stats: 
COMPLETE Column stats: PARTIAL
                         tag: 0
-                        value expressions: _col0 (type: string), _col3 (type: 
string)
+                        value expressions: _col0 (type: string), _col2 (type: 
string)
                         auto parallelism: true
             Execution mode: vectorized, llap
             LLAP IO: unknown
@@ -2410,13 +2418,13 @@ STAGE PLANS:
                         keys:
                           0 _col1 (type: string)
                           1 _col0 (type: string)
-                        outputColumnNames: _col0, _col3, _col4
+                        outputColumnNames: _col0, _col2, _col3
                         input vertices:
                           0 Map 1
                         Position of Big Table: 1
                         Statistics: Num rows: 4 Data size: 1619 Basic stats: 
COMPLETE Column stats: NONE
                         Select Operator
-                          expressions: _col0 (type: string), _col4 (type: 
string), _col3 (type: string)
+                          expressions: _col0 (type: string), _col3 (type: 
string), _col2 (type: string)
                           outputColumnNames: _col0, _col1, _col2
                           Statistics: Num rows: 4 Data size: 1619 Basic stats: 
COMPLETE Column stats: NONE
                           File Output Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/llap/bucketmapjoin1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/bucketmapjoin1.q.out 
b/ql/src/test/results/clientpositive/llap/bucketmapjoin1.q.out
index c9a3452..bb19305 100644
--- a/ql/src/test/results/clientpositive/llap/bucketmapjoin1.q.out
+++ b/ql/src/test/results/clientpositive/llap/bucketmapjoin1.q.out
@@ -42,7 +42,7 @@ OPTIMIZED SQL: SELECT `t0`.`key`, `t0`.`value`, `t2`.`value` 
AS `value1`
 FROM (SELECT `key`, `value`
 FROM `default`.`srcbucket_mapjoin_part_n1`
 WHERE `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_2_n1`
 WHERE `ds` = '2008-04-08' AND `key` IS NOT NULL) AS `t2` ON `t0`.`key` = 
`t2`.`key`
 STAGE DEPENDENCIES:
@@ -97,13 +97,13 @@ STAGE PLANS:
                     Select Operator
                       expressions: key (type: int), value (type: string)
                       outputColumnNames: _col0, _col1
-                      Statistics: Num rows: 1 Data size: 282 Basic stats: 
COMPLETE Column stats: PARTIAL
+                      Statistics: Num rows: 1 Data size: 188 Basic stats: 
COMPLETE Column stats: PARTIAL
                       Reduce Output Operator
                         key expressions: _col0 (type: int)
                         null sort order: a
                         sort order: +
                         Map-reduce partition columns: _col0 (type: int)
-                        Statistics: Num rows: 1 Data size: 282 Basic stats: 
COMPLETE Column stats: PARTIAL
+                        Statistics: Num rows: 1 Data size: 188 Basic stats: 
COMPLETE Column stats: PARTIAL
                         tag: 1
                         value expressions: _col1 (type: string)
                         auto parallelism: true
@@ -120,7 +120,7 @@ STAGE PLANS:
                   0 _col0 (type: int)
                   1 _col0 (type: int)
                 outputColumnNames: _col0, _col1, _col3
-                Position of Big Table: 1
+                Position of Big Table: 0
                 Statistics: Num rows: 1 Data size: 206 Basic stats: COMPLETE 
Column stats: NONE
                 Select Operator
                   expressions: _col0 (type: int), _col1 (type: string), _col3 
(type: string)
@@ -189,7 +189,7 @@ OPTIMIZED SQL: SELECT `t0`.`key`, `t0`.`value`, 
`t2`.`value` AS `value1`
 FROM (SELECT `key`, `value`
 FROM `default`.`srcbucket_mapjoin_part_n1`
 WHERE `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_2_n1`
 WHERE `ds` = '2008-04-08' AND `key` IS NOT NULL) AS `t2` ON `t0`.`key` = 
`t2`.`key`
 STAGE DEPENDENCIES:
@@ -244,13 +244,13 @@ STAGE PLANS:
                     Select Operator
                       expressions: key (type: int), value (type: string)
                       outputColumnNames: _col0, _col1
-                      Statistics: Num rows: 1 Data size: 282 Basic stats: 
COMPLETE Column stats: PARTIAL
+                      Statistics: Num rows: 1 Data size: 188 Basic stats: 
COMPLETE Column stats: PARTIAL
                       Reduce Output Operator
                         key expressions: _col0 (type: int)
                         null sort order: a
                         sort order: +
                         Map-reduce partition columns: _col0 (type: int)
-                        Statistics: Num rows: 1 Data size: 282 Basic stats: 
COMPLETE Column stats: PARTIAL
+                        Statistics: Num rows: 1 Data size: 188 Basic stats: 
COMPLETE Column stats: PARTIAL
                         tag: 1
                         value expressions: _col1 (type: string)
                         auto parallelism: true
@@ -267,7 +267,7 @@ STAGE PLANS:
                   0 _col0 (type: int)
                   1 _col0 (type: int)
                 outputColumnNames: _col0, _col1, _col3
-                Position of Big Table: 1
+                Position of Big Table: 0
                 Statistics: Num rows: 1 Data size: 206 Basic stats: COMPLETE 
Column stats: NONE
                 Select Operator
                   expressions: _col0 (type: int), _col1 (type: string), _col3 
(type: string)
@@ -430,7 +430,7 @@ OPTIMIZED SQL: SELECT `t0`.`key`, `t0`.`value`, 
`t2`.`value` AS `value1`
 FROM (SELECT `key`, `value`
 FROM `default`.`srcbucket_mapjoin_n1`
 WHERE `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_n1`
 WHERE `ds` = '2008-04-08' AND `key` IS NOT NULL) AS `t2` ON `t0`.`key` = 
`t2`.`key`
 STAGE DEPENDENCIES:
@@ -872,7 +872,7 @@ OPTIMIZED SQL: SELECT `t0`.`key`, `t0`.`value`, 
`t2`.`value` AS `value1`
 FROM (SELECT `key`, `value`
 FROM `default`.`srcbucket_mapjoin_n1`
 WHERE `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_n1`
 WHERE `ds` = '2008-04-08' AND `key` IS NOT NULL) AS `t2` ON `t0`.`key` = 
`t2`.`key`
 STAGE DEPENDENCIES:

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/llap/bucketmapjoin2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/bucketmapjoin2.q.out 
b/ql/src/test/results/clientpositive/llap/bucketmapjoin2.q.out
index ca0e062..8a9739d 100644
--- a/ql/src/test/results/clientpositive/llap/bucketmapjoin2.q.out
+++ b/ql/src/test/results/clientpositive/llap/bucketmapjoin2.q.out
@@ -114,7 +114,7 @@ OPTIMIZED SQL: SELECT `t0`.`key`, `t0`.`value`, 
`t2`.`value` AS `value1`
 FROM (SELECT `key`, `value`
 FROM `default`.`srcbucket_mapjoin_part_n6`
 WHERE `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_2_n5`
 WHERE `ds` = '2008-04-08' AND `key` IS NOT NULL) AS `t2` ON `t0`.`key` = 
`t2`.`key`
 STAGE DEPENDENCIES:
@@ -563,7 +563,7 @@ OPTIMIZED SQL: SELECT `t0`.`key`, `t0`.`value`, 
`t2`.`value` AS `value1`
 FROM (SELECT `key`, `value`
 FROM `default`.`srcbucket_mapjoin_part_n6`
 WHERE `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_2_n5`
 WHERE `ds` = '2008-04-08' AND `key` IS NOT NULL) AS `t2` ON `t0`.`key` = 
`t2`.`key`
 STAGE DEPENDENCIES:

Reply via email to