You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ha...@apache.org on 2017/08/11 23:48:34 UTC

[1/2] hive git commit: HIVE-17148 : Incorrect result for Hive join query with COALESCE in WHERE condition (Vlad Gudikov via Ashutosh Chauhan)

Repository: hive
Updated Branches:
  refs/heads/master 51067945c -> 3a3ffaa90


http://git-wip-us.apache.org/repos/asf/hive/blob/3a3ffaa9/ql/src/test/results/clientpositive/spark/smb_mapjoin_15.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/smb_mapjoin_15.q.out b/ql/src/test/results/clientpositive/spark/smb_mapjoin_15.q.out
index 1916075..9ce04d8 100644
--- a/ql/src/test/results/clientpositive/spark/smb_mapjoin_15.q.out
+++ b/ql/src/test/results/clientpositive/spark/smb_mapjoin_15.q.out
@@ -618,7 +618,7 @@ STAGE PLANS:
                   GatherStats: false
                   Filter Operator
                     isSamplingPred: false
-                    predicate: (key is not null and key2 is not null) (type: boolean)
+                    predicate: (key2 is not null and key is not null) (type: boolean)
                     Statistics: Num rows: 500 Data size: 7218 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int), key2 (type: int), value (type: string)
@@ -696,7 +696,7 @@ STAGE PLANS:
                   GatherStats: false
                   Filter Operator
                     isSamplingPred: false
-                    predicate: (key is not null and key2 is not null) (type: boolean)
+                    predicate: (key2 is not null and key is not null) (type: boolean)
                     Statistics: Num rows: 500 Data size: 7218 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int), key2 (type: int), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/3a3ffaa9/ql/src/test/results/clientpositive/spark/subquery_in.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/subquery_in.q.out b/ql/src/test/results/clientpositive/spark/subquery_in.q.out
index 8bc1783..8912450 100644
--- a/ql/src/test/results/clientpositive/spark/subquery_in.q.out
+++ b/ql/src/test/results/clientpositive/spark/subquery_in.q.out
@@ -1697,7 +1697,7 @@ STAGE PLANS:
                   alias: part
                   Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: p_retailprice is not null (type: boolean)
