hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject [2/2] hive git commit: HIVE-14522 : CBO: Calcite Operator To Hive Operator(Calcite Return Path): Fix test failure for auto_join_filters (Vineet Garg via Ashutosh Chauhan)
Date Thu, 18 Aug 2016 23:24:28 GMT
HIVE-14522 : CBO: Calcite Operator To Hive Operator(Calcite Return Path): Fix test failure for auto_join_filters (Vineet Garg via Ashutosh Chauhan)

Signed-off-by: Ashutosh Chauhan <hashutosh@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/e084f4d6
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/e084f4d6
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/e084f4d6

Branch: refs/heads/master
Commit: e084f4d695dcc80cce990618fac9cc4b5f9d26bf
Parents: 6d3085b
Author: Vineet Garg <vgarg@hortonworks.com>
Authored: Thu Aug 18 16:05:35 2016 -0700
Committer: Ashutosh Chauhan <hashutosh@apache.org>
Committed: Thu Aug 18 16:24:10 2016 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hive/conf/HiveConf.java   |   2 -
 .../org/apache/hadoop/hive/ql/ErrorMsg.java     |   2 -
 .../hadoop/hive/ql/parse/SemanticAnalyzer.java  |  30 ---
 .../hadoop/hive/ql/processors/SetProcessor.java |   2 +-
 .../queries/clientpositive/auto_join_filters.q  |   2 -
 .../test/queries/clientpositive/cbo_rp_join1.q  |   2 -
 ql/src/test/queries/clientpositive/join_1to1.q  |   4 -
 .../test/queries/clientpositive/join_filters.q  |   2 -
 ql/src/test/queries/clientpositive/mapjoin1.q   |   4 -
 .../clientpositive/auto_join_filters.q.out      |  40 ++--
 .../results/clientpositive/cbo_rp_join1.q.out   | 140 +++++++-------
 .../test/results/clientpositive/join_1to1.q.out |  78 ++++++++
 .../results/clientpositive/join_filters.q.out   | 192 +++++++++++++++----
 .../test/results/clientpositive/mapjoin1.q.out  | 135 +++++++------
 .../spark/auto_join_filters.q.out               |  40 ++--
 .../clientpositive/spark/join_1to1.q.out        |  78 ++++++++
 .../results/clientpositive/spark/mapjoin1.q.out | 143 +++++++-------
 .../clientpositive/tez/auto_join_filters.q.out  |  40 ++--
 18 files changed, 585 insertions(+), 351 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/e084f4d6/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