+                    predicate: floor(p_retailprice) 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_name (type: string), p_mfgr (type: string), p_brand (type: string), p_type (type: string), p_size (type: int), p_container (type: string), p_retailprice (type: double), p_comment (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/3a3ffaa9/ql/src/test/results/clientpositive/vector_interval_mapjoin.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/vector_interval_mapjoin.q.out b/ql/src/test/results/clientpositive/vector_interval_mapjoin.q.out
index 84b9250..f914d28 100644
--- a/ql/src/test/results/clientpositive/vector_interval_mapjoin.q.out
+++ b/ql/src/test/results/clientpositive/vector_interval_mapjoin.q.out
@@ -202,7 +202,7 @@ STAGE PLANS:
             alias: vectortab_b_1korc
             Statistics: Num rows: 1000 Data size: 458448 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (s is not null and dt is not null and ts is not null) (type: boolean)
+              predicate: (dt is not null and ts is not null and s is not null) (type: boolean)
               Statistics: Num rows: 1000 Data size: 458448 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: s (type: string), (dt - CAST( ts AS DATE)) (type: interval_day_time)
@@ -226,8 +226,8 @@ STAGE PLANS:
               Filter Vectorization:
                   className: VectorFilterOperator
                   native: true
-                  predicateExpression: FilterExprAndExpr(children: SelectColumnIsNotNull(col 8) -> boolean, SelectColumnIsNotNull(col 12) -> boolean, SelectColumnIsNotNull(col 10) -> boolean) -> boolean
-              predicate: (s is not null and dt is not null and ts is not null) (type: boolean)
+                  predicateExpression: FilterExprAndExpr(children: SelectColumnIsNotNull(col 12) -> boolean, SelectColumnIsNotNull(col 10) -> boolean, SelectColumnIsNotNull(col 8) -> boolean) -> boolean
+              predicate: (dt is not null and ts is not null and s is not null) (type: boolean)
               Statistics: Num rows: 1000 Data size: 460264 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: s (type: string), (dt - CAST( ts AS DATE)) (type: interval_day_time)


[2/2] hive git commit: HIVE-17148 : Incorrect result for Hive join query with COALESCE in WHERE condition (Vlad Gudikov via Ashutosh Chauhan)

Posted by ha...@apache.org.
HIVE-17148 : Incorrect result for Hive join query with COALESCE in WHERE condition (Vlad Gudikov via Ashutosh Chauhan)

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


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

Branch: refs/heads/master
Commit: 3a3ffaa9013e82b31917553d0592f94af00589a4
Parents: 5106794
Author: Vlad Gudikov <vg...@gmail.com>
Authored: Fri Aug 11 16:47:00 2017 -0700
Committer: Ashutosh Chauhan <ha...@apache.org>
Committed: Fri Aug 11 16:47:00 2017 -0700

----------------------------------------------------------------------
 .../calcite/rules/HiveJoinAddNotNullRule.java   |  42 ++--
 ql/src/test/queries/clientpositive/innerjoin1.q |  19 ++
 .../clientpositive/annotate_stats_join.q.out    |  12 +-
 .../clientpositive/correlated_join_keys.q.out   |   8 +-
 .../results/clientpositive/innerjoin1.q.out     | 214 +++++++++++++++++++
 .../results/clientpositive/llap/lineage2.q.out  |   2 +-
 .../clientpositive/llap/smb_mapjoin_15.q.out    |   4 +-
 .../clientpositive/llap/subquery_in.q.out       |   2 +-
 .../clientpositive/llap/subquery_select.q.out   |  12 +-
 .../llap/vector_interval_mapjoin.q.out          |   8 +-
 .../clientpositive/nested_column_pruning.q.out  |  42 ++--
 .../results/clientpositive/perf/query17.q.out   |   4 +-
 .../results/clientpositive/perf/query24.q.out   |   6 +-
 .../results/clientpositive/perf/query25.q.out   |   4 +-
 .../results/clientpositive/perf/query29.q.out   |   4 +-
 .../results/clientpositive/perf/query30.q.out   |   2 +-
 .../results/clientpositive/perf/query49.q.out   |   6 +-
 .../results/clientpositive/perf/query5.q.out    |   2 +-
 .../results/clientpositive/perf/query50.q.out   |   4 +-
 .../results/clientpositive/perf/query64.q.out   |   6 +-
 .../results/clientpositive/perf/query8.q.out    |   6 +-
 .../results/clientpositive/perf/query81.q.out   |   2 +-
 .../results/clientpositive/perf/query85.q.out   |   2 +-
 .../test/results/clientpositive/semijoin4.q.out |   2 +-
 .../test/results/clientpositive/semijoin5.q.out |   4 +-
 .../spark/annotate_stats_join.q.out             |  12 +-
 .../clientpositive/spark/smb_mapjoin_15.q.out   |   4 +-
 .../clientpositive/spark/subquery_in.q.out      |   2 +-
 .../vector_interval_mapjoin.q.out               |   6 +-
 29 files changed, 337 insertions(+), 106 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/3a3ffaa9/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveJoinAddNotNullRule.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveJoinAddNotNullRule.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveJoinAddNotNullRule.java
index 1cb6a08..01e0d87 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveJoinAddNotNullRule.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveJoinAddNotNullRule.java
@@ -17,7 +17,7 @@
  */
 package org.apache.hadoop.hive.ql.optimizer.calcite.rules;
 
-import java.util.HashSet;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
@@ -29,7 +29,6 @@ import org.apache.calcite.rel.core.Join;
 import org.apache.calcite.rel.core.JoinRelType;
 import org.apache.calcite.rel.core.RelFactories;
 import org.apache.calcite.rel.core.RelFactories.FilterFactory;
-import org.apache.calcite.rel.type.RelDataType;
 import org.apache.calcite.rex.RexBuilder;
 import org.apache.calcite.rex.RexNode;
 import org.apache.calcite.rex.RexUtil;
@@ -91,14 +90,12 @@ public final class HiveJoinAddNotNullRule extends RelOptRule {
     } catch (CalciteSemanticException e) {
       return;
     }
-
-    Set<Integer> joinLeftKeyPositions = new HashSet<Integer>();
-    Set<Integer> joinRightKeyPositions = new HashSet<Integer>();
-    for (int i = 0; i < joinPredInfo.getEquiJoinPredicateElements().size(); i++) {
-      JoinLeafPredicateInfo joinLeafPredInfo = joinPredInfo.
-              getEquiJoinPredicateElements().get(i);
-      joinLeftKeyPositions.addAll(joinLeafPredInfo.getProjsFromLeftPartOfJoinKeysInChildSchema());
-      joinRightKeyPositions.addAll(joinLeafPredInfo.getProjsFromRightPartOfJoinKeysInChildSchema());
+    
+    List<RexNode> leftJoinExprsList = new ArrayList<>();
+    List<RexNode> rightJoinExprsList = new ArrayList<>();
+    for (JoinLeafPredicateInfo joinLeafPredicateInfo : joinPredInfo.getEquiJoinPredicateElements()) {
+        leftJoinExprsList.addAll(joinLeafPredicateInfo.getJoinExprs(0));
+        rightJoinExprsList.addAll(joinLeafPredicateInfo.getJoinExprs(1));
     }
 
     // Build not null conditions
@@ -107,10 +104,10 @@ public final class HiveJoinAddNotNullRule extends RelOptRule {
 
     Set<String> leftPushedPredicates = Sets.newHashSet(registry.getPushedPredicates(join, 0));
     final List<RexNode> newLeftConditions = getNotNullConditions(cluster,
-            rexBuilder, join.getLeft(), joinLeftKeyPositions, leftPushedPredicates);
+            rexBuilder, leftJoinExprsList, leftPushedPredicates);
     Set<String> rightPushedPredicates = Sets.newHashSet(registry.getPushedPredicates(join, 1));
     final List<RexNode> newRightConditions = getNotNullConditions(cluster,
-            rexBuilder, join.getRight(), joinRightKeyPositions, rightPushedPredicates);
+            rexBuilder, rightJoinExprsList, rightPushedPredicates);
 
     // Nothing will be added to the expression
     RexNode newLeftPredicate = RexUtil.composeConjunction(rexBuilder, newLeftConditions, false);
@@ -142,21 +139,16 @@ public final class HiveJoinAddNotNullRule extends RelOptRule {
   }
 
   private static List<RexNode> getNotNullConditions(RelOptCluster cluster,
-          RexBuilder rexBuilder, RelNode input, Set<Integer> inputKeyPositions,
+          RexBuilder rexBuilder, List<RexNode> inputJoinExprs,
           Set<String> pushedPredicates) {
     final List<RexNode> newConditions = Lists.newArrayList();
-    for (int pos : inputKeyPositions) {
-      RelDataType keyType = input.getRowType().getFieldList().get(pos).getType();
-      // Nothing to do if key cannot be null
-      if (!keyType.isNullable()) {
-        continue;
-      }
-      RexNode cond = rexBuilder.makeCall(SqlStdOperatorTable.IS_NOT_NULL,
-              rexBuilder.makeInputRef(input, pos));
-      String digest = cond.toString();
-      if (pushedPredicates.add(digest)) {
-        newConditions.add(cond);
-      }
+
+    for (RexNode rexNode : inputJoinExprs) {
+        RexNode cond = rexBuilder.makeCall(SqlStdOperatorTable.IS_NOT_NULL, rexNode);
+        String digest = cond.toString();
+        if (pushedPredicates.add(digest)) {
+            newConditions.add(cond);
+        }
     }
     return newConditions;
   }

http://git-wip-us.apache.org/repos/asf/hive/blob/3a3ffaa9/ql/src/test/queries/clientpositive/innerjoin1.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/innerjoin1.q b/ql/src/test/queries/clientpositive/innerjoin1.q
new file mode 100644
index 0000000..5e168e7
--- /dev/null
+++ b/ql/src/test/queries/clientpositive/innerjoin1.q
@@ -0,0 +1,19 @@
+set hive.mapred.mode=nonstrict;
+set hive.input.format=org.apache.hadoop.hive.ql.io.HiveInputFormat;
+
+DROP TABLE IF EXISTS innerjoinsrc1;
+DROP TABLE IF EXISTS innerjoinsrc2;
+
+CREATE TABLE innerjoinsrc1 (a1 STRING, a2 STRING);
+CREATE TABLE innerjoinsrc2 (b1 STRING, b2 STRING);
+
+INSERT INTO TABLE innerjoinsrc1 (a1) VALUES ('1');
+INSERT INTO TABLE innerjoinsrc1 VALUES ('2', '2');
+INSERT INTO TABLE innerjoinsrc2 (b1) VALUES ('1');
+INSERT INTO TABLE innerjoinsrc2 VALUES ('2', '2');
+
+EXPLAIN SELECT * FROM innerjoinsrc1 c1, innerjoinsrc2 c2 WHERE COALESCE(a1,a2)=COALESCE(b1,b2);
+SELECT * FROM innerjoinsrc1 c1, innerjoinsrc2 c2 WHERE COALESCE(a1,a2)=COALESCE(b1,b2);
+
+EXPLAIN SELECT * FROM innerjoinsrc1 c1 inner join innerjoinsrc2 c2 ON (COALESCE(a1,a2)=COALESCE(b1,b2));
+SELECT * FROM innerjoinsrc1 c1 inner join innerjoinsrc2 c2 ON (COALESCE(a1,a2)=COALESCE(b1,b2));
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/3a3ffaa9/ql/src/test/results/clientpositive/annotate_stats_join.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/annotate_stats_join.q.out b/ql/src/test/results/clientpositive/annotate_stats_join.q.out
index 736016f..d24324a 100644
--- a/ql/src/test/results/clientpositive/annotate_stats_join.q.out
+++ b/ql/src/test/results/clientpositive/annotate_stats_join.q.out
@@ -201,7 +201,7 @@ STAGE PLANS:
             alias: emp
             Statistics: Num rows: 48 Data size: 4752 Basic stats: COMPLETE Column stats: COMPLETE
             Filter Operator
-              predicate: (lastname is not null and deptid is not null) (type: boolean)
+              predicate: (deptid is not null and lastname is not null) (type: boolean)
               Statistics: Num rows: 48 Data size: 4752 Basic stats: COMPLETE Column stats: COMPLETE
               Select Operator
                 expressions: lastname (type: string), deptid (type: int), locid (type: int)
@@ -267,7 +267,7 @@ STAGE PLANS:
             alias: e
             Statistics: Num rows: 48 Data size: 4752 Basic stats: COMPLETE Column stats: COMPLETE
             Filter Operator
-              predicate: (lastname is not null and deptid is not null) (type: boolean)
+              predicate: (deptid is not null and lastname is not null) (type: boolean)
               Statistics: Num rows: 48 Data size: 4752 Basic stats: COMPLETE Column stats: COMPLETE
               Select Operator
                 expressions: lastname (type: string), deptid (type: int), locid (type: int)
@@ -333,7 +333,7 @@ STAGE PLANS:
             alias: emp
             Statistics: Num rows: 48 Data size: 4752 Basic stats: COMPLETE Column stats: COMPLETE
             Filter Operator
-              predicate: (lastname is not null and deptid is not null) (type: boolean)
+              predicate: (deptid is not null and lastname is not null) (type: boolean)
               Statistics: Num rows: 48 Data size: 4752 Basic stats: COMPLETE Column stats: COMPLETE
               Select Operator
                 expressions: lastname (type: string), deptid (type: int), locid (type: int)
@@ -569,7 +569,7 @@ STAGE PLANS:
             alias: e
             Statistics: Num rows: 48 Data size: 4752 Basic stats: COMPLETE Column stats: COMPLETE
             Filter Operator
-              predicate: (lastname is not null and deptid is not null) (type: boolean)
+              predicate: (deptid is not null and lastname is not null) (type: boolean)
               Statistics: Num rows: 48 Data size: 4752 Basic stats: COMPLETE Column stats: COMPLETE
               Select Operator
                 expressions: lastname (type: string), deptid (type: int), locid (type: int)
@@ -600,7 +600,7 @@ STAGE PLANS:
             alias: l
             Statistics: Num rows: 8 Data size: 816 Basic stats: COMPLETE Column stats: COMPLETE
             Filter Operator
-              predicate: (state is not null and locid is not null) (type: boolean)
+              predicate: (locid is not null and state is not null) (type: boolean)
               Statistics: Num rows: 8 Data size: 816 Basic stats: COMPLETE Column stats: COMPLETE
               Select Operator
                 expressions: state (type: string), locid (type: int), zip (type: bigint), year (type: int)
@@ -713,7 +713,7 @@ STAGE PLANS:
             alias: emp
             Statistics: Num rows: 48 Data size: 4752 Basic stats: COMPLETE Column stats: COMPLETE
             Filter Operator
-              predicate: (lastname is not null and deptid is not null) (type: boolean)
+              predicate: (deptid is not null and lastname is not null) (type: boolean)
               Statistics: Num rows: 48 Data size: 4752 Basic stats: COMPLETE Column stats: COMPLETE
               Select Operator
                 expressions: lastname (type: string), deptid (type: int), locid (type: int)

http://git-wip-us.apache.org/repos/asf/hive/blob/3a3ffaa9/ql/src/test/results/clientpositive/correlated_join_keys.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/correlated_join_keys.q.out b/ql/src/test/results/clientpositive/correlated_join_keys.q.out
index b81a561..5464cd3 100644
--- a/ql/src/test/results/clientpositive/correlated_join_keys.q.out
+++ b/ql/src/test/results/clientpositive/correlated_join_keys.q.out
@@ -83,7 +83,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 20 Data size: 3500 Basic stats: COMPLETE Column stats: COMPLETE
             Filter Operator
-              predicate: (ca_state is not null and ca_zip is not null) (type: boolean)
+              predicate: (ca_zip is not null and ca_state is not null) (type: boolean)
               Statistics: Num rows: 20 Data size: 3500 Basic stats: COMPLETE Column stats: COMPLETE
               Select Operator
                 expressions: ca_state (type: string), ca_zip (type: string)
@@ -98,7 +98,7 @@ STAGE PLANS:
             alias: b
             Statistics: Num rows: 20 Data size: 3500 Basic stats: COMPLETE Column stats: COMPLETE
             Filter Operator
-              predicate: (ca_state is not null and ca_zip is not null) (type: boolean)
+              predicate: (ca_zip is not null and ca_state is not null) (type: boolean)
               Statistics: Num rows: 20 Data size: 3500 Basic stats: COMPLETE Column stats: COMPLETE
               Select Operator
                 expressions: ca_state (type: string), ca_zip (type: string)
@@ -174,7 +174,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 20 Data size: 3500 Basic stats: COMPLETE Column stats: COMPLETE
             Filter Operator
-              predicate: (ca_state is not null and ca_zip is not null) (type: boolean)
+              predicate: (ca_zip is not null and ca_state is not null) (type: boolean)
               Statistics: Num rows: 20 Data size: 3500 Basic stats: COMPLETE Column stats: COMPLETE
               Select Operator
                 expressions: ca_state (type: string), ca_zip (type: string)
@@ -189,7 +189,7 @@ STAGE PLANS:
             alias: b
             Statistics: Num rows: 20 Data size: 3500 Basic stats: COMPLETE Column stats: COMPLETE
             Filter Operator
-              predicate: (ca_state is not null and ca_zip is not null) (type: boolean)
+              predicate: (ca_zip is not null and ca_state is not null) (type: boolean)
               Statistics: Num rows: 20 Data size: 3500 Basic stats: COMPLETE Column stats: COMPLETE
               Select Operator
                 expressions: ca_state (type: string), ca_zip (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/3a3ffaa9/ql/src/test/results/clientpositive/innerjoin1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/innerjoin1.q.out b/ql/src/test/results/clientpositive/innerjoin1.q.out
new file mode 100644
index 0000000..90c6d43
--- /dev/null
+++ b/ql/src/test/results/clientpositive/innerjoin1.q.out
@@ -0,0 +1,214 @@
+PREHOOK: query: DROP TABLE IF EXISTS innerjoinsrc1
+PREHOOK: type: DROPTABLE
+POSTHOOK: query: DROP TABLE IF EXISTS innerjoinsrc1
+POSTHOOK: type: DROPTABLE
+PREHOOK: query: DROP TABLE IF EXISTS innerjoinsrc2
+PREHOOK: type: DROPTABLE
+POSTHOOK: query: DROP TABLE IF EXISTS innerjoinsrc2
+POSTHOOK: type: DROPTABLE
+PREHOOK: query: CREATE TABLE innerjoinsrc1 (a1 STRING, a2 STRING)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@innerjoinsrc1
+POSTHOOK: query: CREATE TABLE innerjoinsrc1 (a1 STRING, a2 STRING)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@innerjoinsrc1
+PREHOOK: query: CREATE TABLE innerjoinsrc2 (b1 STRING, b2 STRING)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@innerjoinsrc2
+POSTHOOK: query: CREATE TABLE innerjoinsrc2 (b1 STRING, b2 STRING)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@innerjoinsrc2
+PREHOOK: query: INSERT INTO TABLE innerjoinsrc1 (a1) VALUES ('1')
+PREHOOK: type: QUERY
+PREHOOK: Output: default@innerjoinsrc1
+POSTHOOK: query: INSERT INTO TABLE innerjoinsrc1 (a1) VALUES ('1')
+POSTHOOK: type: QUERY
+POSTHOOK: Output: default@innerjoinsrc1
+POSTHOOK: Lineage: innerjoinsrc1.a1 SIMPLE [(values__tmp__table__1)values__tmp__table__1.FieldSchema(name:tmp_values_col1, type:string, comment:), ]
+POSTHOOK: Lineage: innerjoinsrc1.a2 SIMPLE []
+PREHOOK: query: INSERT INTO TABLE innerjoinsrc1 VALUES ('2', '2')
+PREHOOK: type: QUERY
+PREHOOK: Output: default@innerjoinsrc1
+POSTHOOK: query: INSERT INTO TABLE innerjoinsrc1 VALUES ('2', '2')
+POSTHOOK: type: QUERY
+POSTHOOK: Output: default@innerjoinsrc1
+POSTHOOK: Lineage: innerjoinsrc1.a1 SIMPLE [(values__tmp__table__2)values__tmp__table__2.FieldSchema(name:tmp_values_col1, type:string, comment:), ]
+POSTHOOK: Lineage: innerjoinsrc1.a2 SIMPLE [(values__tmp__table__2)values__tmp__table__2.FieldSchema(name:tmp_values_col2, type:string, comment:), ]
+PREHOOK: query: INSERT INTO TABLE innerjoinsrc2 (b1) VALUES ('1')
+PREHOOK: type: QUERY
+PREHOOK: Output: default@innerjoinsrc2
+POSTHOOK: query: INSERT INTO TABLE innerjoinsrc2 (b1) VALUES ('1')
+POSTHOOK: type: QUERY
+POSTHOOK: Output: default@innerjoinsrc2
+POSTHOOK: Lineage: innerjoinsrc2.b1 SIMPLE [(values__tmp__table__3)values__tmp__table__3.FieldSchema(name:tmp_values_col1, type:string, comment:), ]
+POSTHOOK: Lineage: innerjoinsrc2.b2 SIMPLE []
+PREHOOK: query: INSERT INTO TABLE innerjoinsrc2 VALUES ('2', '2')
+PREHOOK: type: QUERY
+PREHOOK: Output: default@innerjoinsrc2
+POSTHOOK: query: INSERT INTO TABLE innerjoinsrc2 VALUES ('2', '2')
+POSTHOOK: type: QUERY
+POSTHOOK: Output: default@innerjoinsrc2
+POSTHOOK: Lineage: innerjoinsrc2.b1 SIMPLE [(values__tmp__table__4)values__tmp__table__4.FieldSchema(name:tmp_values_col1, type:string, comment:), ]
+POSTHOOK: Lineage: innerjoinsrc2.b2 SIMPLE [(values__tmp__table__4)values__tmp__table__4.FieldSchema(name:tmp_values_col2, type:string, comment:), ]
+PREHOOK: query: EXPLAIN SELECT * FROM innerjoinsrc1 c1, innerjoinsrc2 c2 WHERE COALESCE(a1,a2)=COALESCE(b1,b2)
+PREHOOK: type: QUERY
+POSTHOOK: query: EXPLAIN SELECT * FROM innerjoinsrc1 c1, innerjoinsrc2 c2 WHERE COALESCE(a1,a2)=COALESCE(b1,b2)
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            alias: c1
+            Statistics: Num rows: 2 Data size: 7 Basic stats: COMPLETE Column stats: NONE
+            Filter Operator
+              predicate: COALESCE(a1,a2) is not null (type: boolean)
+              Statistics: Num rows: 2 Data size: 7 Basic stats: COMPLETE Column stats: NONE
+              Select Operator
+                expressions: a1 (type: string), a2 (type: string)
+                outputColumnNames: _col0, _col1
+                Statistics: Num rows: 2 Data size: 7 Basic stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  key expressions: COALESCE(_col0,_col1) (type: string)
+                  sort order: +
+                  Map-reduce partition columns: COALESCE(_col0,_col1) (type: string)
+                  Statistics: Num rows: 2 Data size: 7 Basic stats: COMPLETE Column stats: NONE
+                  value expressions: _col0 (type: string), _col1 (type: string)
+          TableScan
+            alias: c2
+            Statistics: Num rows: 2 Data size: 7 Basic stats: COMPLETE Column stats: NONE
+            Filter Operator
+              predicate: COALESCE(b1,b2) is not null (type: boolean)
+              Statistics: Num rows: 2 Data size: 7 Basic stats: COMPLETE Column stats: NONE
+              Select Operator
+                expressions: b1 (type: string), b2 (type: string)
+                outputColumnNames: _col0, _col1
+                Statistics: Num rows: 2 Data size: 7 Basic stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  key expressions: COALESCE(_col0,_col1) (type: string)
+                  sort order: +
+                  Map-reduce partition columns: COALESCE(_col0,_col1) (type: string)
+                  Statistics: Num rows: 2 Data size: 7 Basic stats: COMPLETE Column stats: NONE
+                  value expressions: _col0 (type: string), _col1 (type: string)
+      Reduce Operator Tree:
+        Join Operator
+          condition map:
+               Inner Join 0 to 1
+          keys:
+            0 COALESCE(_col0,_col1) (type: string)
+            1 COALESCE(_col0,_col1) (type: string)
+          outputColumnNames: _col0, _col1, _col2, _col3
+          Statistics: Num rows: 2 Data size: 7 Basic stats: COMPLETE Column stats: NONE
+          File Output Operator
+            compressed: false
+            Statistics: Num rows: 2 Data size: 7 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
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: SELECT * FROM innerjoinsrc1 c1, innerjoinsrc2 c2 WHERE COALESCE(a1,a2)=COALESCE(b1,b2)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@innerjoinsrc1
+PREHOOK: Input: default@innerjoinsrc2
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT * FROM innerjoinsrc1 c1, innerjoinsrc2 c2 WHERE COALESCE(a1,a2)=COALESCE(b1,b2)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@innerjoinsrc1
+POSTHOOK: Input: default@innerjoinsrc2
+#### A masked pattern was here ####
+1	NULL	1	NULL
+2	2	2	2
+PREHOOK: query: EXPLAIN SELECT * FROM innerjoinsrc1 c1 inner join innerjoinsrc2 c2 ON (COALESCE(a1,a2)=COALESCE(b1,b2))
+PREHOOK: type: QUERY
+POSTHOOK: query: EXPLAIN SELECT * FROM innerjoinsrc1 c1 inner join innerjoinsrc2 c2 ON (COALESCE(a1,a2)=COALESCE(b1,b2))
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            alias: c1
+            Statistics: Num rows: 2 Data size: 7 Basic stats: COMPLETE Column stats: NONE
+            Filter Operator
+              predicate: COALESCE(a1,a2) is not null (type: boolean)
+              Statistics: Num rows: 2 Data size: 7 Basic stats: COMPLETE Column stats: NONE
+              Select Operator
+                expressions: a1 (type: string), a2 (type: string)
+                outputColumnNames: _col0, _col1
+                Statistics: Num rows: 2 Data size: 7 Basic stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  key expressions: COALESCE(_col0,_col1) (type: string)
+                  sort order: +
+                  Map-reduce partition columns: COALESCE(_col0,_col1) (type: string)
+                  Statistics: Num rows: 2 Data size: 7 Basic stats: COMPLETE Column stats: NONE
+                  value expressions: _col0 (type: string), _col1 (type: string)
+          TableScan
+            alias: c2
+            Statistics: Num rows: 2 Data size: 7 Basic stats: COMPLETE Column stats: NONE
+            Filter Operator
+              predicate: COALESCE(b1,b2) is not null (type: boolean)
+              Statistics: Num rows: 2 Data size: 7 Basic stats: COMPLETE Column stats: NONE
+              Select Operator
+                expressions: b1 (type: string), b2 (type: string)
+                outputColumnNames: _col0, _col1
+                Statistics: Num rows: 2 Data size: 7 Basic stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  key expressions: COALESCE(_col0,_col1) (type: string)
+                  sort order: +
+                  Map-reduce partition columns: COALESCE(_col0,_col1) (type: string)
+                  Statistics: Num rows: 2 Data size: 7 Basic stats: COMPLETE Column stats: NONE
+                  value expressions: _col0 (type: string), _col1 (type: string)
+      Reduce Operator Tree:
+        Join Operator
+          condition map:
+               Inner Join 0 to 1
+          keys:
+            0 COALESCE(_col0,_col1) (type: string)
+            1 COALESCE(_col0,_col1) (type: string)
+          outputColumnNames: _col0, _col1, _col2, _col3
+          Statistics: Num rows: 2 Data size: 7 Basic stats: COMPLETE Column stats: NONE
+          File Output Operator
+            compressed: false
+            Statistics: Num rows: 2 Data size: 7 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
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: SELECT * FROM innerjoinsrc1 c1 inner join innerjoinsrc2 c2 ON (COALESCE(a1,a2)=COALESCE(b1,b2))
+PREHOOK: type: QUERY
+PREHOOK: Input: default@innerjoinsrc1
+PREHOOK: Input: default@innerjoinsrc2
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT * FROM innerjoinsrc1 c1 inner join innerjoinsrc2 c2 ON (COALESCE(a1,a2)=COALESCE(b1,b2))
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@innerjoinsrc1
+POSTHOOK: Input: default@innerjoinsrc2
+#### A masked pattern was here ####
+1	NULL	1	NULL
+2	2	2	2

http://git-wip-us.apache.org/repos/asf/hive/blob/3a3ffaa9/ql/src/test/results/clientpositive/llap/lineage2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/lineage2.q.out b/ql/src/test/results/clientpositive/llap/lineage2.q.out
index 051cba9..24ce094 100644
--- a/ql/src/test/results/clientpositive/llap/lineage2.q.out
+++ b/ql/src/test/results/clientpositive/llap/lineage2.q.out
@@ -480,7 +480,7 @@ PREHOOK: type: QUERY
 PREHOOK: Input: default@src1
 PREHOOK: Input: default@src2
 PREHOOK: Output: default@dest2
-{"version":"1.0","engine":"tez","database":"default","hash":"e9450a56b3d103642e06bef0e4f0d482","queryText":"insert into table dest2\n  select * from src1 JOIN src2 ON length(src1.value) = length(src2.value2) + 1","edges":[{"sources":[4],"targets":[0],"edgeType":"PROJECTION"},{"sources":[5],"targets":[1],"edgeType":"PROJECTION"},{"sources":[6],"targets":[2],"edgeType":"PROJECTION"},{"sources":[7],"targets":[3],"edgeType":"PROJECTION"},{"sources":[5],"targets":[0,1,2,3],"expression":"src1.value is not null","edgeType":"PREDICATE"},{"sources":[5,7],"targets":[0,1,2,3],"expression":"(length(src1.value) = (length(src2.value2) + 1))","edgeType":"PREDICATE"},{"sources":[7],"targets":[0,1,2,3],"expression":"src2.value2 is not null","edgeType":"PREDICATE"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"default.dest2.key"},{"id":1,"vertexType":"COLUMN","vertexId":"default.dest2.value"},{"id":2,"vertexType":"COLUMN","vertexId":"default.dest2.key2"},{"id":3,"vertexType":"COLUMN","vertex
 Id":"default.dest2.value2"},{"id":4,"vertexType":"COLUMN","vertexId":"default.src1.key"},{"id":5,"vertexType":"COLUMN","vertexId":"default.src1.value"},{"id":6,"vertexType":"COLUMN","vertexId":"default.src2.key2"},{"id":7,"vertexType":"COLUMN","vertexId":"default.src2.value2"}]}
+{"version":"1.0","engine":"tez","database":"default","hash":"e9450a56b3d103642e06bef0e4f0d482","queryText":"insert into table dest2\n  select * from src1 JOIN src2 ON length(src1.value) = length(src2.value2) + 1","edges":[{"sources":[4],"targets":[0],"edgeType":"PROJECTION"},{"sources":[5],"targets":[1],"edgeType":"PROJECTION"},{"sources":[6],"targets":[2],"edgeType":"PROJECTION"},{"sources":[7],"targets":[3],"edgeType":"PROJECTION"},{"sources":[5],"targets":[0,1,2,3],"expression":"length(src1.value) is not null","edgeType":"PREDICATE"},{"sources":[5,7],"targets":[0,1,2,3],"expression":"(length(src1.value) = (length(src2.value2) + 1))","edgeType":"PREDICATE"},{"sources":[7],"targets":[0,1,2,3],"expression":"length(src2.value2) is not null","edgeType":"PREDICATE"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"default.dest2.key"},{"id":1,"vertexType":"COLUMN","vertexId":"default.dest2.value"},{"id":2,"vertexType":"COLUMN","vertexId":"default.dest2.key2"},{"id":3,"vertexType":
 "COLUMN","vertexId":"default.dest2.value2"},{"id":4,"vertexType":"COLUMN","vertexId":"default.src1.key"},{"id":5,"vertexType":"COLUMN","vertexId":"default.src1.value"},{"id":6,"vertexType":"COLUMN","vertexId":"default.src2.key2"},{"id":7,"vertexType":"COLUMN","vertexId":"default.src2.value2"}]}
 PREHOOK: query: select * from src1 where length(key) > 2
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src1

http://git-wip-us.apache.org/repos/asf/hive/blob/3a3ffaa9/ql/src/test/results/clientpositive/llap/smb_mapjoin_15.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/smb_mapjoin_15.q.out b/ql/src/test/results/clientpositive/llap/smb_mapjoin_15.q.out
index df89454..6c078ad 100644
--- a/ql/src/test/results/clientpositive/llap/smb_mapjoin_15.q.out
+++ b/ql/src/test/results/clientpositive/llap/smb_mapjoin_15.q.out
@@ -635,7 +635,7 @@ STAGE PLANS:
                   GatherStats: false
                   Filter Operator
                     isSamplingPred: false
-                    predicate: (key is not null and key2 is not null) (type: boolean)
+                    predicate: (key2 is not null and key is not null) (type: boolean)
                     Statistics: Num rows: 500 Data size: 7218 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int), key2 (type: int), value (type: string)
@@ -715,7 +715,7 @@ STAGE PLANS:
                   GatherStats: false
                   Filter Operator
                     isSamplingPred: false
-                    predicate: (key is not null and key2 is not null) (type: boolean)
+                    predicate: (key2 is not null and key is not null) (type: boolean)
                     Statistics: Num rows: 500 Data size: 7218 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int), key2 (type: int), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/3a3ffaa9/ql/src/test/results/clientpositive/llap/subquery_in.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/subquery_in.q.out b/ql/src/test/results/clientpositive/llap/subquery_in.q.out
index a831289..df92bb2 100644
--- a/ql/src/test/results/clientpositive/llap/subquery_in.q.out
+++ b/ql/src/test/results/clientpositive/llap/subquery_in.q.out
@@ -1789,7 +1789,7 @@ STAGE PLANS:
                   alias: part
                   Statistics: Num rows: 26 Data size: 16094 Basic stats: COMPLETE Column stats: COMPLETE
                   Filter Operator
-                    predicate: p_retailprice is not null (type: boolean)
+                    predicate: floor(p_retailprice) is not null (type: boolean)
                     Statistics: Num rows: 26 Data size: 16094 Basic stats: COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: p_partkey (type: int), p_name (type: string), p_mfgr (type: string), p_brand (type: string), p_type (type: string), p_size (type: int), p_container (type: string), p_retailprice (type: double), p_comment (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/3a3ffaa9/ql/src/test/results/clientpositive/llap/subquery_select.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/subquery_select.q.out b/ql/src/test/results/clientpositive/llap/subquery_select.q.out
index fd10898..013b0a3 100644
--- a/ql/src/test/results/clientpositive/llap/subquery_select.q.out
+++ b/ql/src/test/results/clientpositive/llap/subquery_select.q.out
@@ -4660,7 +4660,7 @@ STAGE PLANS:
                   alias: p
                   Statistics: Num rows: 26 Data size: 2808 Basic stats: COMPLETE Column stats: COMPLETE
                   Filter Operator
-                    predicate: (p_type is not null and p_size is not null) (type: boolean)
+                    predicate: (p_size is not null and p_type is not null) (type: boolean)
                     Statistics: Num rows: 26 Data size: 2808 Basic stats: COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: p_type (type: string), p_size (type: int)
@@ -4679,7 +4679,7 @@ STAGE PLANS:
                   alias: pp
                   Statistics: Num rows: 26 Data size: 2808 Basic stats: COMPLETE Column stats: COMPLETE
                   Filter Operator
-                    predicate: (p_type is not null and p_size is not null) (type: boolean)
+                    predicate: (p_size is not null and p_type is not null) (type: boolean)
                     Statistics: Num rows: 26 Data size: 2808 Basic stats: COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: p_type (type: string), p_size (type: int)
@@ -4860,7 +4860,7 @@ STAGE PLANS:
                   alias: p
                   Statistics: Num rows: 26 Data size: 2912 Basic stats: COMPLETE Column stats: COMPLETE
                   Filter Operator
-                    predicate: (p_type is not null and p_size is not null) (type: boolean)
+                    predicate: (p_size is not null and p_type is not null) (type: boolean)
                     Statistics: Num rows: 26 Data size: 2912 Basic stats: COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: p_partkey (type: int), p_type (type: string), p_size (type: int)
@@ -4880,7 +4880,7 @@ STAGE PLANS:
                   alias: pp
                   Statistics: Num rows: 26 Data size: 2808 Basic stats: COMPLETE Column stats: COMPLETE
                   Filter Operator
-                    predicate: (p_type is not null and p_size is not null) (type: boolean)
+                    predicate: (p_size is not null and p_type is not null) (type: boolean)
                     Statistics: Num rows: 26 Data size: 2808 Basic stats: COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: p_type (type: string), p_size (type: int)
@@ -5154,7 +5154,7 @@ STAGE PLANS:
                   alias: p
                   Statistics: Num rows: 26 Data size: 2912 Basic stats: COMPLETE Column stats: COMPLETE
                   Filter Operator
-                    predicate: (p_type is not null and p_size is not null) (type: boolean)
+                    predicate: (p_size is not null and p_type is not null) (type: boolean)
                     Statistics: Num rows: 26 Data size: 2912 Basic stats: COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: p_partkey (type: int), p_type (type: string), p_size (type: int)
@@ -5174,7 +5174,7 @@ STAGE PLANS:
                   alias: pp
                   Statistics: Num rows: 26 Data size: 2808 Basic stats: COMPLETE Column stats: COMPLETE
                   Filter Operator
-                    predicate: (p_type is not null and p_size is not null) (type: boolean)
+                    predicate: (p_size is not null and p_type is not null) (type: boolean)
                     Statistics: Num rows: 26 Data size: 2808 Basic stats: COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: p_type (type: string), p_size (type: int)

http://git-wip-us.apache.org/repos/asf/hive/blob/3a3ffaa9/ql/src/test/results/clientpositive/llap/vector_interval_mapjoin.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/vector_interval_mapjoin.q.out b/ql/src/test/results/clientpositive/llap/vector_interval_mapjoin.q.out
index 0024fea..eb836e0 100644
--- a/ql/src/test/results/clientpositive/llap/vector_interval_mapjoin.q.out
+++ b/ql/src/test/results/clientpositive/llap/vector_interval_mapjoin.q.out
@@ -208,8 +208,8 @@ STAGE PLANS:
                     Filter Vectorization:
                         className: VectorFilterOperator
                         native: true
-                        predicateExpression: FilterExprAndExpr(children: SelectColumnIsNotNull(col 8) -> boolean, SelectColumnIsNotNull(col 12) -> boolean, SelectColumnIsNotNull(col 10) -> boolean) -> boolean
-                    predicate: (s is not null and dt is not null and ts is not null) (type: boolean)
+                        predicateExpression: FilterExprAndExpr(children: SelectColumnIsNotNull(col 12) -> boolean, SelectColumnIsNotNull(col 10) -> boolean, SelectColumnIsNotNull(col 8) -> boolean) -> boolean
+                    predicate: (dt is not null and ts is not null and s is not null) (type: boolean)
                     Statistics: Num rows: 1000 Data size: 460264 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: s (type: string), (dt - CAST( ts AS DATE)) (type: interval_day_time)
@@ -274,8 +274,8 @@ STAGE PLANS:
                     Filter Vectorization:
                         className: VectorFilterOperator
                         native: true
-                        predicateExpression: FilterExprAndExpr(children: SelectColumnIsNotNull(col 8) -> boolean, SelectColumnIsNotNull(col 12) -> boolean, SelectColumnIsNotNull(col 10) -> boolean) -> boolean
-                    predicate: (s is not null and dt is not null and ts is not null) (type: boolean)
+                        predicateExpression: FilterExprAndExpr(children: SelectColumnIsNotNull(col 12) -> boolean, SelectColumnIsNotNull(col 10) -> boolean, SelectColumnIsNotNull(col 8) -> boolean) -> boolean
+                    predicate: (dt is not null and ts is not null and s is not null) (type: boolean)
                     Statistics: Num rows: 1000 Data size: 458448 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: s (type: string), (dt - CAST( ts AS DATE)) (type: interval_day_time)

http://git-wip-us.apache.org/repos/asf/hive/blob/3a3ffaa9/ql/src/test/results/clientpositive/nested_column_pruning.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/nested_column_pruning.q.out b/ql/src/test/results/clientpositive/nested_column_pruning.q.out
index 3da1544..bc27c40 100644
--- a/ql/src/test/results/clientpositive/nested_column_pruning.q.out
+++ b/ql/src/test/results/clientpositive/nested_column_pruning.q.out
@@ -930,21 +930,24 @@ STAGE PLANS:
           TableScan
             alias: t1
             Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
-            Select Operator
-              expressions: s1 (type: struct<f1:boolean,f2:string,f3:struct<f4:int,f5:double>,f6:int>)
-              outputColumnNames: _col0
+            Filter Operator
+              predicate: s1.f3.f4 is not null (type: boolean)
               Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
-              Reduce Output Operator
-                key expressions: _col0.f3.f4 (type: int)
-                sort order: +
-                Map-reduce partition columns: _col0.f3.f4 (type: int)
+              Select Operator
+                expressions: s1 (type: struct<f1:boolean,f2:string,f3:struct<f4:int,f5:double>,f6:int>)
+                outputColumnNames: _col0
                 Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
-                value expressions: _col0 (type: struct<f1:boolean,f2:string,f3:struct<f4:int,f5:double>,f6:int>)
+                Reduce Output Operator
+                  key expressions: _col0.f3.f4 (type: int)
+                  sort order: +
+                  Map-reduce partition columns: _col0.f3.f4 (type: int)
+                  Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
+                  value expressions: _col0 (type: struct<f1:boolean,f2:string,f3:struct<f4:int,f5:double>,f6:int>)
           TableScan
             alias: t2
             Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (s2.f8.f9 = false) (type: boolean)
+              predicate: ((s2.f8.f9 = false) and s1.f6 is not null) (type: boolean)
               Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: s1 (type: struct<f1:boolean,f2:string,f3:struct<f4:int,f5:double>,f6:int>), s2 (type: struct<f7:string,f8:struct<f9:boolean,f10:array<int>,f11:map<string,boolean>>>)
@@ -1021,21 +1024,24 @@ STAGE PLANS:
           TableScan
             alias: t1
             Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
-            Select Operator
-              expressions: s1 (type: struct<f1:boolean,f2:string,f3:struct<f4:int,f5:double>,f6:int>)
-              outputColumnNames: _col0
+            Filter Operator
+              predicate: s1.f3.f4 is not null (type: boolean)
               Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
-              Reduce Output Operator
-                key expressions: _col0.f3.f4 (type: int)
-                sort order: +
-                Map-reduce partition columns: _col0.f3.f4 (type: int)
+              Select Operator
+                expressions: s1 (type: struct<f1:boolean,f2:string,f3:struct<f4:int,f5:double>,f6:int>)
+                outputColumnNames: _col0
                 Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
-                value expressions: _col0 (type: struct<f1:boolean,f2:string,f3:struct<f4:int,f5:double>,f6:int>)
+                Reduce Output Operator
+                  key expressions: _col0.f3.f4 (type: int)
+                  sort order: +
+                  Map-reduce partition columns: _col0.f3.f4 (type: int)
+                  Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
+                  value expressions: _col0 (type: struct<f1:boolean,f2:string,f3:struct<f4:int,f5:double>,f6:int>)
           TableScan
             alias: t2
             Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (s2.f8.f9 = true) (type: boolean)
+              predicate: (s2.f8.f9 and s1.f6 is not null) (type: boolean)
               Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: s1 (type: struct<f1:boolean,f2:string,f3:struct<f4:int,f5:double>,f6:int>), s2 (type: struct<f7:string,f8:struct<f9:boolean,f10:array<int>,f11:map<string,boolean>>>)

http://git-wip-us.apache.org/repos/asf/hive/blob/3a3ffaa9/ql/src/test/results/clientpositive/perf/query17.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query17.q.out b/ql/src/test/results/clientpositive/perf/query17.q.out
index 5b1f2a8..6c9e00b 100644
--- a/ql/src/test/results/clientpositive/perf/query17.q.out
+++ b/ql/src/test/results/clientpositive/perf/query17.q.out
@@ -190,7 +190,7 @@ Stage-0
                                                 Select Operator [SEL_8] (rows=575995635 width=88)
                                                   Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
                                                   Filter Operator [FIL_88] (rows=575995635 width=88)
-                                                    predicate:(ss_item_sk is not null and ss_customer_sk is not null and ss_ticket_number is not null and ss_sold_date_sk is not null and ss_store_sk is not null)
+                                                    predicate:(ss_customer_sk is not null and ss_item_sk is not null and ss_ticket_number is not null and ss_sold_date_sk is not null and ss_store_sk is not null)
                                                     TableScan [TS_6] (rows=575995635 width=88)
                                                       default@store_sales,store_sales,Tbl:COMPLETE,Col:NONE,Output:["ss_sold_date_sk","ss_item_sk","ss_customer_sk","ss_store_sk","ss_ticket_number","ss_quantity"]
                                             <-Map 13 [SIMPLE_EDGE]
@@ -199,7 +199,7 @@ Stage-0
                                                 Select Operator [SEL_11] (rows=57591150 width=77)
                                                   Output:["_col0","_col1","_col2","_col3","_col4"]
                                                   Filter Operator [FIL_89] (rows=57591150 width=77)
-                                                    predicate:(sr_item_sk is not null and sr_customer_sk is not null and sr_ticket_number is not null and sr_returned_date_sk is not null)
+                                                    predicate:(sr_customer_sk is not null and sr_item_sk is not null and sr_ticket_number is not null and sr_returned_date_sk is not null)
                                                     TableScan [TS_9] (rows=57591150 width=77)
                                                       default@store_returns,store_returns,Tbl:COMPLETE,Col:NONE,Output:["sr_returned_date_sk","sr_item_sk","sr_customer_sk","sr_ticket_number","sr_return_quantity"]
                           <-Reducer 2 [SIMPLE_EDGE]

http://git-wip-us.apache.org/repos/asf/hive/blob/3a3ffaa9/ql/src/test/results/clientpositive/perf/query24.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query24.q.out b/ql/src/test/results/clientpositive/perf/query24.q.out
index bfc89e2..3eb65b6 100644
--- a/ql/src/test/results/clientpositive/perf/query24.q.out
+++ b/ql/src/test/results/clientpositive/perf/query24.q.out
@@ -154,7 +154,7 @@ Stage-0
                                     Select Operator [SEL_17] (rows=40000000 width=1014)
                                       Output:["_col0","_col1","_col2"]
                                       Filter Operator [FIL_137] (rows=40000000 width=1014)
-                                        predicate:(ca_zip is not null and ca_country is not null)
+                                        predicate:(upper(ca_country) is not null and ca_zip is not null)
                                         TableScan [TS_15] (rows=40000000 width=1014)
                                           default@customer_address,customer_address,Tbl:COMPLETE,Col:NONE,Output:["ca_state","ca_zip","ca_country"]
                                 <-Reducer 12 [SIMPLE_EDGE]
@@ -210,7 +210,7 @@ Stage-0
                                                     Select Operator [SEL_2] (rows=575995635 width=88)
                                                       Output:["_col0","_col1","_col2","_col3","_col4"]
                                                       Filter Operator [FIL_132] (rows=575995635 width=88)
-                                                        predicate:(ss_item_sk is not null and ss_ticket_number is not null and ss_store_sk is not null and ss_customer_sk is not null)
+                                                        predicate:(ss_ticket_number is not null and ss_item_sk is not null and ss_store_sk is not null and ss_customer_sk is not null)
                                                         TableScan [TS_0] (rows=575995635 width=88)
                                                           default@store_sales,store_sales,Tbl:COMPLETE,Col:NONE,Output:["ss_item_sk","ss_customer_sk","ss_store_sk","ss_ticket_number","ss_sales_price"]
                                                 <-Map 16 [SIMPLE_EDGE]
@@ -219,7 +219,7 @@ Stage-0
                                                     Select Operator [SEL_5] (rows=57591150 width=77)
                                                       Output:["_col0","_col1"]
                                                       Filter Operator [FIL_133] (rows=57591150 width=77)
-                                                        predicate:(sr_item_sk is not null and sr_ticket_number is not null)
+                                                        predicate:(sr_ticket_number is not null and sr_item_sk is not null)
                                                         TableScan [TS_3] (rows=57591150 width=77)
                                                           default@store_returns,store_returns,Tbl:COMPLETE,Col:NONE,Output:["sr_item_sk","sr_ticket_number"]
             <-Reducer 7 [CUSTOM_SIMPLE_EDGE]

http://git-wip-us.apache.org/repos/asf/hive/blob/3a3ffaa9/ql/src/test/results/clientpositive/perf/query25.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query25.q.out b/ql/src/test/results/clientpositive/perf/query25.q.out
index 071e23e..ee94eec 100644
--- a/ql/src/test/results/clientpositive/perf/query25.q.out
+++ b/ql/src/test/results/clientpositive/perf/query25.q.out
@@ -194,7 +194,7 @@ Stage-0
                                               Select Operator [SEL_8] (rows=575995635 width=88)
                                                 Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
                                                 Filter Operator [FIL_88] (rows=575995635 width=88)
-                                                  predicate:(ss_item_sk is not null and ss_customer_sk is not null and ss_ticket_number is not null and ss_sold_date_sk is not null and ss_store_sk is not null)
+                                                  predicate:(ss_customer_sk is not null and ss_item_sk is not null and ss_ticket_number is not null and ss_sold_date_sk is not null and ss_store_sk is not null)
                                                   TableScan [TS_6] (rows=575995635 width=88)
                                                     default@store_sales,store_sales,Tbl:COMPLETE,Col:NONE,Output:["ss_sold_date_sk","ss_item_sk","ss_customer_sk","ss_store_sk","ss_ticket_number","ss_net_profit"]
                                           <-Map 13 [SIMPLE_EDGE]
@@ -203,7 +203,7 @@ Stage-0
                                               Select Operator [SEL_11] (rows=57591150 width=77)
                                                 Output:["_col0","_col1","_col2","_col3","_col4"]
                                                 Filter Operator [FIL_89] (rows=57591150 width=77)
-                                                  predicate:(sr_item_sk is not null and sr_customer_sk is not null and sr_ticket_number is not null and sr_returned_date_sk is not null)
+                                                  predicate:(sr_customer_sk is not null and sr_item_sk is not null and sr_ticket_number is not null and sr_returned_date_sk is not null)
                                                   TableScan [TS_9] (rows=57591150 width=77)
                                                     default@store_returns,store_returns,Tbl:COMPLETE,Col:NONE,Output:["sr_returned_date_sk","sr_item_sk","sr_customer_sk","sr_ticket_number","sr_net_loss"]
                         <-Reducer 2 [SIMPLE_EDGE]

http://git-wip-us.apache.org/repos/asf/hive/blob/3a3ffaa9/ql/src/test/results/clientpositive/perf/query29.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query29.q.out b/ql/src/test/results/clientpositive/perf/query29.q.out
index 07306c0..b3b9c3e 100644
--- a/ql/src/test/results/clientpositive/perf/query29.q.out
+++ b/ql/src/test/results/clientpositive/perf/query29.q.out
@@ -192,7 +192,7 @@ Stage-0
                                               Select Operator [SEL_11] (rows=57591150 width=77)
                                                 Output:["_col0","_col1","_col2","_col3","_col4"]
                                                 Filter Operator [FIL_89] (rows=57591150 width=77)
-                                                  predicate:(sr_item_sk is not null and sr_customer_sk is not null and sr_ticket_number is not null and sr_returned_date_sk is not null)
+                                                  predicate:(sr_customer_sk is not null and sr_item_sk is not null and sr_ticket_number is not null and sr_returned_date_sk is not null)
                                                   TableScan [TS_9] (rows=57591150 width=77)
                                                     default@store_returns,store_returns,Tbl:COMPLETE,Col:NONE,Output:["sr_returned_date_sk","sr_item_sk","sr_customer_sk","sr_ticket_number","sr_return_quantity"]
                                           <-Map 8 [SIMPLE_EDGE]
@@ -201,7 +201,7 @@ Stage-0
                                               Select Operator [SEL_8] (rows=575995635 width=88)
                                                 Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
                                                 Filter Operator [FIL_88] (rows=575995635 width=88)
-                                                  predicate:(ss_item_sk is not null and ss_customer_sk is not null and ss_ticket_number is not null and ss_sold_date_sk is not null and ss_store_sk is not null)
+                                                  predicate:(ss_customer_sk is not null and ss_item_sk is not null and ss_ticket_number is not null and ss_sold_date_sk is not null and ss_store_sk is not null)
                                                   TableScan [TS_6] (rows=575995635 width=88)
                                                     default@store_sales,store_sales,Tbl:COMPLETE,Col:NONE,Output:["ss_sold_date_sk","ss_item_sk","ss_customer_sk","ss_store_sk","ss_ticket_number","ss_quantity"]
                         <-Reducer 2 [SIMPLE_EDGE]

http://git-wip-us.apache.org/repos/asf/hive/blob/3a3ffaa9/ql/src/test/results/clientpositive/perf/query30.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query30.q.out b/ql/src/test/results/clientpositive/perf/query30.q.out
index 6f5d8ba..93ce9cd 100644
--- a/ql/src/test/results/clientpositive/perf/query30.q.out
+++ b/ql/src/test/results/clientpositive/perf/query30.q.out
@@ -108,7 +108,7 @@ Stage-0
                         Select Operator [SEL_2] (rows=80000000 width=860)
                           Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13"]
                           Filter Operator [FIL_93] (rows=80000000 width=860)
-                            predicate:(c_customer_sk is not null and c_current_addr_sk is not null)
+                            predicate:(c_current_addr_sk is not null and c_customer_sk is not null)
                             TableScan [TS_0] (rows=80000000 width=860)
                               default@customer,customer,Tbl:COMPLETE,Col:NONE,Output:["c_customer_sk","c_customer_id","c_current_addr_sk","c_salutation","c_first_name","c_last_name","c_preferred_cust_flag","c_birth_day","c_birth_month","c_birth_year","c_birth_country","c_login","c_email_address","c_last_review_date"]
                 <-Reducer 8 [SIMPLE_EDGE]

http://git-wip-us.apache.org/repos/asf/hive/blob/3a3ffaa9/ql/src/test/results/clientpositive/perf/query49.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query49.q.out b/ql/src/test/results/clientpositive/perf/query49.q.out
index f8c0649..c62549a 100644
--- a/ql/src/test/results/clientpositive/perf/query49.q.out
+++ b/ql/src/test/results/clientpositive/perf/query49.q.out
@@ -331,7 +331,7 @@ Stage-0
                                                       Select Operator [SEL_79] (rows=19197050 width=77)
                                                         Output:["_col0","_col1","_col2","_col3"]
                                                         Filter Operator [FIL_140] (rows=19197050 width=77)
-                                                          predicate:((sr_return_amt > 10000) and sr_item_sk is not null and sr_ticket_number is not null)
+                                                          predicate:((sr_return_amt > 10000) and sr_ticket_number is not null and sr_item_sk is not null)
                                                           TableScan [TS_77] (rows=57591150 width=77)
                                                             default@store_returns,sr,Tbl:COMPLETE,Col:NONE,Output:["sr_item_sk","sr_ticket_number","sr_return_quantity","sr_return_amt"]
                                                   <-Reducer 18 [SIMPLE_EDGE]
@@ -354,7 +354,7 @@ Stage-0
                                                           Select Operator [SEL_73] (rows=21333171 width=88)
                                                             Output:["_col0","_col1","_col2","_col3","_col4"]
                                                             Filter Operator [FIL_138] (rows=21333171 width=88)
-                                                              predicate:((ss_net_profit > 1) and (ss_net_paid > 0) and (ss_quantity > 0) and ss_item_sk is not null and ss_ticket_number is not null and ss_sold_date_sk is not null)
+                                                              predicate:((ss_net_profit > 1) and (ss_net_paid > 0) and (ss_quantity > 0) and ss_ticket_number is not null and ss_item_sk is not null and ss_sold_date_sk is not null)
                                                               TableScan [TS_71] (rows=575995635 width=88)
                                                                 default@store_sales,sts,Tbl:COMPLETE,Col:NONE,Output:["ss_sold_date_sk","ss_item_sk","ss_ticket_number","ss_quantity","ss_net_paid","ss_net_profit"]
                   <-Reducer 8 [CONTAINS]
@@ -472,7 +472,7 @@ Stage-0
                                                                 Select Operator [SEL_8] (rows=4799489 width=92)
                                                                   Output:["_col0","_col1","_col2","_col3"]
                                                                   Filter Operator [FIL_132] (rows=4799489 width=92)
-                                                                    predicate:((wr_return_amt > 10000) and wr_item_sk is not null and wr_order_number is not null)
+                                                                    predicate:((wr_return_amt > 10000) and wr_order_number is not null and wr_item_sk is not null)
                                                                     TableScan [TS_6] (rows=14398467 width=92)
                                                                       default@web_returns,wr,Tbl:COMPLETE,Col:NONE,Output:["wr_item_sk","wr_order_number","wr_return_quantity","wr_return_amt"]
                                                             <-Reducer 2 [SIMPLE_EDGE]

http://git-wip-us.apache.org/repos/asf/hive/blob/3a3ffaa9/ql/src/test/results/clientpositive/perf/query5.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query5.q.out b/ql/src/test/results/clientpositive/perf/query5.q.out
index ea072d9..9762e15 100644
--- a/ql/src/test/results/clientpositive/perf/query5.q.out
+++ b/ql/src/test/results/clientpositive/perf/query5.q.out
@@ -405,7 +405,7 @@ Stage-0
                                                 Select Operator [SEL_56] (rows=144002668 width=135)
                                                   Output:["_col0","_col1","_col2"]
                                                   Filter Operator [FIL_127] (rows=144002668 width=135)
-                                                    predicate:(ws_web_site_sk is not null and ws_order_number is not null and ws_item_sk is not null)
+                                                    predicate:(ws_web_site_sk is not null and ws_item_sk is not null and ws_order_number is not null)
                                                     TableScan [TS_54] (rows=144002668 width=135)
                                                       default@web_sales,web_sales,Tbl:COMPLETE,Col:NONE,Output:["ws_item_sk","ws_web_site_sk","ws_order_number"]
                                             <-Map 26 [SIMPLE_EDGE]

http://git-wip-us.apache.org/repos/asf/hive/blob/3a3ffaa9/ql/src/test/results/clientpositive/perf/query50.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query50.q.out b/ql/src/test/results/clientpositive/perf/query50.q.out
index 149dc98..68d6611 100644
--- a/ql/src/test/results/clientpositive/perf/query50.q.out
+++ b/ql/src/test/results/clientpositive/perf/query50.q.out
@@ -195,7 +195,7 @@ Stage-0
                                       Select Operator [SEL_2] (rows=575995635 width=88)
                                         Output:["_col0","_col1","_col2","_col3","_col4"]
                                         Filter Operator [FIL_51] (rows=575995635 width=88)
-                                          predicate:(ss_item_sk is not null and ss_customer_sk is not null and ss_ticket_number is not null and ss_store_sk is not null and ss_sold_date_sk is not null)
+                                          predicate:(ss_ticket_number is not null and ss_item_sk is not null and ss_customer_sk is not null and ss_store_sk is not null and ss_sold_date_sk is not null)
                                           TableScan [TS_0] (rows=575995635 width=88)
                                             default@store_sales,store_sales,Tbl:COMPLETE,Col:NONE,Output:["ss_sold_date_sk","ss_item_sk","ss_customer_sk","ss_store_sk","ss_ticket_number"]
                                   <-Map 8 [SIMPLE_EDGE]
@@ -204,7 +204,7 @@ Stage-0
                                       Select Operator [SEL_5] (rows=57591150 width=77)
                                         Output:["_col0","_col1","_col2","_col3"]
                                         Filter Operator [FIL_52] (rows=57591150 width=77)
-                                          predicate:(sr_item_sk is not null and sr_customer_sk is not null and sr_ticket_number is not null and sr_returned_date_sk is not null)
+                                          predicate:(sr_ticket_number is not null and sr_item_sk is not null and sr_customer_sk is not null and sr_returned_date_sk is not null)
                                           TableScan [TS_3] (rows=57591150 width=77)
                                             default@store_returns,store_returns,Tbl:COMPLETE,Col:NONE,Output:["sr_returned_date_sk","sr_item_sk","sr_customer_sk","sr_ticket_number"]
 

http://git-wip-us.apache.org/repos/asf/hive/blob/3a3ffaa9/ql/src/test/results/clientpositive/perf/query64.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query64.q.out b/ql/src/test/results/clientpositive/perf/query64.q.out
index b31fd7f..7464430 100644
--- a/ql/src/test/results/clientpositive/perf/query64.q.out
+++ b/ql/src/test/results/clientpositive/perf/query64.q.out
@@ -389,7 +389,7 @@ Stage-0
                                                             Select Operator [SEL_2] (rows=80000000 width=860)
                                                               Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
                                                               Filter Operator [FIL_537] (rows=80000000 width=860)
-                                                                predicate:(c_customer_sk is not null and c_first_shipto_date_sk is not null and c_first_sales_date_sk is not null and c_current_cdemo_sk is not null and c_current_hdemo_sk is not null and c_current_addr_sk is not null)
+                                                                predicate:(c_customer_sk is not null and c_first_sales_date_sk is not null and c_first_shipto_date_sk is not null and c_current_cdemo_sk is not null and c_current_hdemo_sk is not null and c_current_addr_sk is not null)
                                                                 TableScan [TS_0] (rows=80000000 width=860)
                                                                   default@customer,customer,Tbl:COMPLETE,Col:NONE,Output:["c_customer_sk","c_current_cdemo_sk","c_current_hdemo_sk","c_current_addr_sk","c_first_shipto_date_sk","c_first_sales_date_sk"]
                                                 <-Reducer 36 [SIMPLE_EDGE]
@@ -553,7 +553,7 @@ Stage-0
                                                                       Select Operator [SEL_61] (rows=287989836 width=135)
                                                                         Output:["_col0","_col1","_col2"]
                                                                         Filter Operator [FIL_551] (rows=287989836 width=135)
-                                                                          predicate:(cs_order_number is not null and cs_item_sk is not null)
+                                                                          predicate:(cs_item_sk is not null and cs_order_number is not null)
                                                                           TableScan [TS_59] (rows=287989836 width=135)
                                                                             default@catalog_sales,catalog_sales,Tbl:COMPLETE,Col:NONE,Output:["cs_item_sk","cs_order_number","cs_ext_list_price"]
                                                                   <-Map 54 [SIMPLE_EDGE]
@@ -562,7 +562,7 @@ Stage-0
                                                                       Select Operator [SEL_64] (rows=28798881 width=106)
                                                                         Output:["_col0","_col1","_col2","_col3","_col4"]
                                                                         Filter Operator [FIL_552] (rows=28798881 width=106)
-                                                                          predicate:(cr_order_number is not null and cr_item_sk is not null)
+                                                                          predicate:(cr_item_sk is not null and cr_order_number is not null)
                                                                           TableScan [TS_62] (rows=28798881 width=106)
                                                                             default@catalog_returns,catalog_returns,Tbl:COMPLETE,Col:NONE,Output:["cr_item_sk","cr_order_number","cr_refunded_cash","cr_reversed_charge","cr_store_credit"]
                 <-Reducer 9 [SIMPLE_EDGE]

http://git-wip-us.apache.org/repos/asf/hive/blob/3a3ffaa9/ql/src/test/results/clientpositive/perf/query8.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query8.q.out b/ql/src/test/results/clientpositive/perf/query8.q.out
index f170883..8660fc9 100644
--- a/ql/src/test/results/clientpositive/perf/query8.q.out
+++ b/ql/src/test/results/clientpositive/perf/query8.q.out
@@ -258,7 +258,7 @@ Stage-0
                             Select Operator [SEL_44] (rows=1704 width=1910)
                               Output:["_col0","_col1","_col2"]
                               Filter Operator [FIL_85] (rows=1704 width=1910)
-                                predicate:(s_store_sk is not null and s_zip is not null)
+                                predicate:(s_store_sk is not null and substr(s_zip, 1, 2) is not null)
                                 TableScan [TS_42] (rows=1704 width=1910)
                                   default@store,store,Tbl:COMPLETE,Col:NONE,Output:["s_store_sk","s_store_name","s_zip"]
                         <-Reducer 10 [SIMPLE_EDGE]
@@ -302,7 +302,7 @@ Stage-0
                                                             Select Operator [SEL_16] (rows=40000000 width=1014)
                                                               Output:["_col0","_col1"]
                                                               Filter Operator [FIL_83] (rows=40000000 width=1014)
-                                                                predicate:(ca_address_sk is not null and substr(ca_zip, 1, 5) is not null)
+                                                                predicate:(ca_address_sk is not null and substr(substr(ca_zip, 1, 5), 1, 2) is not null)
                                                                 TableScan [TS_14] (rows=40000000 width=1014)
                                                                   default@customer_address,customer_address,Tbl:COMPLETE,Col:NONE,Output:["ca_address_sk","ca_zip"]
                                                         <-Map 16 [SIMPLE_EDGE]
@@ -329,7 +329,7 @@ Stage-0
                                               Select Operator [SEL_8] (rows=20000000 width=1014)
                                                 Output:["_col0"]
                                                 Filter Operator [FIL_81] (rows=20000000 width=1014)
-                                                  predicate:(substr(ca_zip, 1, 5)) IN ('89436', '30868', '65085', '22977', '83927', '77557', '58429', '40697', '80614', '10502', '32779', '91137', '61265', '98294', '17921', '18427', '21203', '59362', '87291', '84093', '21505', '17184', '10866', '67898', '25797', '28055', '18377', '80332', '74535', '21757', '29742', '90885', '29898', '17819', '40811', '25990', '47513', '89531', '91068', '10391', '18846', '99223', '82637', '41368', '83658', '86199', '81625', '26696', '89338', '88425', '32200', '81427', '19053', '77471', '36610', '99823', '43276', '41249', '48584', '83550', '82276', '18842', '78890', '14090', '38123', '40936', '34425', '19850', '43286', '80072', '79188', '54191', '11395', '50497', '84861', '90733', '21068', '57666', '37119', '25004', '57835', '70067', '62878', '95806', '19303', '18840', '19124', '29785', '16737', '16022', '49613', '89977', '68310', '60069', '98360', '48649', '39050', '41793', '25002', '27413', '39736', '
 47208', '16515', '94808', '57648', '15009', '80015', '42961', '63982', '21744', '71853', '81087', '67468', '34175', '64008', '20261', '11201', '51799', '48043', '45645', '61163', '48375', '36447', '57042', '21218', '41100', '89951', '22745', '35851', '83326', '61125', '78298', '80752', '49858', '52940', '96976', '63792', '11376', '53582', '18717', '90226', '50530', '94203', '99447', '27670', '96577', '57856', '56372', '16165', '23427', '54561', '28806', '44439', '22926', '30123', '61451', '92397', '56979', '92309', '70873', '13355', '21801', '46346', '37562', '56458', '28286', '47306', '99555', '69399', '26234', '47546', '49661', '88601', '35943', '39936', '25632', '24611', '44166', '56648', '30379', '59785', '11110', '14329', '93815', '52226', '71381', '13842', '25612', '63294', '14664', '21077', '82626', '18799', '60915', '81020', '56447', '76619', '11433', '13414', '42548', '92713', '70467', '30884', '47484', '16072', '38936', '13036', '88376', '45539', '35901', '19506', '65690',
  '73957', '71850', '49231', '14276', '20005', '18384', '76615', '11635', '38177', '55607', '41369', '95447', '58581', '58149', '91946', '33790', '76232', '75692', '95464', '22246', '51061', '56692', '53121', '77209', '15482', '10688', '14868', '45907', '73520', '72666', '25734', '17959', '24677', '66446', '94627', '53535', '15560', '41967', '69297', '11929', '59403', '33283', '52232', '57350', '43933', '40921', '36635', '10827', '71286', '19736', '80619', '25251', '95042', '15526', '36496', '55854', '49124', '81980', '35375', '49157', '63512', '28944', '14946', '36503', '54010', '18767', '23969', '43905', '66979', '33113', '21286', '58471', '59080', '13395', '79144', '70373', '67031', '38360', '26705', '50906', '52406', '26066', '73146', '15884', '31897', '30045', '61068', '45550', '92454', '13376', '14354', '19770', '22928', '97790', '50723', '46081', '30202', '14410', '20223', '88500', '67298', '13261', '14172', '81410', '93578', '83583', '46047', '94167', '82564', '21156', '15799
 ', '86709', '37931', '74703', '83103', '23054', '70470', '72008', '49247', '91911', '69998', '20961', '70070', '63197', '54853', '88191', '91830', '49521', '19454', '81450', '89091', '62378', '25683', '61869', '51744', '36580', '85778', '36871', '48121', '28810', '83712', '45486', '67393', '26935', '42393', '20132', '55349', '86057', '21309', '80218', '10094', '11357', '48819', '39734', '40758', '30432', '21204', '29467', '30214', '61024', '55307', '74621', '11622', '68908', '33032', '52868', '99194', '99900', '84936', '69036', '99149', '45013', '32895', '59004', '32322', '14933', '32936', '33562', '72550', '27385', '58049', '58200', '16808', '21360', '32961', '18586', '79307', '15492')
+                                                  predicate:((substr(ca_zip, 1, 5)) IN ('89436', '30868', '65085', '22977', '83927', '77557', '58429', '40697', '80614', '10502', '32779', '91137', '61265', '98294', '17921', '18427', '21203', '59362', '87291', '84093', '21505', '17184', '10866', '67898', '25797', '28055', '18377', '80332', '74535', '21757', '29742', '90885', '29898', '17819', '40811', '25990', '47513', '89531', '91068', '10391', '18846', '99223', '82637', '41368', '83658', '86199', '81625', '26696', '89338', '88425', '32200', '81427', '19053', '77471', '36610', '99823', '43276', '41249', '48584', '83550', '82276', '18842', '78890', '14090', '38123', '40936', '34425', '19850', '43286', '80072', '79188', '54191', '11395', '50497', '84861', '90733', '21068', '57666', '37119', '25004', '57835', '70067', '62878', '95806', '19303', '18840', '19124', '29785', '16737', '16022', '49613', '89977', '68310', '60069', '98360', '48649', '39050', '41793', '25002', '27413', '39736', 
 '47208', '16515', '94808', '57648', '15009', '80015', '42961', '63982', '21744', '71853', '81087', '67468', '34175', '64008', '20261', '11201', '51799', '48043', '45645', '61163', '48375', '36447', '57042', '21218', '41100', '89951', '22745', '35851', '83326', '61125', '78298', '80752', '49858', '52940', '96976', '63792', '11376', '53582', '18717', '90226', '50530', '94203', '99447', '27670', '96577', '57856', '56372', '16165', '23427', '54561', '28806', '44439', '22926', '30123', '61451', '92397', '56979', '92309', '70873', '13355', '21801', '46346', '37562', '56458', '28286', '47306', '99555', '69399', '26234', '47546', '49661', '88601', '35943', '39936', '25632', '24611', '44166', '56648', '30379', '59785', '11110', '14329', '93815', '52226', '71381', '13842', '25612', '63294', '14664', '21077', '82626', '18799', '60915', '81020', '56447', '76619', '11433', '13414', '42548', '92713', '70467', '30884', '47484', '16072', '38936', '13036', '88376', '45539', '35901', '19506', '65690'
 , '73957', '71850', '49231', '14276', '20005', '18384', '76615', '11635', '38177', '55607', '41369', '95447', '58581', '58149', '91946', '33790', '76232', '75692', '95464', '22246', '51061', '56692', '53121', '77209', '15482', '10688', '14868', '45907', '73520', '72666', '25734', '17959', '24677', '66446', '94627', '53535', '15560', '41967', '69297', '11929', '59403', '33283', '52232', '57350', '43933', '40921', '36635', '10827', '71286', '19736', '80619', '25251', '95042', '15526', '36496', '55854', '49124', '81980', '35375', '49157', '63512', '28944', '14946', '36503', '54010', '18767', '23969', '43905', '66979', '33113', '21286', '58471', '59080', '13395', '79144', '70373', '67031', '38360', '26705', '50906', '52406', '26066', '73146', '15884', '31897', '30045', '61068', '45550', '92454', '13376', '14354', '19770', '22928', '97790', '50723', '46081', '30202', '14410', '20223', '88500', '67298', '13261', '14172', '81410', '93578', '83583', '46047', '94167', '82564', '21156', '1579
 9', '86709', '37931', '74703', '83103', '23054', '70470', '72008', '49247', '91911', '69998', '20961', '70070', '63197', '54853', '88191', '91830', '49521', '19454', '81450', '89091', '62378', '25683', '61869', '51744', '36580', '85778', '36871', '48121', '28810', '83712', '45486', '67393', '26935', '42393', '20132', '55349', '86057', '21309', '80218', '10094', '11357', '48819', '39734', '40758', '30432', '21204', '29467', '30214', '61024', '55307', '74621', '11622', '68908', '33032', '52868', '99194', '99900', '84936', '69036', '99149', '45013', '32895', '59004', '32322', '14933', '32936', '33562', '72550', '27385', '58049', '58200', '16808', '21360', '32961', '18586', '79307', '15492') and substr(substr(ca_zip, 1, 5), 1, 2) is not null)
                                                   TableScan [TS_6] (rows=40000000 width=1014)
                                                     default@customer_address,customer_address,Tbl:COMPLETE,Col:NONE,Output:["ca_zip"]
                     <-Reducer 2 [SIMPLE_EDGE]

http://git-wip-us.apache.org/repos/asf/hive/blob/3a3ffaa9/ql/src/test/results/clientpositive/perf/query81.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query81.q.out b/ql/src/test/results/clientpositive/perf/query81.q.out
index 8580377..5fb04b2 100644
--- a/ql/src/test/results/clientpositive/perf/query81.q.out
+++ b/ql/src/test/results/clientpositive/perf/query81.q.out
@@ -199,7 +199,7 @@ Stage-0
                           Select Operator [SEL_2] (rows=80000000 width=860)
                             Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
                             Filter Operator [FIL_94] (rows=80000000 width=860)
-                              predicate:(c_customer_sk is not null and c_current_addr_sk is not null)
+                              predicate:(c_current_addr_sk is not null and c_customer_sk is not null)
                               TableScan [TS_0] (rows=80000000 width=860)
                                 default@customer,customer,Tbl:COMPLETE,Col:NONE,Output:["c_customer_sk","c_customer_id","c_current_addr_sk","c_salutation","c_first_name","c_last_name"]
                       <-Map 5 [SIMPLE_EDGE]

http://git-wip-us.apache.org/repos/asf/hive/blob/3a3ffaa9/ql/src/test/results/clientpositive/perf/query85.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query85.q.out b/ql/src/test/results/clientpositive/perf/query85.q.out
index 07e2e48..f188fa2 100644
--- a/ql/src/test/results/clientpositive/perf/query85.q.out
+++ b/ql/src/test/results/clientpositive/perf/query85.q.out
@@ -298,7 +298,7 @@ Stage-0
                                                       Select Operator [SEL_5] (rows=16000296 width=135)
                                                         Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
                                                         Filter Operator [FIL_93] (rows=16000296 width=135)
-                                                          predicate:((ws_sales_price BETWEEN 100 AND 150 or ws_sales_price BETWEEN 50 AND 100 or ws_sales_price BETWEEN 150 AND 200) and (ws_net_profit BETWEEN 100 AND 200 or ws_net_profit BETWEEN 150 AND 300 or ws_net_profit BETWEEN 50 AND 250) and ws_order_number is not null and ws_item_sk is not null and ws_web_page_sk is not null and ws_sold_date_sk is not null)
+                                                          predicate:((ws_sales_price BETWEEN 100 AND 150 or ws_sales_price BETWEEN 50 AND 100 or ws_sales_price BETWEEN 150 AND 200) and (ws_net_profit BETWEEN 100 AND 200 or ws_net_profit BETWEEN 150 AND 300 or ws_net_profit BETWEEN 50 AND 250) and ws_item_sk is not null and ws_order_number is not null and ws_web_page_sk is not null and ws_sold_date_sk is not null)
                                                           TableScan [TS_3] (rows=144002668 width=135)
                                                             default@web_sales,web_sales,Tbl:COMPLETE,Col:NONE,Output:["ws_sold_date_sk","ws_item_sk","ws_web_page_sk","ws_order_number","ws_quantity","ws_sales_price","ws_net_profit"]
 

http://git-wip-us.apache.org/repos/asf/hive/blob/3a3ffaa9/ql/src/test/results/clientpositive/semijoin4.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/semijoin4.q.out b/ql/src/test/results/clientpositive/semijoin4.q.out
index 1cf8c96..49c3801 100644
--- a/ql/src/test/results/clientpositive/semijoin4.q.out
+++ b/ql/src/test/results/clientpositive/semijoin4.q.out
@@ -71,7 +71,7 @@ STAGE PLANS:
             alias: t1
             Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
             Filter Operator
-              predicate: ((-92 = tinyint_col_46) and decimal1309_col_65 is not null and bigint_col_13 is not null) (type: boolean)
+              predicate: ((-92 = tinyint_col_46) and bigint_col_13 is not null and decimal1309_col_65 is not null) (type: boolean)
               Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
               Select Operator
                 expressions: bigint_col_13 (type: bigint), smallint_col_24 (type: smallint), double_col_60 (type: double), decimal1309_col_65 (type: decimal(13,9))

http://git-wip-us.apache.org/repos/asf/hive/blob/3a3ffaa9/ql/src/test/results/clientpositive/semijoin5.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/semijoin5.q.out b/ql/src/test/results/clientpositive/semijoin5.q.out
index 7857e3b..7dfdfc3 100644
--- a/ql/src/test/results/clientpositive/semijoin5.q.out
+++ b/ql/src/test/results/clientpositive/semijoin5.q.out
@@ -63,7 +63,7 @@ STAGE PLANS:
             alias: t1
             Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
             Filter Operator
-              predicate: (tinyint_col_3 is not null and bigint_col_7 is not null and decimal2016_col_26 is not null) (type: boolean)
+              predicate: (bigint_col_7 is not null and decimal2016_col_26 is not null and tinyint_col_3 is not null) (type: boolean)
               Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
               Select Operator
                 expressions: tinyint_col_3 (type: tinyint), bigint_col_7 (type: bigint), timestamp_col_9 (type: timestamp), double_col_16 (type: double), decimal2016_col_26 (type: decimal(20,16)), smallint_col_50 (type: smallint)
@@ -79,7 +79,7 @@ STAGE PLANS:
             alias: t2
             Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
             Filter Operator
-              predicate: (tinyint_col_20 is not null and decimal2709_col_9 is not null and tinyint_col_15 is not null) (type: boolean)
+              predicate: (tinyint_col_15 is not null and decimal2709_col_9 is not null and tinyint_col_20 is not null) (type: boolean)
               Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
               Select Operator
                 expressions: decimal2709_col_9 (type: decimal(27,9)), int_col_10 (type: int), tinyint_col_15 (type: tinyint), smallint_col_19 (type: smallint), tinyint_col_20 (type: tinyint)

http://git-wip-us.apache.org/repos/asf/hive/blob/3a3ffaa9/ql/src/test/results/clientpositive/spark/annotate_stats_join.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/annotate_stats_join.q.out b/ql/src/test/results/clientpositive/spark/annotate_stats_join.q.out
index 0667ea9..cd24cbb 100644
--- a/ql/src/test/results/clientpositive/spark/annotate_stats_join.q.out
+++ b/ql/src/test/results/clientpositive/spark/annotate_stats_join.q.out
@@ -214,7 +214,7 @@ STAGE PLANS:
                   alias: emp
                   Statistics: Num rows: 48 Data size: 4752 Basic stats: COMPLETE Column stats: COMPLETE
                   Filter Operator
-                    predicate: (lastname is not null and deptid is not null) (type: boolean)
+                    predicate: (deptid is not null and lastname is not null) (type: boolean)
                     Statistics: Num rows: 48 Data size: 4752 Basic stats: COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: lastname (type: string), deptid (type: int), locid (type: int)
@@ -288,7 +288,7 @@ STAGE PLANS:
                   alias: e
                   Statistics: Num rows: 48 Data size: 4752 Basic stats: COMPLETE Column stats: COMPLETE
                   Filter Operator
-                    predicate: (lastname is not null and deptid is not null) (type: boolean)
+                    predicate: (deptid is not null and lastname is not null) (type: boolean)
                     Statistics: Num rows: 48 Data size: 4752 Basic stats: COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: lastname (type: string), deptid (type: int), locid (type: int)
@@ -362,7 +362,7 @@ STAGE PLANS:
                   alias: emp
                   Statistics: Num rows: 48 Data size: 4752 Basic stats: COMPLETE Column stats: COMPLETE
                   Filter Operator
-                    predicate: (lastname is not null and deptid is not null) (type: boolean)
+                    predicate: (deptid is not null and lastname is not null) (type: boolean)
                     Statistics: Num rows: 48 Data size: 4752 Basic stats: COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: lastname (type: string), deptid (type: int), locid (type: int)
@@ -626,7 +626,7 @@ STAGE PLANS:
                   alias: e
                   Statistics: Num rows: 48 Data size: 4752 Basic stats: COMPLETE Column stats: COMPLETE
                   Filter Operator
-                    predicate: (lastname is not null and deptid is not null) (type: boolean)
+                    predicate: (deptid is not null and lastname is not null) (type: boolean)
                     Statistics: Num rows: 48 Data size: 4752 Basic stats: COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: lastname (type: string), deptid (type: int), locid (type: int)
@@ -661,7 +661,7 @@ STAGE PLANS:
                   alias: l
                   Statistics: Num rows: 8 Data size: 816 Basic stats: COMPLETE Column stats: COMPLETE
                   Filter Operator
-                    predicate: (state is not null and locid is not null) (type: boolean)
+                    predicate: (locid is not null and state is not null) (type: boolean)
                     Statistics: Num rows: 8 Data size: 816 Basic stats: COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: state (type: string), locid (type: int), zip (type: bigint), year (type: int)
@@ -788,7 +788,7 @@ STAGE PLANS:
                   alias: emp
                   Statistics: Num rows: 48 Data size: 4752 Basic stats: COMPLETE Column stats: COMPLETE
                   Filter Operator
-                    predicate: (lastname is not null and deptid is not null) (type: boolean)
+                    predicate: (deptid is not null and lastname is not null) (type: boolean)
                     Statistics: Num rows: 48 Data size: 4752 Basic stats: COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: lastname (type: string), deptid (type: int), locid (type: int)