----------------------------------------------------------------------
diff --git a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
index 2bd2eea..c89d72e 100644
--- a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
+++ b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
@@ -1892,8 +1892,6 @@ public class HiveConf extends Configuration {
     HIVEOPTGBYUSINGINDEX("hive.optimize.index.groupby", false,
         "Whether to enable optimization of group-by queries using Aggregate indexes."),
 
-    HIVEOUTERJOINSUPPORTSFILTERS("hive.outerjoin.supports.filters", true, ""),
-
     HIVEFETCHTASKCONVERSION("hive.fetch.task.conversion", "more", new StringSet("none", "minimal", "more"),
         "Some select queries can be converted to single FETCH task minimizing latency.\n" +
         "Currently the query should be single sourced not having any subquery and should not have\n" +

http://git-wip-us.apache.org/repos/asf/hive/blob/e084f4d6/ql/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java b/ql/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java
index 6ed5b13..602b4fc 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java
@@ -191,8 +191,6 @@ public enum ErrorMsg {
   ARCHIVE_ON_TABLE(10110, "ARCHIVE can only be run on partitions"),
   RESERVED_PART_VAL(10111, "Partition value contains a reserved substring"),
   OFFLINE_TABLE_OR_PARTITION(10113, "Query against an offline table or partition"),
-  OUTERJOIN_USES_FILTERS(10114, "The query results could be wrong. " +
-                         "Turn on hive.outerjoin.supports.filters"),
   NEED_PARTITION_SPECIFICATION(10115, "Table is partitioned and partition specification is needed"),
   INVALID_METADATA(10116, "The metadata file could not be parsed "),
   NEED_TABLE_SPECIFICATION(10117, "Table name could be determined; It should be specified "),

http://git-wip-us.apache.org/repos/asf/hive/blob/e084f4d6/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java b/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
index ae1def1..66589fe 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
@@ -2589,12 +2589,7 @@ public class SemanticAnalyzer extends BaseSemanticAnalyzer {
           || ((rightCondAl1.size() == 0) && (rightCondAl2.size() == 0))) {
         if (type.equals(JoinType.LEFTOUTER) ||
             type.equals(JoinType.FULLOUTER)) {
-          if (conf.getBoolVar(HiveConf.ConfVars.HIVEOUTERJOINSUPPORTSFILTERS)) {
             joinTree.getFilters().get(0).add(joinCond);
-          } else {
-            LOG.warn(ErrorMsg.OUTERJOIN_USES_FILTERS.getErrorCodedMsg());
-            joinTree.getFiltersForPushing().get(0).add(joinCond);
-          }
         } else {
           /*
            * If the rhs references table sources and this QBJoinTree has a leftTree;
@@ -2678,12 +2673,7 @@ public class SemanticAnalyzer extends BaseSemanticAnalyzer {
           || ((rightCondAl1.size() == 0) && (rightCondAl2.size() == 0))) {
         if (type.equals(JoinType.RIGHTOUTER)
             || type.equals(JoinType.FULLOUTER)) {
-          if (conf.getBoolVar(HiveConf.ConfVars.HIVEOUTERJOINSUPPORTSFILTERS)) {
             joinTree.getFilters().get(1).add(joinCond);
-          } else {
-            LOG.warn(ErrorMsg.OUTERJOIN_USES_FILTERS.getErrorCodedMsg());
-            joinTree.getFiltersForPushing().get(1).add(joinCond);
-          }
         } else {
           joinTree.getFiltersForPushing().get(1).add(joinCond);
         }
@@ -2698,24 +2688,14 @@ public class SemanticAnalyzer extends BaseSemanticAnalyzer {
     } else if (rightCondAl1.size() != 0) {
       if (type.equals(JoinType.LEFTOUTER)
           || type.equals(JoinType.FULLOUTER)) {
-        if (conf.getBoolVar(HiveConf.ConfVars.HIVEOUTERJOINSUPPORTSFILTERS)) {
           joinTree.getFilters().get(0).add(joinCond);
-        } else {
-          LOG.warn(ErrorMsg.OUTERJOIN_USES_FILTERS.getErrorCodedMsg());
-          joinTree.getFiltersForPushing().get(0).add(joinCond);
-        }
       } else {
         joinTree.getFiltersForPushing().get(0).add(joinCond);
       }
     } else {
       if (type.equals(JoinType.RIGHTOUTER)
           || type.equals(JoinType.FULLOUTER)) {
-        if (conf.getBoolVar(HiveConf.ConfVars.HIVEOUTERJOINSUPPORTSFILTERS)) {
           joinTree.getFilters().get(1).add(joinCond);
-        } else {
-          LOG.warn(ErrorMsg.OUTERJOIN_USES_FILTERS.getErrorCodedMsg());
-          joinTree.getFiltersForPushing().get(1).add(joinCond);
-        }
       } else if (type.equals(JoinType.LEFTSEMI)) {
         joinTree.getExpressions().get(0).add(leftCondn);
         joinTree.getExpressions().get(1).add(rightCondn);
@@ -2866,24 +2846,14 @@ public class SemanticAnalyzer extends BaseSemanticAnalyzer {
       if (!leftAliasNull) {
         if (type.equals(JoinType.LEFTOUTER)
             || type.equals(JoinType.FULLOUTER)) {
-          if (conf.getBoolVar(HiveConf.ConfVars.HIVEOUTERJOINSUPPORTSFILTERS)) {
             joinTree.getFilters().get(0).add(joinCond);
-          } else {
-            LOG.warn(ErrorMsg.OUTERJOIN_USES_FILTERS.getErrorCodedMsg());
-            joinTree.getFiltersForPushing().get(0).add(joinCond);
-          }
         } else {
           joinTree.getFiltersForPushing().get(0).add(joinCond);
         }
       } else {
         if (type.equals(JoinType.RIGHTOUTER)
             || type.equals(JoinType.FULLOUTER)) {
-          if (conf.getBoolVar(HiveConf.ConfVars.HIVEOUTERJOINSUPPORTSFILTERS)) {
             joinTree.getFilters().get(1).add(joinCond);
-          } else {
-            LOG.warn(ErrorMsg.OUTERJOIN_USES_FILTERS.getErrorCodedMsg());
-            joinTree.getFiltersForPushing().get(1).add(joinCond);
-          }
         } else {
           joinTree.getFiltersForPushing().get(1).add(joinCond);
         }

http://git-wip-us.apache.org/repos/asf/hive/blob/e084f4d6/ql/src/java/org/apache/hadoop/hive/ql/processors/SetProcessor.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/processors/SetProcessor.java b/ql/src/java/org/apache/hadoop/hive/ql/processors/SetProcessor.java
index a872809..2e13dab 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/processors/SetProcessor.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/processors/SetProcessor.java
@@ -53,7 +53,7 @@ public class SetProcessor implements CommandProcessor {
   private static final Logger LOG = LoggerFactory.getLogger(SetProcessor.class);
 
   private static final String prefix = "set: ";
-  private static final Set<String> removedConfigs = Sets.newHashSet("hive.mapred.supports.subdirectories","hive.enforce.sorting","hive.enforce.bucketing");
+  private static final Set<String> removedConfigs = Sets.newHashSet("hive.mapred.supports.subdirectories","hive.enforce.sorting","hive.enforce.bucketing", "hive.outerjoin.supports.filters");
 
   public static boolean getBoolean(String value) {
     if (value.equals("on") || value.equals("true")) {

http://git-wip-us.apache.org/repos/asf/hive/blob/e084f4d6/ql/src/test/queries/clientpositive/auto_join_filters.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/auto_join_filters.q b/ql/src/test/queries/clientpositive/auto_join_filters.q
index 2da8bae..a4d2b5c 100644
--- a/ql/src/test/queries/clientpositive/auto_join_filters.q
+++ b/ql/src/test/queries/clientpositive/auto_join_filters.q
@@ -48,8 +48,6 @@ SET hive.optimize.bucketmapjoin = true;
 SET hive.optimize.bucketmapjoin.sortedmerge = true;
 SET hive.input.format = org.apache.hadoop.hive.ql.io.BucketizedHiveInputFormat;
 
-SET hive.outerjoin.supports.filters = false;
-
 SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a JOIN myinput1 b on a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value;
 SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a LEFT OUTER JOIN myinput1 b on a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value;
 SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a RIGHT OUTER JOIN myinput1 b on a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value;

http://git-wip-us.apache.org/repos/asf/hive/blob/e084f4d6/ql/src/test/queries/clientpositive/cbo_rp_join1.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/cbo_rp_join1.q b/ql/src/test/queries/clientpositive/cbo_rp_join1.q
index a454d02..6f637d9 100644
--- a/ql/src/test/queries/clientpositive/cbo_rp_join1.q
+++ b/ql/src/test/queries/clientpositive/cbo_rp_join1.q
@@ -8,8 +8,6 @@ SET hive.optimize.bucketmapjoin = true;
 SET hive.optimize.bucketmapjoin.sortedmerge = true;
 SET hive.input.format = org.apache.hadoop.hive.ql.io.BucketizedHiveInputFormat;
 
-SET hive.outerjoin.supports.filters = false;
-
 EXPLAIN SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a FULL OUTER JOIN myinput1 b on a.key = 40 AND b.key = 40;
 SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a FULL OUTER JOIN myinput1 b on a.key = 40 AND b.key = 40;
 

http://git-wip-us.apache.org/repos/asf/hive/blob/e084f4d6/ql/src/test/queries/clientpositive/join_1to1.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/join_1to1.q b/ql/src/test/queries/clientpositive/join_1to1.q
index 998bf53..0d2e0b5 100644
--- a/ql/src/test/queries/clientpositive/join_1to1.q
+++ b/ql/src/test/queries/clientpositive/join_1to1.q
@@ -7,8 +7,6 @@ CREATE TABLE join_1to1_2(key1 int, key2 int, value int);
 LOAD DATA LOCAL INPATH '../../data/files/in6.txt' INTO TABLE join_1to1_2;
 
 
-set hive.outerjoin.supports.filters=false;
-
 set hive.join.emit.interval=5;
 
 SELECT * FROM join_1to1_1 a join join_1to1_2 b on a.key1 = b.key1;
@@ -33,8 +31,6 @@ SELECT * FROM join_1to1_1 a full outer join join_1to1_2 b on a.key1 = b.key1 and
 
 
 
-set hive.outerjoin.supports.filters=true;
-
 set hive.join.emit.interval=5;
 
 SELECT * FROM join_1to1_1 a join join_1to1_2 b on a.key1 = b.key1;

http://git-wip-us.apache.org/repos/asf/hive/blob/e084f4d6/ql/src/test/queries/clientpositive/join_filters.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/join_filters.q b/ql/src/test/queries/clientpositive/join_filters.q
index 027a627..0ff40b7 100644
--- a/ql/src/test/queries/clientpositive/join_filters.q
+++ b/ql/src/test/queries/clientpositive/join_filters.q
@@ -85,8 +85,6 @@ SELECT /*+ MAPJOIN(a) */ * FROM smb_input1 a RIGHT OUTER JOIN smb_input1 b ON a.
 SELECT /*+ MAPJOIN(a) */ * FROM smb_input1 a RIGHT OUTER JOIN smb_input2 b ON a.key = b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value;
 SELECT /*+ MAPJOIN(a) */ * FROM smb_input2 a RIGHT OUTER JOIN smb_input2 b ON a.value = b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value;
 
-SET hive.outerjoin.supports.filters = false;
-
 SELECT * FROM myinput1 a JOIN myinput1 b on a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value;
 SELECT * FROM myinput1 a LEFT OUTER JOIN myinput1 b on a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value;
 SELECT * FROM myinput1 a RIGHT OUTER JOIN myinput1 b on a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value;

http://git-wip-us.apache.org/repos/asf/hive/blob/e084f4d6/ql/src/test/queries/clientpositive/mapjoin1.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/mapjoin1.q b/ql/src/test/queries/clientpositive/mapjoin1.q
index 49de907..70bfe2e 100644
--- a/ql/src/test/queries/clientpositive/mapjoin1.q
+++ b/ql/src/test/queries/clientpositive/mapjoin1.q
@@ -2,8 +2,6 @@ SELECT  /*+ MAPJOIN(b) */ sum(a.key) as sum_a
     FROM srcpart a
     JOIN src b ON a.key = b.key where a.ds is not null;
 
-set hive.outerjoin.supports.filters=true;
-
 -- const filter on outer join
 EXPLAIN
 SELECT /*+ MAPJOIN(a) */ * FROM src a RIGHT OUTER JOIN src b on a.key=b.key AND true limit 10;
@@ -21,8 +19,6 @@ SELECT /*+ MAPJOIN(a) */ * FROM src a RIGHT OUTER JOIN
 SELECT /*+ MAPJOIN(a) */ * FROM src a RIGHT OUTER JOIN
     (select key, named_struct('key', key, 'value', value) as kv from src) b on a.key=b.key AND b.kv.key > 200 limit 10;
 
-set hive.outerjoin.supports.filters=false;
-
 EXPLAIN
 SELECT /*+ MAPJOIN(a) */ * FROM src a RIGHT OUTER JOIN src b on a.key=b.key AND true limit 10;
 SELECT /*+ MAPJOIN(a) */ * FROM src a RIGHT OUTER JOIN src b on a.key=b.key AND true limit 10;

http://git-wip-us.apache.org/repos/asf/hive/blob/e084f4d6/ql/src/test/results/clientpositive/auto_join_filters.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/auto_join_filters.q.out b/ql/src/test/results/clientpositive/auto_join_filters.q.out
index 2d4a043..e526284 100644
--- a/ql/src/test/results/clientpositive/auto_join_filters.q.out
+++ b/ql/src/test/results/clientpositive/auto_join_filters.q.out
@@ -310,7 +310,7 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 3078400
-Warning: Map Join MAPJOIN[21][bigTable=?] in task 'Stage-2:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[18][bigTable=?] in task 'Stage-2:MAPRED' is a cross product
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a LEFT OUTER JOIN myinput1 b on a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -319,8 +319,8 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a L
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-3078400
-Warning: Map Join MAPJOIN[21][bigTable=?] in task 'Stage-2:MAPRED' is a cross product
+4937935
+Warning: Map Join MAPJOIN[18][bigTable=?] in task 'Stage-2:MAPRED' is a cross product
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a RIGHT OUTER JOIN myinput1 b on a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -329,8 +329,8 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a R
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-3078400
-Warning: Shuffle Join JOIN[12][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-1:MAPRED' is a cross product
+3080335
+Warning: Shuffle Join JOIN[6][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-1:MAPRED' is a cross product
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a FULL OUTER JOIN myinput1 b on a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -339,7 +339,7 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a F
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-3078400
+4939870
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a JOIN myinput1 b ON a.key = b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -384,7 +384,7 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a L
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-3078400
+4937935
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a LEFT OUTER JOIN myinput1 b ON a.value = b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -393,7 +393,7 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a L
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-3078400
+4937935
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a LEFT OUTER JOIN myinput1 b ON a.key = b.key AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -402,7 +402,7 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a L
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-3078400
+4937935
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a LEFT OUTER JOIN myinput1 b ON a.key = b.key and a.value=b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -411,7 +411,7 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a L
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-3078400
+4937935
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a RIGHT OUTER JOIN myinput1 b ON a.key = b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -420,7 +420,7 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a R
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-3078400
+3080335
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a RIGHT OUTER JOIN myinput1 b ON a.key = b.key AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -429,7 +429,7 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a R
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-3078400
+3080335
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a RIGHT OUTER JOIN myinput1 b ON a.value = b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -438,7 +438,7 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a R
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-3078400
+3080335
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a RIGHT OUTER JOIN myinput1 b ON a.key=b.key and a.value = b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -447,7 +447,7 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a R
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-3078400
+3080335
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a FULL OUTER JOIN myinput1 b ON a.key = b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -456,7 +456,7 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a F
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-3078400
+4939870
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a FULL OUTER JOIN myinput1 b ON a.key = b.key AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -465,7 +465,7 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a F
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-3078400
+4939870
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a FULL OUTER JOIN myinput1 b ON a.value = b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -474,7 +474,7 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a F
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-3078400
+4939870
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a FULL OUTER JOIN myinput1 b ON a.value = b.value and a.key=b.key AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -483,7 +483,7 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a F
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-3078400
+4939870
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) from myinput1 a LEFT OUTER JOIN myinput1 b ON (a.value=b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value) RIGHT OUTER JOIN myinput1 c ON (b.value=c.value AND c.key > 40 AND c.value > 50 AND c.key = c.value AND b.key > 40 AND b.value > 50 AND b.key = b.value)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -501,7 +501,7 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) from myinput1 a R
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-3078400
+3080335
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a LEFT OUTER JOIN myinput1 b RIGHT OUTER JOIN myinput1 c ON a.value = b.value and b.value = c.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value AND c.key > 40 AND c.value > 50 AND c.key = c.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -528,7 +528,7 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) from myinput1 a R
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-3078400
+3080335
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a LEFT OUTER JOIN myinput1 b RIGHT OUTER JOIN myinput1 c ON a.value = b.value and b.key = c.key AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value AND c.key > 40 AND c.value > 50 AND c.key = c.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1

http://git-wip-us.apache.org/repos/asf/hive/blob/e084f4d6/ql/src/test/results/clientpositive/cbo_rp_join1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/cbo_rp_join1.q.out b/ql/src/test/results/clientpositive/cbo_rp_join1.q.out
index 695c6d6..df6510c 100644
--- a/ql/src/test/results/clientpositive/cbo_rp_join1.q.out
+++ b/ql/src/test/results/clientpositive/cbo_rp_join1.q.out
@@ -14,7 +14,7 @@ POSTHOOK: query: LOAD DATA LOCAL INPATH '../../data/files/in3.txt' INTO TABLE my
 POSTHOOK: type: LOAD
 #### A masked pattern was here ####
 POSTHOOK: Output: default@myinput1
-Warning: Shuffle Join JOIN[8][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-1:MAPRED' is a cross product
+Warning: Shuffle Join JOIN[6][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-1:MAPRED' is a cross product
 PREHOOK: query: EXPLAIN SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a FULL OUTER JOIN myinput1 b on a.key = 40 AND b.key = 40
 PREHOOK: type: QUERY
 POSTHOOK: query: EXPLAIN SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a FULL OUTER JOIN myinput1 b on a.key = 40 AND b.key = 40
@@ -35,13 +35,10 @@ STAGE PLANS:
               expressions: key (type: int), value (type: int)
               outputColumnNames: _col0, _col1
               Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
-              Filter Operator
-                predicate: (_col0 = 40) (type: boolean)
-                Statistics: Num rows: 1 Data size: 11 Basic stats: COMPLETE Column stats: NONE
-                Reduce Output Operator
-                  sort order: 
-                  Statistics: Num rows: 1 Data size: 11 Basic stats: COMPLETE Column stats: NONE
-                  value expressions: _col0 (type: int), _col1 (type: int)
+              Reduce Output Operator
+                sort order: 
+                Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
+                value expressions: _col0 (type: int), _col1 (type: int)
           TableScan
             alias: b
             Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
@@ -49,26 +46,26 @@ STAGE PLANS:
               expressions: key (type: int), value (type: int)
               outputColumnNames: _col0, _col1
               Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
-              Filter Operator
-                predicate: (_col0 = 40) (type: boolean)
-                Statistics: Num rows: 1 Data size: 11 Basic stats: COMPLETE Column stats: NONE
-                Reduce Output Operator
-                  sort order: 
-                  Statistics: Num rows: 1 Data size: 11 Basic stats: COMPLETE Column stats: NONE
-                  value expressions: _col0 (type: int), _col1 (type: int)
+              Reduce Output Operator
+                sort order: 
+                Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
+                value expressions: _col0 (type: int), _col1 (type: int)
       Reduce Operator Tree:
         Join Operator
           condition map:
                Outer Join 0 to 1
+          filter predicates:
+            0 {(VALUE._col0 = 40)}
+            1 {(VALUE._col0 = 40)}
           keys:
             0 
             1 
           outputColumnNames: _col0, _col1, _col2, _col3
-          Statistics: Num rows: 1 Data size: 23 Basic stats: COMPLETE Column stats: NONE
+          Statistics: Num rows: 4 Data size: 92 Basic stats: COMPLETE Column stats: NONE
           Select Operator
             expressions: hash(_col0,_col1,_col2,_col3) (type: int)
             outputColumnNames: _col0
-            Statistics: Num rows: 1 Data size: 23 Basic stats: COMPLETE Column stats: NONE
+            Statistics: Num rows: 4 Data size: 92 Basic stats: COMPLETE Column stats: NONE
             Group By Operator
               aggregations: sum(_col0)
               mode: hash
@@ -109,7 +106,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Shuffle Join JOIN[8][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-1:MAPRED' is a cross product
+Warning: Shuffle Join JOIN[6][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-1:MAPRED' is a cross product
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a FULL OUTER JOIN myinput1 b on a.key = 40 AND b.key = 40
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -118,8 +115,8 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a F
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-NULL
-Warning: Shuffle Join JOIN[9][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-1:MAPRED' is a cross product
+4939870
+Warning: Shuffle Join JOIN[6][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-1:MAPRED' is a cross product
 PREHOOK: query: EXPLAIN SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a FULL OUTER JOIN myinput1 b on a.key = 40 AND a.value = 40 AND a.key = a.value AND b.key = 40
 PREHOOK: type: QUERY
 POSTHOOK: query: EXPLAIN SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a FULL OUTER JOIN myinput1 b on a.key = 40 AND a.value = 40 AND a.key = a.value AND b.key = 40
@@ -140,13 +137,10 @@ STAGE PLANS:
               expressions: key (type: int), value (type: int)
               outputColumnNames: _col0, _col1
               Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
-              Filter Operator
-                predicate: ((_col1 = 40) and (_col0 = 40)) (type: boolean)
-                Statistics: Num rows: 1 Data size: 11 Basic stats: COMPLETE Column stats: NONE
-                Reduce Output Operator
-                  sort order: 
-                  Statistics: Num rows: 1 Data size: 11 Basic stats: COMPLETE Column stats: NONE
-                  value expressions: _col0 (type: int), _col1 (type: int)
+              Reduce Output Operator
+                sort order: 
+                Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
+                value expressions: _col0 (type: int), _col1 (type: int)
           TableScan
             alias: b
             Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
@@ -154,26 +148,26 @@ STAGE PLANS:
               expressions: key (type: int), value (type: int)
               outputColumnNames: _col0, _col1
               Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
-              Filter Operator
-                predicate: (_col0 = 40) (type: boolean)
-                Statistics: Num rows: 1 Data size: 11 Basic stats: COMPLETE Column stats: NONE
-                Reduce Output Operator
-                  sort order: 
-                  Statistics: Num rows: 1 Data size: 11 Basic stats: COMPLETE Column stats: NONE
-                  value expressions: _col0 (type: int), _col1 (type: int)
+              Reduce Output Operator
+                sort order: 
+                Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
+                value expressions: _col0 (type: int), _col1 (type: int)
       Reduce Operator Tree:
         Join Operator
           condition map:
                Outer Join 0 to 1
+          filter predicates:
+            0 {(VALUE._col0 = 40)} {(VALUE._col1 = 40)}
+            1 {(VALUE._col0 = 40)}
           keys:
             0 
             1 
           outputColumnNames: _col0, _col1, _col2, _col3
-          Statistics: Num rows: 1 Data size: 23 Basic stats: COMPLETE Column stats: NONE
+          Statistics: Num rows: 4 Data size: 92 Basic stats: COMPLETE Column stats: NONE
           Select Operator
             expressions: hash(_col0,_col1,_col2,_col3) (type: int)
             outputColumnNames: _col0
-            Statistics: Num rows: 1 Data size: 23 Basic stats: COMPLETE Column stats: NONE
+            Statistics: Num rows: 4 Data size: 92 Basic stats: COMPLETE Column stats: NONE
             Group By Operator
               aggregations: sum(_col0)
               mode: hash
@@ -214,7 +208,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Shuffle Join JOIN[9][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-1:MAPRED' is a cross product
+Warning: Shuffle Join JOIN[6][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-1:MAPRED' is a cross product
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a FULL OUTER JOIN myinput1 b on a.key = 40 AND a.key = a.value AND b.key = 40
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -223,8 +217,8 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a F
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-NULL
-Warning: Shuffle Join JOIN[8][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-1:MAPRED' is a cross product
+4939870
+Warning: Shuffle Join JOIN[6][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-1:MAPRED' is a cross product
 PREHOOK: query: EXPLAIN SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a FULL OUTER JOIN myinput1 b on a.key = 40 AND a.key = b.key AND b.key = 40
 PREHOOK: type: QUERY
 POSTHOOK: query: EXPLAIN SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a FULL OUTER JOIN myinput1 b on a.key = 40 AND a.key = b.key AND b.key = 40
@@ -245,13 +239,10 @@ STAGE PLANS:
               expressions: key (type: int), value (type: int)
               outputColumnNames: _col0, _col1
               Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
-              Filter Operator
-                predicate: (_col0 = 40) (type: boolean)
-                Statistics: Num rows: 1 Data size: 11 Basic stats: COMPLETE Column stats: NONE
-                Reduce Output Operator
-                  sort order: 
-                  Statistics: Num rows: 1 Data size: 11 Basic stats: COMPLETE Column stats: NONE
-                  value expressions: _col0 (type: int), _col1 (type: int)
+              Reduce Output Operator
+                sort order: 
+                Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
+                value expressions: _col0 (type: int), _col1 (type: int)
           TableScan
             alias: b
             Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
@@ -259,26 +250,26 @@ STAGE PLANS:
               expressions: key (type: int), value (type: int)
               outputColumnNames: _col0, _col1
               Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
-              Filter Operator
-                predicate: (_col0 = 40) (type: boolean)
-                Statistics: Num rows: 1 Data size: 11 Basic stats: COMPLETE Column stats: NONE
-                Reduce Output Operator
-                  sort order: 
-                  Statistics: Num rows: 1 Data size: 11 Basic stats: COMPLETE Column stats: NONE
-                  value expressions: _col0 (type: int), _col1 (type: int)
+              Reduce Output Operator
+                sort order: 
+                Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
+                value expressions: _col0 (type: int), _col1 (type: int)
       Reduce Operator Tree:
         Join Operator
           condition map:
                Outer Join 0 to 1
+          filter predicates:
+            0 {(VALUE._col0 = 40)}
+            1 {(VALUE._col0 = 40)}
           keys:
             0 
             1 
           outputColumnNames: _col0, _col1, _col2, _col3
-          Statistics: Num rows: 1 Data size: 23 Basic stats: COMPLETE Column stats: NONE
+          Statistics: Num rows: 4 Data size: 92 Basic stats: COMPLETE Column stats: NONE
           Select Operator
             expressions: hash(_col0,_col1,_col2,_col3) (type: int)
             outputColumnNames: _col0
-            Statistics: Num rows: 1 Data size: 23 Basic stats: COMPLETE Column stats: NONE
+            Statistics: Num rows: 4 Data size: 92 Basic stats: COMPLETE Column stats: NONE
             Group By Operator
               aggregations: sum(_col0)
               mode: hash
@@ -319,7 +310,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Shuffle Join JOIN[8][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-1:MAPRED' is a cross product
+Warning: Shuffle Join JOIN[6][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-1:MAPRED' is a cross product
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a FULL OUTER JOIN myinput1 b on a.key = 40 AND a.key = b.key AND b.key = 40
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -328,8 +319,8 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a F
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-NULL
-Warning: Shuffle Join JOIN[12][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-1:MAPRED' is a cross product
+4939870
+Warning: Shuffle Join JOIN[6][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-1:MAPRED' is a cross product
 PREHOOK: query: EXPLAIN SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a FULL OUTER JOIN myinput1 b on a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 POSTHOOK: query: EXPLAIN SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a FULL OUTER JOIN myinput1 b on a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
@@ -350,13 +341,10 @@ STAGE PLANS:
               expressions: key (type: int), value (type: int)
               outputColumnNames: _col0, _col1
               Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
-              Filter Operator
-                predicate: ((_col0 = _col1) and (_col1 > 50) and (_col0 > 40)) (type: boolean)
-                Statistics: Num rows: 1 Data size: 11 Basic stats: COMPLETE Column stats: NONE
-                Reduce Output Operator
-                  sort order: 
-                  Statistics: Num rows: 1 Data size: 11 Basic stats: COMPLETE Column stats: NONE
-                  value expressions: _col0 (type: int), _col1 (type: int)
+              Reduce Output Operator
+                sort order: 
+                Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
+                value expressions: _col0 (type: int), _col1 (type: int)
           TableScan
             alias: b
             Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
@@ -364,26 +352,26 @@ STAGE PLANS:
               expressions: key (type: int), value (type: int)
               outputColumnNames: _col0, _col1
               Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
-              Filter Operator
-                predicate: ((_col0 = _col1) and (_col1 > 50) and (_col0 > 40)) (type: boolean)
-                Statistics: Num rows: 1 Data size: 11 Basic stats: COMPLETE Column stats: NONE
-                Reduce Output Operator
-                  sort order: 
-                  Statistics: Num rows: 1 Data size: 11 Basic stats: COMPLETE Column stats: NONE
-                  value expressions: _col0 (type: int), _col1 (type: int)
+              Reduce Output Operator
+                sort order: 
+                Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
+                value expressions: _col0 (type: int), _col1 (type: int)
       Reduce Operator Tree:
         Join Operator
           condition map:
                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)}
           keys:
             0 
             1 
           outputColumnNames: _col0, _col1, _col2, _col3
-          Statistics: Num rows: 1 Data size: 23 Basic stats: COMPLETE Column stats: NONE
+          Statistics: Num rows: 4 Data size: 92 Basic stats: COMPLETE Column stats: NONE
           Select Operator
             expressions: hash(_col0,_col1,_col2,_col3) (type: int)
             outputColumnNames: _col0
-            Statistics: Num rows: 1 Data size: 23 Basic stats: COMPLETE Column stats: NONE
+            Statistics: Num rows: 4 Data size: 92 Basic stats: COMPLETE Column stats: NONE
             Group By Operator
               aggregations: sum(_col0)
               mode: hash
@@ -424,7 +412,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Shuffle Join JOIN[12][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-1:MAPRED' is a cross product
+Warning: Shuffle Join JOIN[6][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-1:MAPRED' is a cross product
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a FULL OUTER JOIN myinput1 b on a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -433,4 +421,4 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a F
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-3078400
+4939870

http://git-wip-us.apache.org/repos/asf/hive/blob/e084f4d6/ql/src/test/results/clientpositive/join_1to1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/join_1to1.q.out b/ql/src/test/results/clientpositive/join_1to1.q.out
index 643b82a..b1fc8f0 100644
--- a/ql/src/test/results/clientpositive/join_1to1.q.out
+++ b/ql/src/test/results/clientpositive/join_1to1.q.out
@@ -132,21 +132,34 @@ POSTHOOK: Input: default@join_1to1_2
 #### A masked pattern was here ####
 15	10015	66	NULL	NULL	NULL
 20	10020	66	20	10020	66
+25	10025	88	NULL	NULL	NULL
 30	10030	66	NULL	NULL	NULL
+35	10035	88	NULL	NULL	NULL
 40	10040	66	40	10040	66
+40	10040	88	NULL	NULL	NULL
 5	10005	66	5	10005	66
 50	10050	66	50	10050	66
 50	10050	66	50	10050	66
+50	10050	88	NULL	NULL	NULL
+50	10050	88	NULL	NULL	NULL
 60	10040	66	60	10040	66
 60	10040	66	60	10040	66
 60	10040	66	60	10040	66
 60	10040	66	60	10040	66
 70	10040	66	NULL	NULL	NULL
 70	10040	66	NULL	NULL	NULL
+80	10040	88	NULL	NULL	NULL
+80	10040	88	NULL	NULL	NULL
 NULL	10050	66	NULL	NULL	NULL
 NULL	NULL	66	NULL	NULL	NULL
 NULL	NULL	NULL	10	10010	66
 NULL	NULL	NULL	25	10025	66
+NULL	NULL	NULL	30	10030	88
+NULL	NULL	NULL	35	10035	88
+NULL	NULL	NULL	40	10040	88
+NULL	NULL	NULL	50	10050	88
+NULL	NULL	NULL	70	10040	88
+NULL	NULL	NULL	70	10040	88
 NULL	NULL	NULL	80	10040	66
 NULL	NULL	NULL	80	10040	66
 NULL	NULL	NULL	NULL	10050	66
@@ -209,21 +222,34 @@ POSTHOOK: Input: default@join_1to1_2
 #### A masked pattern was here ####
 15	10015	66	NULL	NULL	NULL
 20	10020	66	20	10020	66
+25	10025	88	NULL	NULL	NULL
 30	10030	66	NULL	NULL	NULL
+35	10035	88	NULL	NULL	NULL
 40	10040	66	40	10040	66
+40	10040	88	NULL	NULL	NULL
 5	10005	66	5	10005	66
 50	10050	66	50	10050	66
 50	10050	66	50	10050	66
+50	10050	88	NULL	NULL	NULL
+50	10050	88	NULL	NULL	NULL
 60	10040	66	60	10040	66
 60	10040	66	60	10040	66
 60	10040	66	60	10040	66
 60	10040	66	60	10040	66
 70	10040	66	NULL	NULL	NULL
 70	10040	66	NULL	NULL	NULL
+80	10040	88	NULL	NULL	NULL
+80	10040	88	NULL	NULL	NULL
 NULL	10050	66	NULL	NULL	NULL
 NULL	NULL	66	NULL	NULL	NULL
 NULL	NULL	NULL	10	10010	66
 NULL	NULL	NULL	25	10025	66
+NULL	NULL	NULL	30	10030	88
+NULL	NULL	NULL	35	10035	88
+NULL	NULL	NULL	40	10040	88
+NULL	NULL	NULL	50	10050	88
+NULL	NULL	NULL	70	10040	88
+NULL	NULL	NULL	70	10040	88
 NULL	NULL	NULL	80	10040	66
 NULL	NULL	NULL	80	10040	66
 NULL	NULL	NULL	NULL	10050	66
@@ -326,21 +352,34 @@ POSTHOOK: Input: default@join_1to1_2
 #### A masked pattern was here ####
 15	10015	66	NULL	NULL	NULL
 20	10020	66	20	10020	66
+25	10025	88	NULL	NULL	NULL
 30	10030	66	NULL	NULL	NULL
+35	10035	88	NULL	NULL	NULL
 40	10040	66	40	10040	66
+40	10040	88	NULL	NULL	NULL
 5	10005	66	5	10005	66
 50	10050	66	50	10050	66
 50	10050	66	50	10050	66
+50	10050	88	NULL	NULL	NULL
+50	10050	88	NULL	NULL	NULL
 60	10040	66	60	10040	66
 60	10040	66	60	10040	66
 60	10040	66	60	10040	66
 60	10040	66	60	10040	66
 70	10040	66	NULL	NULL	NULL
 70	10040	66	NULL	NULL	NULL
+80	10040	88	NULL	NULL	NULL
+80	10040	88	NULL	NULL	NULL
 NULL	10050	66	NULL	NULL	NULL
 NULL	NULL	66	NULL	NULL	NULL
 NULL	NULL	NULL	10	10010	66
 NULL	NULL	NULL	25	10025	66
+NULL	NULL	NULL	30	10030	88
+NULL	NULL	NULL	35	10035	88
+NULL	NULL	NULL	40	10040	88
+NULL	NULL	NULL	50	10050	88
+NULL	NULL	NULL	70	10040	88
+NULL	NULL	NULL	70	10040	88
 NULL	NULL	NULL	80	10040	66
 NULL	NULL	NULL	80	10040	66
 NULL	NULL	NULL	NULL	10050	66
@@ -403,21 +442,34 @@ POSTHOOK: Input: default@join_1to1_2
 #### A masked pattern was here ####
 15	10015	66	NULL	NULL	NULL
 20	10020	66	20	10020	66
+25	10025	88	NULL	NULL	NULL
 30	10030	66	NULL	NULL	NULL
+35	10035	88	NULL	NULL	NULL
 40	10040	66	40	10040	66
+40	10040	88	NULL	NULL	NULL
 5	10005	66	5	10005	66
 50	10050	66	50	10050	66
 50	10050	66	50	10050	66
+50	10050	88	NULL	NULL	NULL
+50	10050	88	NULL	NULL	NULL
 60	10040	66	60	10040	66
 60	10040	66	60	10040	66
 60	10040	66	60	10040	66
 60	10040	66	60	10040	66
 70	10040	66	NULL	NULL	NULL
 70	10040	66	NULL	NULL	NULL
+80	10040	88	NULL	NULL	NULL
+80	10040	88	NULL	NULL	NULL
 NULL	10050	66	NULL	NULL	NULL
 NULL	NULL	66	NULL	NULL	NULL
 NULL	NULL	NULL	10	10010	66
 NULL	NULL	NULL	25	10025	66
+NULL	NULL	NULL	30	10030	88
+NULL	NULL	NULL	35	10035	88
+NULL	NULL	NULL	40	10040	88
+NULL	NULL	NULL	50	10050	88
+NULL	NULL	NULL	70	10040	88
+NULL	NULL	NULL	70	10040	88
 NULL	NULL	NULL	80	10040	66
 NULL	NULL	NULL	80	10040	66
 NULL	NULL	NULL	NULL	10050	66
@@ -520,21 +572,34 @@ POSTHOOK: Input: default@join_1to1_2
 #### A masked pattern was here ####
 15	10015	66	NULL	NULL	NULL
 20	10020	66	20	10020	66
+25	10025	88	NULL	NULL	NULL
 30	10030	66	NULL	NULL	NULL
+35	10035	88	NULL	NULL	NULL
 40	10040	66	40	10040	66
+40	10040	88	NULL	NULL	NULL
 5	10005	66	5	10005	66
 50	10050	66	50	10050	66
 50	10050	66	50	10050	66
+50	10050	88	NULL	NULL	NULL
+50	10050	88	NULL	NULL	NULL
 60	10040	66	60	10040	66
 60	10040	66	60	10040	66
 60	10040	66	60	10040	66
 60	10040	66	60	10040	66
 70	10040	66	NULL	NULL	NULL
 70	10040	66	NULL	NULL	NULL
+80	10040	88	NULL	NULL	NULL
+80	10040	88	NULL	NULL	NULL
 NULL	10050	66	NULL	NULL	NULL
 NULL	NULL	66	NULL	NULL	NULL
 NULL	NULL	NULL	10	10010	66
 NULL	NULL	NULL	25	10025	66
+NULL	NULL	NULL	30	10030	88
+NULL	NULL	NULL	35	10035	88
+NULL	NULL	NULL	40	10040	88
+NULL	NULL	NULL	50	10050	88
+NULL	NULL	NULL	70	10040	88
+NULL	NULL	NULL	70	10040	88
 NULL	NULL	NULL	80	10040	66
 NULL	NULL	NULL	80	10040	66
 NULL	NULL	NULL	NULL	10050	66
@@ -597,21 +662,34 @@ POSTHOOK: Input: default@join_1to1_2
 #### A masked pattern was here ####
 15	10015	66	NULL	NULL	NULL
 20	10020	66	20	10020	66
+25	10025	88	NULL	NULL	NULL
 30	10030	66	NULL	NULL	NULL
+35	10035	88	NULL	NULL	NULL
 40	10040	66	40	10040	66
+40	10040	88	NULL	NULL	NULL
 5	10005	66	5	10005	66
 50	10050	66	50	10050	66
 50	10050	66	50	10050	66
+50	10050	88	NULL	NULL	NULL
+50	10050	88	NULL	NULL	NULL
 60	10040	66	60	10040	66
 60	10040	66	60	10040	66
 60	10040	66	60	10040	66
 60	10040	66	60	10040	66
 70	10040	66	NULL	NULL	NULL
 70	10040	66	NULL	NULL	NULL
+80	10040	88	NULL	NULL	NULL
+80	10040	88	NULL	NULL	NULL
 NULL	10050	66	NULL	NULL	NULL
 NULL	NULL	66	NULL	NULL	NULL
 NULL	NULL	NULL	10	10010	66
 NULL	NULL	NULL	25	10025	66
+NULL	NULL	NULL	30	10030	88
+NULL	NULL	NULL	35	10035	88
+NULL	NULL	NULL	40	10040	88
+NULL	NULL	NULL	50	10050	88
+NULL	NULL	NULL	70	10040	88
+NULL	NULL	NULL	70	10040	88
 NULL	NULL	NULL	80	10040	66
 NULL	NULL	NULL	80	10040	66
 NULL	NULL	NULL	NULL	10050	66

http://git-wip-us.apache.org/repos/asf/hive/blob/e084f4d6/ql/src/test/results/clientpositive/join_filters.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/join_filters.q.out b/ql/src/test/results/clientpositive/join_filters.q.out
index b909ad5..fa0584d 100644
--- a/ql/src/test/results/clientpositive/join_filters.q.out
+++ b/ql/src/test/results/clientpositive/join_filters.q.out
@@ -785,7 +785,7 @@ POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 100	100	100	100
 YaI1msgLVpfEx943Tfea/Q==
-Warning: Shuffle Join JOIN[10][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-1:MAPRED' is a cross product
+Warning: Shuffle Join JOIN[7][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-1:MAPRED' is a cross product
 PREHOOK: query: SELECT * FROM myinput1 a LEFT OUTER JOIN myinput1 b on a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -795,8 +795,11 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 100	100	100	100
-YaI1msgLVpfEx943Tfea/Q==
-Warning: Shuffle Join JOIN[10][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-1:MAPRED' is a cross product
+12	35	NULL	NULL
+48	NULL	NULL	NULL
+NULL	40	NULL	NULL
+M3MWtBJdRXSWIJY5Qr/otw==
+Warning: Shuffle Join JOIN[7][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-1:MAPRED' is a cross product
 PREHOOK: query: SELECT * FROM myinput1 a RIGHT OUTER JOIN myinput1 b on a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -806,8 +809,11 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 100	100	100	100
-YaI1msgLVpfEx943Tfea/Q==
-Warning: Shuffle Join JOIN[12][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-1:MAPRED' is a cross product
+NULL	NULL	12	35
+NULL	NULL	48	NULL
+NULL	NULL	NULL	40
+LNZKrcVNAvaeDALnsg72bw==
+Warning: Shuffle Join JOIN[6][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-1:MAPRED' is a cross product
 PREHOOK: query: SELECT * FROM myinput1 a FULL OUTER JOIN myinput1 b on a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -817,7 +823,13 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 100	100	100	100
-YaI1msgLVpfEx943Tfea/Q==
+12	35	NULL	NULL
+48	NULL	NULL	NULL
+NULL	40	NULL	NULL
+NULL	NULL	12	35
+NULL	NULL	48	NULL
+NULL	NULL	NULL	40
+JIHZKZaNhNR9LYBcRFyxng==
 PREHOOK: query: SELECT * FROM myinput1 a JOIN myinput1 b ON a.key = b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -867,7 +879,10 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 100	100	100	100
-YaI1msgLVpfEx943Tfea/Q==
+12	35	NULL	NULL
+48	NULL	NULL	NULL
+NULL	40	NULL	NULL
+M3MWtBJdRXSWIJY5Qr/otw==
 PREHOOK: query: SELECT * FROM myinput1 a LEFT OUTER JOIN myinput1 b ON a.value = b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -877,7 +892,10 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 100	100	100	100
-YaI1msgLVpfEx943Tfea/Q==
+12	35	NULL	NULL
+48	NULL	NULL	NULL
+NULL	40	NULL	NULL
+M3MWtBJdRXSWIJY5Qr/otw==
 PREHOOK: query: SELECT * FROM myinput1 a LEFT OUTER JOIN myinput1 b ON a.key = b.key AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -887,7 +905,10 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 100	100	100	100
-YaI1msgLVpfEx943Tfea/Q==
+12	35	NULL	NULL
+48	NULL	NULL	NULL
+NULL	40	NULL	NULL
+M3MWtBJdRXSWIJY5Qr/otw==
 PREHOOK: query: SELECT * FROM myinput1 a LEFT OUTER JOIN myinput1 b ON a.key = b.key and a.value=b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -897,7 +918,10 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 100	100	100	100
-YaI1msgLVpfEx943Tfea/Q==
+12	35	NULL	NULL
+48	NULL	NULL	NULL
+NULL	40	NULL	NULL
+M3MWtBJdRXSWIJY5Qr/otw==
 PREHOOK: query: SELECT * FROM myinput1 a RIGHT OUTER JOIN myinput1 b ON a.key = b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -907,7 +931,10 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 100	100	100	100
-YaI1msgLVpfEx943Tfea/Q==
+NULL	NULL	12	35
+NULL	NULL	48	NULL
+NULL	NULL	NULL	40
+LNZKrcVNAvaeDALnsg72bw==
 PREHOOK: query: SELECT * FROM myinput1 a RIGHT OUTER JOIN myinput1 b ON a.key = b.key AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -917,7 +944,10 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 100	100	100	100
-YaI1msgLVpfEx943Tfea/Q==
+NULL	NULL	12	35
+NULL	NULL	48	NULL
+NULL	NULL	NULL	40
+LNZKrcVNAvaeDALnsg72bw==
 PREHOOK: query: SELECT * FROM myinput1 a RIGHT OUTER JOIN myinput1 b ON a.value = b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -927,7 +957,10 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 100	100	100	100
-YaI1msgLVpfEx943Tfea/Q==
+NULL	NULL	12	35
+NULL	NULL	48	NULL
+NULL	NULL	NULL	40
+LNZKrcVNAvaeDALnsg72bw==
 PREHOOK: query: SELECT * FROM myinput1 a RIGHT OUTER JOIN myinput1 b ON a.key=b.key and a.value = b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -937,7 +970,10 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 100	100	100	100
-YaI1msgLVpfEx943Tfea/Q==
+NULL	NULL	12	35
+NULL	NULL	48	NULL
+NULL	NULL	NULL	40
+LNZKrcVNAvaeDALnsg72bw==
 PREHOOK: query: SELECT * FROM myinput1 a FULL OUTER JOIN myinput1 b ON a.key = b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -947,7 +983,13 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 100	100	100	100
-YaI1msgLVpfEx943Tfea/Q==
+12	35	NULL	NULL
+48	NULL	NULL	NULL
+NULL	40	NULL	NULL
+NULL	NULL	12	35
+NULL	NULL	48	NULL
+NULL	NULL	NULL	40
+JIHZKZaNhNR9LYBcRFyxng==
 PREHOOK: query: SELECT * FROM myinput1 a FULL OUTER JOIN myinput1 b ON a.key = b.key AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -957,7 +999,13 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 100	100	100	100
-YaI1msgLVpfEx943Tfea/Q==
+12	35	NULL	NULL
+48	NULL	NULL	NULL
+NULL	40	NULL	NULL
+NULL	NULL	12	35
+NULL	NULL	48	NULL
+NULL	NULL	NULL	40
+JIHZKZaNhNR9LYBcRFyxng==
 PREHOOK: query: SELECT * FROM myinput1 a FULL OUTER JOIN myinput1 b ON a.value = b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -967,7 +1015,13 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 100	100	100	100
-YaI1msgLVpfEx943Tfea/Q==
+12	35	NULL	NULL
+48	NULL	NULL	NULL
+NULL	40	NULL	NULL
+NULL	NULL	12	35
+NULL	NULL	48	NULL
+NULL	NULL	NULL	40
+JIHZKZaNhNR9LYBcRFyxng==
 PREHOOK: query: SELECT * FROM myinput1 a FULL OUTER JOIN myinput1 b ON a.value = b.value and a.key=b.key AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -977,7 +1031,13 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 100	100	100	100
-YaI1msgLVpfEx943Tfea/Q==
+12	35	NULL	NULL
+48	NULL	NULL	NULL
+NULL	40	NULL	NULL
+NULL	NULL	12	35
+NULL	NULL	48	NULL
+NULL	NULL	NULL	40
+JIHZKZaNhNR9LYBcRFyxng==
 PREHOOK: query: SELECT * from myinput1 a LEFT OUTER JOIN myinput1 b ON (a.value=b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value) RIGHT OUTER JOIN myinput1 c ON (b.value=c.value AND c.key > 40 AND c.value > 50 AND c.key = c.value AND b.key > 40 AND b.value > 50 AND b.key = b.value)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -987,7 +1047,10 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 100	100	100	100	100	100
-WPjT9iK+FjpywFhoiQ0jvw==
+NULL	NULL	NULL	NULL	12	35
+NULL	NULL	NULL	NULL	48	NULL
+NULL	NULL	NULL	NULL	NULL	40
+AzUxen/yR7DlsL00zfSITA==
 PREHOOK: query: SELECT * from myinput1 a RIGHT OUTER JOIN myinput1 b ON (a.value=b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value) LEFT OUTER JOIN myinput1 c ON (b.value=c.value AND c.key > 40 AND c.value > 50 AND c.key = c.value AND b.key > 40 AND b.value > 50 AND b.key = b.value)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -997,7 +1060,10 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 100	100	100	100	100	100
-WPjT9iK+FjpywFhoiQ0jvw==
+NULL	NULL	12	35	NULL	NULL
+NULL	NULL	48	NULL	NULL	NULL
+NULL	NULL	NULL	40	NULL	NULL
+BYad/CYbc/RASCgl63S7Ww==
 PREHOOK: query: SELECT * FROM myinput1 a LEFT OUTER JOIN myinput1 b RIGHT OUTER JOIN myinput1 c ON a.value = b.value and b.value = c.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value AND c.key > 40 AND c.value > 50 AND c.key = c.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -1007,7 +1073,10 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 100	100	100	100	100	100
-WPjT9iK+FjpywFhoiQ0jvw==
+NULL	NULL	NULL	NULL	12	35
+NULL	NULL	NULL	NULL	48	NULL
+NULL	NULL	NULL	NULL	NULL	40
+AzUxen/yR7DlsL00zfSITA==
 PREHOOK: query: SELECT * from myinput1 a LEFT OUTER JOIN myinput1 b ON (a.value=b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value) RIGHT OUTER JOIN myinput1 c ON (b.key=c.key AND c.key > 40 AND c.value > 50 AND c.key = c.value AND b.key > 40 AND b.value > 50 AND b.key = b.value)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -1017,7 +1086,10 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 100	100	100	100	100	100
-WPjT9iK+FjpywFhoiQ0jvw==
+NULL	NULL	NULL	NULL	12	35
+NULL	NULL	NULL	NULL	48	NULL
+NULL	NULL	NULL	NULL	NULL	40
+AzUxen/yR7DlsL00zfSITA==
 PREHOOK: query: SELECT * from myinput1 a RIGHT OUTER JOIN myinput1 b ON (a.value=b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value) LEFT OUTER JOIN myinput1 c ON (b.key=c.key AND c.key > 40 AND c.value > 50 AND c.key = c.value AND b.key > 40 AND b.value > 50 AND b.key = b.value)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -1027,7 +1099,10 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 100	100	100	100	100	100
-WPjT9iK+FjpywFhoiQ0jvw==
+NULL	NULL	12	35	NULL	NULL
+NULL	NULL	48	NULL	NULL	NULL
+NULL	NULL	NULL	40	NULL	NULL
+BYad/CYbc/RASCgl63S7Ww==
 PREHOOK: query: SELECT * FROM myinput1 a LEFT OUTER JOIN myinput1 b RIGHT OUTER JOIN myinput1 c ON a.value = b.value and b.key = c.key AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value AND c.key > 40 AND c.value > 50 AND c.key = c.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -1037,7 +1112,10 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 100	100	100	100	100	100
-WPjT9iK+FjpywFhoiQ0jvw==
+NULL	NULL	NULL	NULL	12	35
+NULL	NULL	NULL	NULL	48	NULL
+NULL	NULL	NULL	NULL	NULL	40
+AzUxen/yR7DlsL00zfSITA==
 Warning: Map Join MAPJOIN[15][bigTable=?] in task 'Stage-1:MAPRED' is a cross product
 PREHOOK: query: SELECT /*+ MAPJOIN(a) */ * FROM myinput1 a JOIN myinput1 b on a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
@@ -1149,7 +1227,10 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 100	100	100	100
-YaI1msgLVpfEx943Tfea/Q==
+12	35	NULL	NULL
+48	NULL	NULL	NULL
+NULL	40	NULL	NULL
+M3MWtBJdRXSWIJY5Qr/otw==
 PREHOOK: query: SELECT /*+ MAPJOIN(b) */ * FROM myinput1 a LEFT OUTER JOIN myinput1 b ON a.key = b.key AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -1159,7 +1240,10 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 100	100	100	100
-YaI1msgLVpfEx943Tfea/Q==
+12	35	NULL	NULL
+48	NULL	NULL	NULL
+NULL	40	NULL	NULL
+M3MWtBJdRXSWIJY5Qr/otw==
 PREHOOK: query: SELECT /*+ MAPJOIN(b) */ * FROM myinput1 a LEFT OUTER JOIN myinput1 b ON a.value = b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -1169,7 +1253,10 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 100	100	100	100
-YaI1msgLVpfEx943Tfea/Q==
+12	35	NULL	NULL
+48	NULL	NULL	NULL
+NULL	40	NULL	NULL
+M3MWtBJdRXSWIJY5Qr/otw==
 PREHOOK: query: SELECT /*+ MAPJOIN(a) */ * FROM myinput1 a RIGHT OUTER JOIN myinput1 b ON a.key = b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -1179,7 +1266,10 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 100	100	100	100
-YaI1msgLVpfEx943Tfea/Q==
+NULL	NULL	12	35
+NULL	NULL	48	NULL
+NULL	NULL	NULL	40
+LNZKrcVNAvaeDALnsg72bw==
 PREHOOK: query: SELECT /*+ MAPJOIN(a) */ * FROM myinput1 a RIGHT OUTER JOIN myinput1 b ON a.key = b.key AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -1189,7 +1279,10 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 100	100	100	100
-YaI1msgLVpfEx943Tfea/Q==
+NULL	NULL	12	35
+NULL	NULL	48	NULL
+NULL	NULL	NULL	40
+LNZKrcVNAvaeDALnsg72bw==
 PREHOOK: query: SELECT /*+ MAPJOIN(a) */ * FROM myinput1 a RIGHT OUTER JOIN myinput1 b ON a.value = b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -1199,7 +1292,10 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 100	100	100	100
-YaI1msgLVpfEx943Tfea/Q==
+NULL	NULL	12	35
+NULL	NULL	48	NULL
+NULL	NULL	NULL	40
+LNZKrcVNAvaeDALnsg72bw==
 PREHOOK: query: SELECT /*+ MAPJOIN(a) */ * FROM smb_input1 a JOIN smb_input1 b ON a.key = b.key AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@smb_input1
@@ -1301,8 +1397,12 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@smb_input1
 #### A masked pattern was here ####
 100	100	100	100
+148	NULL	NULL	NULL
 200	200	200	200
-fRHAbs52npY0rAF1I1Npfg==
+48	NULL	NULL	NULL
+NULL	135	NULL	NULL
+NULL	35	NULL	NULL
+t2boI39B33IANcqlsXXA3g==
 PREHOOK: query: SELECT /*+ MAPJOIN(b) */ * FROM smb_input1 a LEFT OUTER JOIN smb_input2 b ON a.key = b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@smb_input1
@@ -1314,8 +1414,12 @@ POSTHOOK: Input: default@smb_input1
 POSTHOOK: Input: default@smb_input2
 #### A masked pattern was here ####
 100	100	100	100
+148	NULL	NULL	NULL
 200	200	200	200
-fRHAbs52npY0rAF1I1Npfg==
+48	NULL	NULL	NULL
+NULL	135	NULL	NULL
+NULL	35	NULL	NULL
+t2boI39B33IANcqlsXXA3g==
 PREHOOK: query: SELECT /*+ MAPJOIN(b) */ * FROM smb_input2 a LEFT OUTER JOIN smb_input2 b ON a.value = b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@smb_input2
@@ -1325,8 +1429,12 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@smb_input2
 #### A masked pattern was here ####
 100	100	100	100
+148	NULL	NULL	NULL
 200	200	200	200
-fRHAbs52npY0rAF1I1Npfg==
+48	NULL	NULL	NULL
+NULL	135	NULL	NULL
+NULL	35	NULL	NULL
+t2boI39B33IANcqlsXXA3g==
 PREHOOK: query: SELECT /*+ MAPJOIN(a) */ * FROM smb_input1 a RIGHT OUTER JOIN smb_input1 b ON a.key = b.key AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@smb_input1
@@ -1337,7 +1445,11 @@ POSTHOOK: Input: default@smb_input1
 #### A masked pattern was here ####
 100	100	100	100
 200	200	200	200
-fRHAbs52npY0rAF1I1Npfg==
+NULL	NULL	148	NULL
+NULL	NULL	48	NULL
+NULL	NULL	NULL	135
+NULL	NULL	NULL	35
+UBr9lyqgsjDFvooMgQlZ9w==
 PREHOOK: query: SELECT /*+ MAPJOIN(a) */ * FROM smb_input1 a RIGHT OUTER JOIN smb_input2 b ON a.key = b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@smb_input1
@@ -1350,7 +1462,11 @@ POSTHOOK: Input: default@smb_input2
 #### A masked pattern was here ####
 100	100	100	100
 200	200	200	200
-fRHAbs52npY0rAF1I1Npfg==
+NULL	NULL	148	NULL
+NULL	NULL	48	NULL
+NULL	NULL	NULL	135
+NULL	NULL	NULL	35
+UBr9lyqgsjDFvooMgQlZ9w==
 PREHOOK: query: SELECT /*+ MAPJOIN(a) */ * FROM smb_input2 a RIGHT OUTER JOIN smb_input2 b ON a.value = b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@smb_input2
@@ -1361,4 +1477,8 @@ POSTHOOK: Input: default@smb_input2
 #### A masked pattern was here ####
 100	100	100	100
 200	200	200	200
-fRHAbs52npY0rAF1I1Npfg==
+NULL	NULL	148	NULL
+NULL	NULL	48	NULL
+NULL	NULL	NULL	135
+NULL	NULL	NULL	35
+UBr9lyqgsjDFvooMgQlZ9w==

http://git-wip-us.apache.org/repos/asf/hive/blob/e084f4d6/ql/src/test/results/clientpositive/mapjoin1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/mapjoin1.q.out b/ql/src/test/results/clientpositive/mapjoin1.q.out
index 207e8c3..ecd4ce0 100644
--- a/ql/src/test/results/clientpositive/mapjoin1.q.out
+++ b/ql/src/test/results/clientpositive/mapjoin1.q.out
@@ -326,6 +326,9 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             HashTable Sink Operator
+              filter predicates:
+                0 
+                1 {true}
               keys:
                 0 key (type: string)
                 1 key (type: string)
@@ -339,6 +342,9 @@ STAGE PLANS:
             Map Join Operator
               condition map:
                    Right Outer Join0 to 1
+              filter predicates:
+                0 
+                1 {true}
               keys:
                 0 key (type: string)
                 1 key (type: string)
@@ -408,13 +414,13 @@ STAGE PLANS:
           TableScan
             alias: a
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-            Filter Operator
-              predicate: ((key * 10) < '1000') (type: boolean)
-              Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
-              HashTable Sink Operator
-                keys:
-                  0 key (type: string)
-                  1 key (type: string)
+            HashTable Sink Operator
+              filter predicates:
+                0 
+                1 {((key * 10) < '1000')}
+              keys:
+                0 key (type: string)
+                1 key (type: string)
 
   Stage: Stage-1
     Map Reduce
@@ -422,31 +428,31 @@ STAGE PLANS:
           TableScan
             alias: b
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-            Filter Operator
-              predicate: ((key * 10) < '1000') (type: boolean)
-              Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
-              Map Join Operator
-                condition map:
-                     Right Outer Join0 to 1
-                keys:
-                  0 key (type: string)
-                  1 key (type: string)
-                outputColumnNames: _col0, _col1, _col5, _col6
-                Statistics: Num rows: 182 Data size: 1939 Basic stats: COMPLETE Column stats: NONE
-                Select Operator
-                  expressions: _col0 (type: string), _col1 (type: string), _col5 (type: string), _col6 (type: string)
-                  outputColumnNames: _col0, _col1, _col2, _col3
-                  Statistics: Num rows: 182 Data size: 1939 Basic stats: COMPLETE Column stats: NONE
-                  Limit
-                    Number of rows: 10
+            Map Join Operator
+              condition map:
+                   Right Outer Join0 to 1
+              filter predicates:
+                0 
+                1 {((key * 10) < '1000')}
+              keys:
+                0 key (type: string)
+                1 key (type: string)
+              outputColumnNames: _col0, _col1, _col5, _col6
+              Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
+              Select Operator
+                expressions: _col0 (type: string), _col1 (type: string), _col5 (type: string), _col6 (type: string)
+                outputColumnNames: _col0, _col1, _col2, _col3
+                Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
+                Limit
+                  Number of rows: 10
+                  Statistics: Num rows: 10 Data size: 100 Basic stats: COMPLETE Column stats: NONE
+                  File Output Operator
+                    compressed: false
                     Statistics: Num rows: 10 Data size: 100 Basic stats: COMPLETE Column stats: NONE
-                    File Output Operator
-                      compressed: false
-                      Statistics: Num rows: 10 Data size: 100 Basic stats: COMPLETE Column stats: NONE
-                      table:
-                          input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                          output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                          serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    table:
+                        input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                        output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                        serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
       Local Work:
         Map Reduce Local Work
 
@@ -464,16 +470,16 @@ POSTHOOK: query: SELECT /*+ MAPJOIN(a) */ * FROM src a RIGHT OUTER JOIN src b on
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src
 #### A masked pattern was here ####
+NULL	NULL	238	val_238
 86	val_86	86	val_86
+NULL	NULL	311	val_311
 27	val_27	27	val_27
+NULL	NULL	165	val_165
+NULL	NULL	409	val_409
+NULL	NULL	255	val_255
+NULL	NULL	278	val_278
 98	val_98	98	val_98
 98	val_98	98	val_98
-66	val_66	66	val_66
-37	val_37	37	val_37
-37	val_37	37	val_37
-15	val_15	15	val_15
-15	val_15	15	val_15
-82	val_82	82	val_82
 PREHOOK: query: EXPLAIN
 SELECT /*+ MAPJOIN(a) */ * FROM src a RIGHT OUTER JOIN
     (select key, named_struct('key', key, 'value', value) as kv from src) b on a.key=b.key AND b.kv.key > 200 limit 10
@@ -500,6 +506,9 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             HashTable Sink Operator
+              filter predicates:
+                0 
+                1 {(_col1.key > 200)}
               keys:
                 0 key (type: string)
                 1 _col0 (type: string)
@@ -514,31 +523,31 @@ STAGE PLANS:
               expressions: key (type: string), named_struct('key',key,'value',value) (type: struct<key:string,value:string>)
               outputColumnNames: _col0, _col1
               Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-              Filter Operator
-                predicate: (_col1.key > 200) (type: boolean)
-                Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
-                Map Join Operator
-                  condition map:
-                       Right Outer Join0 to 1
-                  keys:
-                    0 key (type: string)
-                    1 _col0 (type: string)
-                  outputColumnNames: _col0, _col1, _col5, _col6
+              Map Join Operator
+                condition map:
+                     Right Outer Join0 to 1
+                filter predicates:
+                  0 
+                  1 {(_col1.key > 200)}
+                keys:
+                  0 key (type: string)
+                  1 _col0 (type: string)
+                outputColumnNames: _col0, _col1, _col5, _col6
+                Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
+                Select Operator
+                  expressions: _col0 (type: string), _col1 (type: string), _col5 (type: string), _col6 (type: struct<key:string,value:string>)
+                  outputColumnNames: _col0, _col1, _col2, _col3
                   Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
-                  Select Operator
-                    expressions: _col0 (type: string), _col1 (type: string), _col5 (type: string), _col6 (type: struct<key:string,value:string>)
-                    outputColumnNames: _col0, _col1, _col2, _col3
-                    Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
-                    Limit
-                      Number of rows: 10
+                  Limit
+                    Number of rows: 10
+                    Statistics: Num rows: 10 Data size: 100 Basic stats: COMPLETE Column stats: NONE
+                    File Output Operator
+                      compressed: false
                       Statistics: Num rows: 10 Data size: 100 Basic stats: COMPLETE Column stats: NONE
-                      File Output Operator
-                        compressed: false
-                        Statistics: Num rows: 10 Data size: 100 Basic stats: COMPLETE Column stats: NONE
-                        table:
-                            input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                            output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                            serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                      table:
+                          input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                          output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                          serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
       Local Work:
         Map Reduce Local Work
 
@@ -560,11 +569,11 @@ POSTHOOK: Input: default@src
 #### A masked pattern was here ####
 238	val_238	238	{"key":"238","value":"val_238"}
 238	val_238	238	{"key":"238","value":"val_238"}
+NULL	NULL	86	{"key":"86","value":"val_86"}
 311	val_311	311	{"key":"311","value":"val_311"}
 311	val_311	311	{"key":"311","value":"val_311"}
 311	val_311	311	{"key":"311","value":"val_311"}
+NULL	NULL	27	{"key":"27","value":"val_27"}
+NULL	NULL	165	{"key":"165","value":"val_165"}
 409	val_409	409	{"key":"409","value":"val_409"}
 409	val_409	409	{"key":"409","value":"val_409"}
-409	val_409	409	{"key":"409","value":"val_409"}
-255	val_255	255	{"key":"255","value":"val_255"}
-255	val_255	255	{"key":"255","value":"val_255"}

http://git-wip-us.apache.org/repos/asf/hive/blob/e084f4d6/ql/src/test/results/clientpositive/spark/auto_join_filters.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/auto_join_filters.q.out b/ql/src/test/results/clientpositive/spark/auto_join_filters.q.out
index 85b2a32..c00fdf1 100644
--- a/ql/src/test/results/clientpositive/spark/auto_join_filters.q.out
+++ b/ql/src/test/results/clientpositive/spark/auto_join_filters.q.out
@@ -310,7 +310,7 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 3078400
-Warning: Map Join MAPJOIN[19][bigTable=?] in task 'Stage-1:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[16][bigTable=?] in task 'Stage-1:MAPRED' is a cross product
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a LEFT OUTER JOIN myinput1 b on a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -319,8 +319,8 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a L
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-3078400
-Warning: Map Join MAPJOIN[19][bigTable=?] in task 'Stage-1:MAPRED' is a cross product
+4937935
+Warning: Map Join MAPJOIN[16][bigTable=?] in task 'Stage-1:MAPRED' is a cross product
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a RIGHT OUTER JOIN myinput1 b on a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -329,8 +329,8 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a R
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-3078400
-Warning: Shuffle Join JOIN[12][tables = [$hdt$_0, $hdt$_1]] in Work 'Reducer 2' is a cross product
+3080335
+Warning: Shuffle Join JOIN[6][tables = [$hdt$_0, $hdt$_1]] in Work 'Reducer 2' is a cross product
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a FULL OUTER JOIN myinput1 b on a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -339,7 +339,7 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a F
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-3078400
+4939870
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a JOIN myinput1 b ON a.key = b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -384,7 +384,7 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a L
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-3078400
+4937935
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a LEFT OUTER JOIN myinput1 b ON a.value = b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -393,7 +393,7 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a L
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-3078400
+4937935
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a LEFT OUTER JOIN myinput1 b ON a.key = b.key AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -402,7 +402,7 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a L
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-3078400
+4937935
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a LEFT OUTER JOIN myinput1 b ON a.key = b.key and a.value=b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -411,7 +411,7 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a L
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-3078400
+4937935
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a RIGHT OUTER JOIN myinput1 b ON a.key = b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -420,7 +420,7 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a R
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-3078400
+3080335
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a RIGHT OUTER JOIN myinput1 b ON a.key = b.key AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -429,7 +429,7 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a R
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-3078400
+3080335
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a RIGHT OUTER JOIN myinput1 b ON a.value = b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -438,7 +438,7 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a R
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-3078400
+3080335
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a RIGHT OUTER JOIN myinput1 b ON a.key=b.key and a.value = b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -447,7 +447,7 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a R
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-3078400
+3080335
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a FULL OUTER JOIN myinput1 b ON a.key = b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -456,7 +456,7 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a F
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-3078400
+4939870
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a FULL OUTER JOIN myinput1 b ON a.key = b.key AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -465,7 +465,7 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a F
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-3078400
+4939870
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a FULL OUTER JOIN myinput1 b ON a.value = b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -474,7 +474,7 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a F
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-3078400
+4939870
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a FULL OUTER JOIN myinput1 b ON a.value = b.value and a.key=b.key AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -483,7 +483,7 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a F
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-3078400
+4939870
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) from myinput1 a LEFT OUTER JOIN myinput1 b ON (a.value=b.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value) RIGHT OUTER JOIN myinput1 c ON (b.value=c.value AND c.key > 40 AND c.value > 50 AND c.key = c.value AND b.key > 40 AND b.value > 50 AND b.key = b.value)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -501,7 +501,7 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) from myinput1 a R
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-3078400
+3080335
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a LEFT OUTER JOIN myinput1 b RIGHT OUTER JOIN myinput1 c ON a.value = b.value and b.value = c.value AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value AND c.key > 40 AND c.value > 50 AND c.key = c.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -528,7 +528,7 @@ POSTHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) from myinput1 a R
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
-3078400
+3080335
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a LEFT OUTER JOIN myinput1 b RIGHT OUTER JOIN myinput1 c ON a.value = b.value and b.key = c.key AND a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value AND c.key > 40 AND c.value > 50 AND c.key = c.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1


Mime
View raw message