You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by jc...@apache.org on 2016/01/27 09:30:49 UTC

[05/17] hive git commit: HIVE-12478: Improve Hive/Calcite Transitive Predicate inference (Jesus Camacho Rodriguez, reviewed by Laljo John Pullokkaran)

http://git-wip-us.apache.org/repos/asf/hive/blob/48b201ee/ql/src/test/results/clientpositive/ppd_join3.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/ppd_join3.q.out b/ql/src/test/results/clientpositive/ppd_join3.q.out
index 0000db1..af627bf 100644
--- a/ql/src/test/results/clientpositive/ppd_join3.q.out
+++ b/ql/src/test/results/clientpositive/ppd_join3.q.out
@@ -39,7 +39,7 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((((((((key <> '11') and (key > '0')) and ((value <> 'val_500') or (key > '1'))) and (key < '400')) and (key <> '12')) and (key <> '4')) and (key <> '13')) and (key <> '1')) (type: boolean)
+              predicate: ((((((((key <> '11') and (key < '400')) and (key <> '12')) and (key <> '13')) and (key > '0')) and ((value <> 'val_500') or (key > '1'))) and (key <> '4')) and (key <> '1')) (type: boolean)
               Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
@@ -54,7 +54,7 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((key <> '12') and (key <> '4')) and (key <> '11')) and (key > '0')) and (key < '400')) (type: boolean)
+              predicate: (((((((key <> '12') and (key <> '11')) and (key < '400')) and (key <> '13')) and (key <> '4')) and (key > '0')) and (key <> '1')) (type: boolean)
               Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -96,7 +96,7 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((((key <> '13') and (key <> '1')) and (key <> '11')) and (key > '0')) and (key < '400')) and (key <> '12')) and (key <> '4')) (type: boolean)
+              predicate: (((((((key <> '13') and (key <> '11')) and (key < '400')) and (key <> '12')) and (key <> '1')) and (key > '0')) and (key <> '4')) (type: boolean)
               Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
@@ -1779,7 +1779,7 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((((((((key <> '11') and (key > '0')) and ((value <> 'val_500') or (key > '1'))) and (key < '400')) and (key <> '12')) and (key <> '4')) and (key <> '13')) and (key <> '1')) (type: boolean)
+              predicate: ((((((((key <> '11') and (key < '400')) and (key <> '12')) and (key <> '13')) and (key > '0')) and ((value <> 'val_500') or (key > '1'))) and (key <> '4')) and (key <> '1')) (type: boolean)
               Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
@@ -1794,7 +1794,7 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((key <> '12') and (key <> '4')) and (key <> '11')) and (key > '0')) and (key < '400')) (type: boolean)
+              predicate: (((((((key <> '12') and (key <> '11')) and (key < '400')) and (key <> '13')) and (key <> '4')) and (key > '0')) and (key <> '1')) (type: boolean)
               Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -1836,7 +1836,7 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((((key <> '13') and (key <> '1')) and (key <> '11')) and (key > '0')) and (key < '400')) and (key <> '12')) and (key <> '4')) (type: boolean)
+              predicate: (((((((key <> '13') and (key <> '11')) and (key < '400')) and (key <> '12')) and (key <> '1')) and (key > '0')) and (key <> '4')) (type: boolean)
               Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/48b201ee/ql/src/test/results/clientpositive/ppd_join5.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/ppd_join5.q.out b/ql/src/test/results/clientpositive/ppd_join5.q.out
index b68229e..18a75c6 100644
--- a/ql/src/test/results/clientpositive/ppd_join5.q.out
+++ b/ql/src/test/results/clientpositive/ppd_join5.q.out
@@ -56,7 +56,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (id2 is not null and id1 is not null) (type: boolean)
+              predicate: (id1 is not null and id2 is not null) (type: boolean)
               Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: id1 (type: string), id2 (type: string)
@@ -71,7 +71,7 @@ STAGE PLANS:
             alias: b
             Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((d <= 1) and id is not null) (type: boolean)
+              predicate: (id is not null and (d <= 1)) (type: boolean)
               Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: id (type: string), d (type: int)
@@ -176,7 +176,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (id2 is not null and id1 is not null) (type: boolean)
+              predicate: (id1 is not null and id2 is not null) (type: boolean)
               Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: id1 (type: string), id2 (type: string)
@@ -191,7 +191,7 @@ STAGE PLANS:
             alias: b
             Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((d <= 1) and id is not null) (type: boolean)
+              predicate: (id is not null and (d <= 1)) (type: boolean)
               Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: id (type: string), d (type: int)

http://git-wip-us.apache.org/repos/asf/hive/blob/48b201ee/ql/src/test/results/clientpositive/ppd_outer_join4.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/ppd_outer_join4.q.out b/ql/src/test/results/clientpositive/ppd_outer_join4.q.out
index 289798c..4d89aee 100644
--- a/ql/src/test/results/clientpositive/ppd_outer_join4.q.out
+++ b/ql/src/test/results/clientpositive/ppd_outer_join4.q.out
@@ -38,7 +38,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((sqrt(key) <> 13.0) and (key < '25')) and (key > '15')) and (key < '20')) and (key > '10')) (type: boolean)
+              predicate: (((((sqrt(key) <> 13.0) and (key > '10')) and (key < '20')) and (key > '15')) and (key < '25')) (type: boolean)
               Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
@@ -69,7 +69,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((((key > '15') and (key < '25')) and (key > '10')) and (key < '20')) (type: boolean)
+              predicate: (((((key > '15') and (key < '25')) and (key > '10')) and (key < '20')) and (sqrt(key) <> 13.0)) (type: boolean)
               Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -402,7 +402,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((sqrt(key) <> 13.0) and (key < '25')) and (key > '15')) and (key < '20')) and (key > '10')) (type: boolean)
+              predicate: (((((sqrt(key) <> 13.0) and (key > '10')) and (key < '20')) and (key > '15')) and (key < '25')) (type: boolean)
               Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
@@ -433,7 +433,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((((key > '15') and (key < '25')) and (key > '10')) and (key < '20')) (type: boolean)
+              predicate: (((((key > '15') and (key < '25')) and (key > '10')) and (key < '20')) and (sqrt(key) <> 13.0)) (type: boolean)
               Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/48b201ee/ql/src/test/results/clientpositive/ppd_outer_join5.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/ppd_outer_join5.q.out b/ql/src/test/results/clientpositive/ppd_outer_join5.q.out
index 35fec7a..b2dd5ef 100644
--- a/ql/src/test/results/clientpositive/ppd_outer_join5.q.out
+++ b/ql/src/test/results/clientpositive/ppd_outer_join5.q.out
@@ -45,16 +45,19 @@ STAGE PLANS:
           TableScan
             alias: t1
             Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-            Select Operator
-              expressions: id (type: int), key (type: string), value (type: string)
-              outputColumnNames: _col0, _col1, _col2
+            Filter Operator
+              predicate: (id = 20) (type: boolean)
               Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-              Reduce Output Operator
-                key expressions: _col0 (type: int)
-                sort order: +
-                Map-reduce partition columns: _col0 (type: int)
+              Select Operator
+                expressions: 20 (type: int), key (type: string), value (type: string)
+                outputColumnNames: _col0, _col1, _col2
                 Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-                value expressions: _col1 (type: string), _col2 (type: string)
+                Reduce Output Operator
+                  key expressions: _col0 (type: int)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: int)
+                  Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                  value expressions: _col1 (type: string), _col2 (type: string)
           TableScan
             alias: t2
             Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE

http://git-wip-us.apache.org/repos/asf/hive/blob/48b201ee/ql/src/test/results/clientpositive/ppd_repeated_alias.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/ppd_repeated_alias.q.out b/ql/src/test/results/clientpositive/ppd_repeated_alias.q.out
index 9a21b5c..c0644ef 100644
--- a/ql/src/test/results/clientpositive/ppd_repeated_alias.q.out
+++ b/ql/src/test/results/clientpositive/ppd_repeated_alias.q.out
@@ -210,7 +210,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
             Filter Operator
-              predicate: ((bar = 3) and foo is not null) (type: boolean)
+              predicate: (foo is not null and (bar = 3)) (type: boolean)
               Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
               Select Operator
                 expressions: foo (type: int)

http://git-wip-us.apache.org/repos/asf/hive/blob/48b201ee/ql/src/test/results/clientpositive/ppd_udf_case.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/ppd_udf_case.q.out b/ql/src/test/results/clientpositive/ppd_udf_case.q.out
index 2b407a6..d09ed31 100644
--- a/ql/src/test/results/clientpositive/ppd_udf_case.q.out
+++ b/ql/src/test/results/clientpositive/ppd_udf_case.q.out
@@ -37,7 +37,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 1000 Data size: 10624 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (CASE (key) WHEN ('27') THEN (true) WHEN ('38') THEN (false) ELSE (null) END and key is not null) (type: boolean)
+              predicate: (key is not null and CASE (key) WHEN ('27') THEN (true) WHEN ('38') THEN (false) ELSE (null) END) (type: boolean)
               Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string), hr (type: string)
@@ -53,7 +53,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 1000 Data size: 10624 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (CASE (key) WHEN ('27') THEN (true) WHEN ('38') THEN (false) ELSE (null) END and key is not null) (type: boolean)
+              predicate: (key is not null and CASE (key) WHEN ('27') THEN (true) WHEN ('38') THEN (false) ELSE (null) END) (type: boolean)
               Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string), hr (type: string)
@@ -183,7 +183,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 1000 Data size: 10624 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (CASE (key) WHEN ('27') THEN (true) WHEN ('38') THEN (false) ELSE (null) END and key is not null) (type: boolean)
+              predicate: (key is not null and CASE (key) WHEN ('27') THEN (true) WHEN ('38') THEN (false) ELSE (null) END) (type: boolean)
               Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string), hr (type: string)
@@ -199,7 +199,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 1000 Data size: 10624 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (CASE (key) WHEN ('27') THEN (true) WHEN ('38') THEN (false) ELSE (null) END and key is not null) (type: boolean)
+              predicate: (key is not null and CASE (key) WHEN ('27') THEN (true) WHEN ('38') THEN (false) ELSE (null) END) (type: boolean)
               Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string), hr (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/48b201ee/ql/src/test/results/clientpositive/ppd_union_view.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/ppd_union_view.q.out b/ql/src/test/results/clientpositive/ppd_union_view.q.out
index d33cbd6..ddd236a 100644
--- a/ql/src/test/results/clientpositive/ppd_union_view.q.out
+++ b/ql/src/test/results/clientpositive/ppd_union_view.q.out
@@ -521,7 +521,7 @@ STAGE PLANS:
             GatherStats: false
             Filter Operator
               isSamplingPred: false
-              predicate: ((ds = '2011-10-15') and keymap is not null) (type: boolean)
+              predicate: (keymap is not null and (ds = '2011-10-15')) (type: boolean)
               Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
               Select Operator
                 expressions: keymap (type: string), value (type: string)
@@ -541,7 +541,7 @@ STAGE PLANS:
             GatherStats: false
             Filter Operator
               isSamplingPred: false
-              predicate: ((ds = '2011-10-15') and keymap is not null) (type: boolean)
+              predicate: (keymap is not null and (ds = '2011-10-15')) (type: boolean)
               Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
               Select Operator
                 expressions: key (type: string), keymap (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/48b201ee/ql/src/test/results/clientpositive/quotedid_basic.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/quotedid_basic.q.out b/ql/src/test/results/clientpositive/quotedid_basic.q.out
index 3c81e0b..485aa90 100644
--- a/ql/src/test/results/clientpositive/quotedid_basic.q.out
+++ b/ql/src/test/results/clientpositive/quotedid_basic.q.out
@@ -202,20 +202,20 @@ STAGE PLANS:
               value expressions: _col0 (type: string)
       Reduce Operator Tree:
         Select Operator
-          expressions: VALUE._col0 (type: string), KEY.reducesinkkey1 (type: string)
-          outputColumnNames: _col0, _col1
+          expressions: VALUE._col0 (type: string), KEY.reducesinkkey1 (type: string), '1' (type: string)
+          outputColumnNames: _col0, _col1, _col2
           Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
           PTF Operator
             Function definitions:
                 Input definition
                   input alias: ptf_0
-                  output shape: _col0: string, _col1: string
+                  output shape: _col0: string, _col1: string, _col2: string
                   type: WINDOWING
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
                   order by: _col1
-                  partition by: '1'
+                  partition by: _col2
                   raw input shape:
                   window functions:
                       window function definition
@@ -310,20 +310,20 @@ STAGE PLANS:
               value expressions: _col0 (type: string)
       Reduce Operator Tree:
         Select Operator
-          expressions: VALUE._col0 (type: string), KEY.reducesinkkey1 (type: string)
-          outputColumnNames: _col0, _col1
+          expressions: VALUE._col0 (type: string), KEY.reducesinkkey1 (type: string), '1' (type: string)
+          outputColumnNames: _col0, _col1, _col2
           Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
           PTF Operator
             Function definitions:
                 Input definition
                   input alias: ptf_0
-                  output shape: _col0: string, _col1: string
+                  output shape: _col0: string, _col1: string, _col2: string
                   type: WINDOWING
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
                   order by: _col1
-                  partition by: '1'
+                  partition by: _col2
                   raw input shape:
                   window functions:
                       window function definition

http://git-wip-us.apache.org/repos/asf/hive/blob/48b201ee/ql/src/test/results/clientpositive/regex_col.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/regex_col.q.out b/ql/src/test/results/clientpositive/regex_col.q.out
index 33e1a12..facb974 100644
--- a/ql/src/test/results/clientpositive/regex_col.q.out
+++ b/ql/src/test/results/clientpositive/regex_col.q.out
@@ -87,7 +87,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (value is not null and key is not null) (type: boolean)
+              predicate: (key is not null and value is not null) (type: boolean)
               Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string), ds (type: string), hr (type: string)
@@ -103,7 +103,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (value is not null and key is not null) (type: boolean)
+              predicate: (key is not null and value is not null) (type: boolean)
               Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string), ds (type: string), hr (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/48b201ee/ql/src/test/results/clientpositive/router_join_ppr.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/router_join_ppr.q.out b/ql/src/test/results/clientpositive/router_join_ppr.q.out
index 7182f8d..f2235fb 100644
--- a/ql/src/test/results/clientpositive/router_join_ppr.q.out
+++ b/ql/src/test/results/clientpositive/router_join_ppr.q.out
@@ -1367,7 +1367,7 @@ STAGE PLANS:
             GatherStats: false
             Filter Operator
               isSamplingPred: false
-              predicate: ((((UDFToDouble(key) > 15.0) and (UDFToDouble(key) < 25.0)) and (UDFToDouble(key) < 20.0)) and (UDFToDouble(key) > 10.0)) (type: boolean)
+              predicate: ((((UDFToDouble(key) > 15.0) and (UDFToDouble(key) < 25.0)) and (UDFToDouble(key) > 10.0)) and (UDFToDouble(key) < 20.0)) (type: boolean)
               Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/48b201ee/ql/src/test/results/clientpositive/semijoin.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/semijoin.q.out b/ql/src/test/results/clientpositive/semijoin.q.out
index 496cec9..11b1891 100644
--- a/ql/src/test/results/clientpositive/semijoin.q.out
+++ b/ql/src/test/results/clientpositive/semijoin.q.out
@@ -2528,7 +2528,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 22 Data size: 163 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((key > 100) and value is not null) (type: boolean)
+              predicate: (value is not null and (key > 100)) (type: boolean)
               Statistics: Num rows: 7 Data size: 51 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: int), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/48b201ee/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 7489de2..77f2615 100644
--- a/ql/src/test/results/clientpositive/semijoin4.q.out
+++ b/ql/src/test/results/clientpositive/semijoin4.q.out
@@ -69,23 +69,23 @@ STAGE PLANS:
             alias: t1
             Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
             Filter Operator
-              predicate: ((tinyint_col_46 is not null and bigint_col_13 is not null) and decimal1309_col_65 is not null) (type: boolean)
+              predicate: (((decimal1309_col_65 is not null and bigint_col_13 is not null) and UDFToInteger(tinyint_col_46) is not null) and (UDFToInteger(tinyint_col_46) = -92)) (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), tinyint_col_46 (type: tinyint), double_col_60 (type: double), decimal1309_col_65 (type: decimal(13,9))
-                outputColumnNames: _col0, _col1, _col2, _col3, _col4
+                expressions: bigint_col_13 (type: bigint), smallint_col_24 (type: smallint), double_col_60 (type: double), decimal1309_col_65 (type: decimal(13,9))
+                outputColumnNames: _col0, _col1, _col3, _col4
                 Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                 Reduce Output Operator
-                  key expressions: _col0 (type: bigint), _col4 (type: decimal(27,9)), _col2 (type: tinyint)
+                  key expressions: _col0 (type: bigint), _col4 (type: decimal(27,9)), -92 (type: tinyint)
                   sort order: +++
-                  Map-reduce partition columns: _col0 (type: bigint), _col4 (type: decimal(27,9)), _col2 (type: tinyint)
+                  Map-reduce partition columns: _col0 (type: bigint), _col4 (type: decimal(27,9)), -92 (type: tinyint)
                   Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                   value expressions: _col1 (type: smallint), _col3 (type: double)
           TableScan
             alias: t2
             Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
             Filter Operator
-              predicate: (((decimal2709_col_9 is not null and tinyint_col_18 is not null) and (UDFToInteger(tinyint_col_21) = -92)) and UDFToInteger(tinyint_col_21) is not null) (type: boolean)
+              predicate: (((tinyint_col_18 is not null and decimal2709_col_9 is not null) and UDFToInteger(tinyint_col_21) is not null) and (UDFToInteger(tinyint_col_21) = -92)) (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)), tinyint_col_18 (type: tinyint)
@@ -203,7 +203,7 @@ STAGE PLANS:
             alias: t1
             Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
             Filter Operator
-              predicate: (timestamp_col_66 is not null and decimal1309_col_65 is not null) (type: boolean)
+              predicate: (decimal1309_col_65 is not null and timestamp_col_66 is not null) (type: boolean)
               Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
               Select Operator
                 expressions: decimal1309_col_65 (type: decimal(13,9)), timestamp_col_66 (type: timestamp)
@@ -218,7 +218,7 @@ STAGE PLANS:
             alias: t2
             Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
             Filter Operator
-              predicate: (timestamp_col_19 is not null and decimal1911_col_16 is not null) (type: boolean)
+              predicate: (decimal1911_col_16 is not null and timestamp_col_19 is not null) (type: boolean)
               Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
               Select Operator
                 expressions: decimal1911_col_16 (type: decimal(19,11)), timestamp_col_19 (type: timestamp)

http://git-wip-us.apache.org/repos/asf/hive/blob/48b201ee/ql/src/test/results/clientpositive/skewjoin.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/skewjoin.q.out b/ql/src/test/results/clientpositive/skewjoin.q.out
index 4e98dfd..0782e0d 100644
--- a/ql/src/test/results/clientpositive/skewjoin.q.out
+++ b/ql/src/test/results/clientpositive/skewjoin.q.out
@@ -768,7 +768,7 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (value is not null and key is not null) (type: boolean)
+              predicate: (key is not null and value is not null) (type: boolean)
               Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -783,7 +783,7 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (value is not null and key is not null) (type: boolean)
+              predicate: (key is not null and value is not null) (type: boolean)
               Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -984,17 +984,17 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (UDFToDouble(key) < 100.0) (type: boolean)
-              Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
+              predicate: ((UDFToDouble(key) < 100.0) and (UDFToDouble(key) < 80.0)) (type: boolean)
+              Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
                 outputColumnNames: _col0, _col1
-                Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
+                Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
                 Reduce Output Operator
                   key expressions: _col0 (type: string)
                   sort order: +
                   Map-reduce partition columns: _col0 (type: string)
-                  Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
+                  Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
                   value expressions: _col1 (type: string)
       Reduce Operator Tree:
         Join Operator
@@ -1007,11 +1007,11 @@ STAGE PLANS:
             1 _col0 (type: string)
             2 _col0 (type: string)
           outputColumnNames: _col0, _col3
-          Statistics: Num rows: 365 Data size: 3878 Basic stats: COMPLETE Column stats: NONE
+          Statistics: Num rows: 121 Data size: 1284 Basic stats: COMPLETE Column stats: NONE
           Select Operator
             expressions: hash(_col0) (type: int), hash(_col3) (type: int)
             outputColumnNames: _col0, _col1
-            Statistics: Num rows: 365 Data size: 3878 Basic stats: COMPLETE Column stats: NONE
+            Statistics: Num rows: 121 Data size: 1284 Basic stats: COMPLETE Column stats: NONE
             Group By Operator
               aggregations: sum(_col0), sum(_col1)
               mode: hash
@@ -1068,7 +1068,7 @@ STAGE PLANS:
               Select Operator
                 expressions: hash(_col0) (type: int), hash(_col3) (type: int)
                 outputColumnNames: _col0, _col1
-                Statistics: Num rows: 365 Data size: 3878 Basic stats: COMPLETE Column stats: NONE
+                Statistics: Num rows: 121 Data size: 1284 Basic stats: COMPLETE Column stats: NONE
                 Group By Operator
                   aggregations: sum(_col0), sum(_col1)
                   mode: hash
@@ -1146,7 +1146,7 @@ STAGE PLANS:
               Select Operator
                 expressions: hash(_col0) (type: int), hash(_col3) (type: int)
                 outputColumnNames: _col0, _col1
-                Statistics: Num rows: 365 Data size: 3878 Basic stats: COMPLETE Column stats: NONE
+                Statistics: Num rows: 121 Data size: 1284 Basic stats: COMPLETE Column stats: NONE
                 Group By Operator
                   aggregations: sum(_col0), sum(_col1)
                   mode: hash

http://git-wip-us.apache.org/repos/asf/hive/blob/48b201ee/ql/src/test/results/clientpositive/skewjoinopt12.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/skewjoinopt12.q.out b/ql/src/test/results/clientpositive/skewjoinopt12.q.out
index 5109173..6c38b97 100644
--- a/ql/src/test/results/clientpositive/skewjoinopt12.q.out
+++ b/ql/src/test/results/clientpositive/skewjoinopt12.q.out
@@ -62,7 +62,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((val is not null and key is not null) and ((((key = '2') and (val = '12')) or ((key = '8') and (val = '18'))) or ((key = '3') and (val = '13')))) (type: boolean)
+              predicate: ((key is not null and val is not null) and ((((key = '2') and (val = '12')) or ((key = '8') and (val = '18'))) or ((key = '3') and (val = '13')))) (type: boolean)
               Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), val (type: string)
@@ -77,7 +77,7 @@ STAGE PLANS:
             alias: b
             Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((val is not null and key is not null) and ((((key = '2') and (val = '12')) or ((key = '8') and (val = '18'))) or ((key = '3') and (val = '13')))) (type: boolean)
+              predicate: ((key is not null and val is not null) and ((((key = '2') and (val = '12')) or ((key = '8') and (val = '18'))) or ((key = '3') and (val = '13')))) (type: boolean)
               Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), val (type: string)
@@ -135,7 +135,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((val is not null and key is not null) and (not ((((key = '2') and (val = '12')) or ((key = '8') and (val = '18'))) or ((key = '3') and (val = '13'))))) (type: boolean)
+              predicate: ((key is not null and val is not null) and (not ((((key = '2') and (val = '12')) or ((key = '8') and (val = '18'))) or ((key = '3') and (val = '13'))))) (type: boolean)
               Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), val (type: string)
@@ -150,7 +150,7 @@ STAGE PLANS:
             alias: b
             Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((val is not null and key is not null) and (not ((((key = '2') and (val = '12')) or ((key = '8') and (val = '18'))) or ((key = '3') and (val = '13'))))) (type: boolean)
+              predicate: ((key is not null and val is not null) and (not ((((key = '2') and (val = '12')) or ((key = '8') and (val = '18'))) or ((key = '3') and (val = '13'))))) (type: boolean)
               Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), val (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/48b201ee/ql/src/test/results/clientpositive/skewjoinopt16.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/skewjoinopt16.q.out b/ql/src/test/results/clientpositive/skewjoinopt16.q.out
index de98696..15b3e62 100644
--- a/ql/src/test/results/clientpositive/skewjoinopt16.q.out
+++ b/ql/src/test/results/clientpositive/skewjoinopt16.q.out
@@ -62,7 +62,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((val is not null and key is not null) and (((key = '2') and (val = '12')) or (key = '3'))) (type: boolean)
+              predicate: ((key is not null and val is not null) and (((key = '2') and (val = '12')) or (key = '3'))) (type: boolean)
               Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), val (type: string)
@@ -77,7 +77,7 @@ STAGE PLANS:
             alias: b
             Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((val is not null and key is not null) and (((key = '2') and (val = '12')) or (key = '3'))) (type: boolean)
+              predicate: ((key is not null and val is not null) and (((key = '2') and (val = '12')) or (key = '3'))) (type: boolean)
               Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), val (type: string)
@@ -135,7 +135,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((val is not null and key is not null) and (not (((key = '2') and (val = '12')) or (key = '3')))) (type: boolean)
+              predicate: ((key is not null and val is not null) and (not (((key = '2') and (val = '12')) or (key = '3')))) (type: boolean)
               Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), val (type: string)
@@ -150,7 +150,7 @@ STAGE PLANS:
             alias: b
             Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((val is not null and key is not null) and (not (((key = '2') and (val = '12')) or (key = '3')))) (type: boolean)
+              predicate: ((key is not null and val is not null) and (not (((key = '2') and (val = '12')) or (key = '3')))) (type: boolean)
               Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), val (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/48b201ee/ql/src/test/results/clientpositive/skewjoinopt17.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/skewjoinopt17.q.out b/ql/src/test/results/clientpositive/skewjoinopt17.q.out
index ea2b670..a48d245 100644
--- a/ql/src/test/results/clientpositive/skewjoinopt17.q.out
+++ b/ql/src/test/results/clientpositive/skewjoinopt17.q.out
@@ -286,7 +286,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((val is not null and key is not null) and (((key = '2') and (val = '12')) or (key = '2'))) (type: boolean)
+              predicate: ((key is not null and val is not null) and (((key = '2') and (val = '12')) or (key = '2'))) (type: boolean)
               Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), val (type: string)
@@ -301,7 +301,7 @@ STAGE PLANS:
             alias: b
             Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((val is not null and key is not null) and (((key = '2') and (val = '12')) or (key = '2'))) (type: boolean)
+              predicate: ((key is not null and val is not null) and (((key = '2') and (val = '12')) or (key = '2'))) (type: boolean)
               Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), val (type: string)
@@ -359,7 +359,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((val is not null and key is not null) and (not (((key = '2') and (val = '12')) or (key = '2')))) (type: boolean)
+              predicate: ((key is not null and val is not null) and (not (((key = '2') and (val = '12')) or (key = '2')))) (type: boolean)
               Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), val (type: string)
@@ -374,7 +374,7 @@ STAGE PLANS:
             alias: b
             Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((val is not null and key is not null) and (not (((key = '2') and (val = '12')) or (key = '2')))) (type: boolean)
+              predicate: ((key is not null and val is not null) and (not (((key = '2') and (val = '12')) or (key = '2')))) (type: boolean)
               Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), val (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/48b201ee/ql/src/test/results/clientpositive/skewjoinopt2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/skewjoinopt2.q.out b/ql/src/test/results/clientpositive/skewjoinopt2.q.out
index c2ae731..d37237f 100644
--- a/ql/src/test/results/clientpositive/skewjoinopt2.q.out
+++ b/ql/src/test/results/clientpositive/skewjoinopt2.q.out
@@ -70,7 +70,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((val is not null and key is not null) and ((((key = '2') or (key = '7')) or (key = '3')) or (key = '8'))) (type: boolean)
+              predicate: ((key is not null and val is not null) and ((((key = '2') or (key = '7')) or (key = '3')) or (key = '8'))) (type: boolean)
               Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), val (type: string)
@@ -85,7 +85,7 @@ STAGE PLANS:
             alias: b
             Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((val is not null and key is not null) and ((((key = '2') or (key = '7')) or (key = '3')) or (key = '8'))) (type: boolean)
+              predicate: ((key is not null and val is not null) and ((((key = '2') or (key = '7')) or (key = '3')) or (key = '8'))) (type: boolean)
               Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), val (type: string)
@@ -143,7 +143,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((val is not null and key is not null) and (not ((((key = '2') or (key = '7')) or (key = '3')) or (key = '8')))) (type: boolean)
+              predicate: ((key is not null and val is not null) and (not ((((key = '2') or (key = '7')) or (key = '3')) or (key = '8')))) (type: boolean)
               Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), val (type: string)
@@ -158,7 +158,7 @@ STAGE PLANS:
             alias: b
             Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((val is not null and key is not null) and (not ((((key = '2') or (key = '7')) or (key = '3')) or (key = '8')))) (type: boolean)
+              predicate: ((key is not null and val is not null) and (not ((((key = '2') or (key = '7')) or (key = '3')) or (key = '8')))) (type: boolean)
               Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), val (type: string)
@@ -388,7 +388,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((val is not null and key is not null) and ((((key = '2') or (key = '7')) or (key = '3')) or (key = '8'))) (type: boolean)
+              predicate: ((key is not null and val is not null) and ((((key = '2') or (key = '7')) or (key = '3')) or (key = '8'))) (type: boolean)
               Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), val (type: string)
@@ -403,7 +403,7 @@ STAGE PLANS:
             alias: b
             Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((val is not null and key is not null) and ((((key = '2') or (key = '7')) or (key = '3')) or (key = '8'))) (type: boolean)
+              predicate: ((key is not null and val is not null) and ((((key = '2') or (key = '7')) or (key = '3')) or (key = '8'))) (type: boolean)
               Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), val (type: string)
@@ -485,7 +485,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((val is not null and key is not null) and (not ((((key = '2') or (key = '7')) or (key = '3')) or (key = '8')))) (type: boolean)
+              predicate: ((key is not null and val is not null) and (not ((((key = '2') or (key = '7')) or (key = '3')) or (key = '8')))) (type: boolean)
               Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), val (type: string)
@@ -500,7 +500,7 @@ STAGE PLANS:
             alias: b
             Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((val is not null and key is not null) and (not ((((key = '2') or (key = '7')) or (key = '3')) or (key = '8')))) (type: boolean)
+              predicate: ((key is not null and val is not null) and (not ((((key = '2') or (key = '7')) or (key = '3')) or (key = '8')))) (type: boolean)
               Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), val (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/48b201ee/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 baa1dcb..c1efd1f 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
@@ -250,7 +250,7 @@ STAGE PLANS:
                   alias: emp
                   Statistics: Num rows: 48 Data size: 4752 Basic stats: COMPLETE Column stats: COMPLETE
                   Filter Operator
-                    predicate: (deptid is not null and lastname is not null) (type: boolean)
+                    predicate: (lastname is not null and deptid 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)
@@ -268,7 +268,7 @@ STAGE PLANS:
                   alias: dept
                   Statistics: Num rows: 6 Data size: 570 Basic stats: COMPLETE Column stats: COMPLETE
                   Filter Operator
-                    predicate: (deptname is not null and deptid is not null) (type: boolean)
+                    predicate: (deptid is not null and deptname is not null) (type: boolean)
                     Statistics: Num rows: 6 Data size: 570 Basic stats: COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: deptid (type: int), deptname (type: string)
@@ -324,7 +324,7 @@ STAGE PLANS:
                   alias: e
                   Statistics: Num rows: 48 Data size: 4752 Basic stats: COMPLETE Column stats: COMPLETE
                   Filter Operator
-                    predicate: (deptid is not null and lastname is not null) (type: boolean)
+                    predicate: (lastname is not null and deptid 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)
@@ -342,7 +342,7 @@ STAGE PLANS:
                   alias: d
                   Statistics: Num rows: 6 Data size: 570 Basic stats: COMPLETE Column stats: COMPLETE
                   Filter Operator
-                    predicate: (deptname is not null and deptid is not null) (type: boolean)
+                    predicate: (deptid is not null and deptname is not null) (type: boolean)
                     Statistics: Num rows: 6 Data size: 570 Basic stats: COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: deptid (type: int), deptname (type: string)
@@ -402,7 +402,7 @@ STAGE PLANS:
                   alias: emp
                   Statistics: Num rows: 48 Data size: 4752 Basic stats: COMPLETE Column stats: COMPLETE
                   Filter Operator
-                    predicate: (deptid is not null and lastname is not null) (type: boolean)
+                    predicate: (lastname is not null and deptid 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)
@@ -420,7 +420,7 @@ STAGE PLANS:
                   alias: dept
                   Statistics: Num rows: 6 Data size: 570 Basic stats: COMPLETE Column stats: COMPLETE
                   Filter Operator
-                    predicate: (deptname is not null and deptid is not null) (type: boolean)
+                    predicate: (deptid is not null and deptname is not null) (type: boolean)
                     Statistics: Num rows: 6 Data size: 570 Basic stats: COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: deptid (type: int), deptname (type: string)
@@ -676,7 +676,7 @@ STAGE PLANS:
                   alias: e
                   Statistics: Num rows: 48 Data size: 4752 Basic stats: COMPLETE Column stats: COMPLETE
                   Filter Operator
-                    predicate: (deptid is not null and lastname is not null) (type: boolean)
+                    predicate: (lastname is not null and deptid 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)
@@ -694,7 +694,7 @@ STAGE PLANS:
                   alias: d
                   Statistics: Num rows: 6 Data size: 570 Basic stats: COMPLETE Column stats: COMPLETE
                   Filter Operator
-                    predicate: (deptname is not null and deptid is not null) (type: boolean)
+                    predicate: (deptid is not null and deptname is not null) (type: boolean)
                     Statistics: Num rows: 6 Data size: 570 Basic stats: COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: deptid (type: int), deptname (type: string)
@@ -711,7 +711,7 @@ STAGE PLANS:
                   alias: l
                   Statistics: Num rows: 8 Data size: 804 Basic stats: COMPLETE Column stats: COMPLETE
                   Filter Operator
-                    predicate: (locid is not null and state is not null) (type: boolean)
+                    predicate: (state is not null and locid is not null) (type: boolean)
                     Statistics: Num rows: 8 Data size: 804 Basic stats: COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: state (type: string), locid (type: int), zip (type: bigint), year (type: int)

http://git-wip-us.apache.org/repos/asf/hive/blob/48b201ee/ql/src/test/results/clientpositive/spark/auto_join12.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/auto_join12.q.out b/ql/src/test/results/clientpositive/spark/auto_join12.q.out
index 158e535..d324c4c 100644
--- a/ql/src/test/results/clientpositive/spark/auto_join12.q.out
+++ b/ql/src/test/results/clientpositive/spark/auto_join12.q.out
@@ -30,13 +30,13 @@ STAGE PLANS:
     Spark
 #### A masked pattern was here ####
       Vertices:
-        Map 1 
+        Map 3 
             Map Operator Tree:
                 TableScan
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((UDFToDouble(key) < 100.0) and (UDFToDouble(key) < 80.0)) (type: boolean)
+                    predicate: ((UDFToDouble(key) < 80.0) and (UDFToDouble(key) < 100.0)) (type: boolean)
                     Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -49,17 +49,17 @@ STAGE PLANS:
                           2 _col0 (type: string)
             Local Work:
               Map Reduce Local Work
-        Map 2 
+        Map 4 
             Map Operator Tree:
                 TableScan
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((UDFToDouble(key) < 80.0) and (UDFToDouble(key) < 100.0)) (type: boolean)
+                    predicate: ((UDFToDouble(key) < 100.0) and (UDFToDouble(key) < 80.0)) (type: boolean)
                     Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: key (type: string)
-                      outputColumnNames: _col0
+                      expressions: key (type: string), value (type: string)
+                      outputColumnNames: _col0, _col1
                       Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
                       Spark HashTable Sink Operator
                         keys:
@@ -72,21 +72,21 @@ STAGE PLANS:
   Stage: Stage-1
     Spark
       Edges:
-        Reducer 4 <- Map 3 (GROUP, 1)
+        Reducer 2 <- Map 1 (GROUP, 1)
 #### A masked pattern was here ####
       Vertices:
-        Map 3 
+        Map 1 
             Map Operator Tree:
                 TableScan
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (UDFToDouble(key) < 100.0) (type: boolean)
-                    Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
+                    predicate: ((UDFToDouble(key) < 100.0) and (UDFToDouble(key) < 80.0)) (type: boolean)
+                    Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: key (type: string), value (type: string)
-                      outputColumnNames: _col0, _col1
-                      Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
+                      expressions: key (type: string)
+                      outputColumnNames: _col0
+                      Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
                       Map Join Operator
                         condition map:
                              Inner Join 0 to 1
@@ -97,13 +97,13 @@ STAGE PLANS:
                           2 _col0 (type: string)
                         outputColumnNames: _col0, _col3
                         input vertices:
-                          0 Map 1
-                          1 Map 2
-                        Statistics: Num rows: 365 Data size: 3878 Basic stats: COMPLETE Column stats: NONE
+                          1 Map 3
+                          2 Map 4
+                        Statistics: Num rows: 121 Data size: 1284 Basic stats: COMPLETE Column stats: NONE
                         Select Operator
                           expressions: hash(_col0,_col3) (type: int)
                           outputColumnNames: _col0
-                          Statistics: Num rows: 365 Data size: 3878 Basic stats: COMPLETE Column stats: NONE
+                          Statistics: Num rows: 121 Data size: 1284 Basic stats: COMPLETE Column stats: NONE
                           Group By Operator
                             aggregations: sum(_col0)
                             mode: hash
@@ -115,7 +115,7 @@ STAGE PLANS:
                               value expressions: _col0 (type: bigint)
             Local Work:
               Map Reduce Local Work
-        Reducer 4 
+        Reducer 2 
             Reduce Operator Tree:
               Group By Operator
                 aggregations: sum(VALUE._col0)

http://git-wip-us.apache.org/repos/asf/hive/blob/48b201ee/ql/src/test/results/clientpositive/spark/auto_join16.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/auto_join16.q.out b/ql/src/test/results/clientpositive/spark/auto_join16.q.out
index ba6336a..b31f63c 100644
--- a/ql/src/test/results/clientpositive/spark/auto_join16.q.out
+++ b/ql/src/test/results/clientpositive/spark/auto_join16.q.out
@@ -30,7 +30,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((UDFToDouble(value) < 200.0) and (UDFToDouble(key) > 20.0)) and (UDFToDouble(key) > 10.0)) (type: boolean)
+                    predicate: (((UDFToDouble(key) > 10.0) and (UDFToDouble(key) > 20.0)) and (UDFToDouble(value) < 200.0)) (type: boolean)
                     Statistics: Num rows: 18 Data size: 191 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/48b201ee/ql/src/test/results/clientpositive/spark/auto_join32.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/auto_join32.q.out b/ql/src/test/results/clientpositive/spark/auto_join32.q.out
index 2dd6cc1..fe8f967 100644
--- a/ql/src/test/results/clientpositive/spark/auto_join32.q.out
+++ b/ql/src/test/results/clientpositive/spark/auto_join32.q.out
@@ -459,7 +459,7 @@ STAGE PLANS:
                   alias: s
                   Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                   Filter Operator
-                    predicate: ((p = 'bar') and name is not null) (type: boolean)
+                    predicate: (name is not null and (p = 'bar')) (type: boolean)
                     Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                     Select Operator
                       expressions: name (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/48b201ee/ql/src/test/results/clientpositive/spark/auto_join_without_localtask.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/auto_join_without_localtask.q.out b/ql/src/test/results/clientpositive/spark/auto_join_without_localtask.q.out
index f055a59..68e51a7 100644
--- a/ql/src/test/results/clientpositive/spark/auto_join_without_localtask.q.out
+++ b/ql/src/test/results/clientpositive/spark/auto_join_without_localtask.q.out
@@ -337,7 +337,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((UDFToDouble(key) > 100.0) and value is not null) (type: boolean)
+                    predicate: (value is not null and (UDFToDouble(key) > 100.0)) (type: boolean)
                     Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/48b201ee/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_6.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_6.q.out b/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_6.q.out
index e8e1e7e..c33dee3 100644
--- a/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_6.q.out
+++ b/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_6.q.out
@@ -89,7 +89,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 10 Data size: 91 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key2 is not null and key is not null) (type: boolean)
+                    predicate: (key is not null and key2 is not null) (type: boolean)
                     Statistics: Num rows: 10 Data size: 91 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int), key2 (type: int), value (type: string)
@@ -114,7 +114,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 84 Data size: 979 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key2 is not null and key is not null) (type: boolean)
+                    predicate: (key is not null and key2 is not null) (type: boolean)
                     Statistics: Num rows: 84 Data size: 979 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int), key2 (type: int), value (type: string)
@@ -276,7 +276,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 10 Data size: 91 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key2 is not null and key is not null) (type: boolean)
+                    predicate: (key is not null and key2 is not null) (type: boolean)
                     Statistics: Num rows: 10 Data size: 91 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int), key2 (type: int), value (type: string)
@@ -301,7 +301,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 84 Data size: 979 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key2 is not null and key is not null) (type: boolean)
+                    predicate: (key is not null and key2 is not null) (type: boolean)
                     Statistics: Num rows: 84 Data size: 979 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int), key2 (type: int), value (type: string)
@@ -463,7 +463,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 10 Data size: 91 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key2 is not null and key is not null) (type: boolean)
+                    predicate: (key is not null and key2 is not null) (type: boolean)
                     Statistics: Num rows: 10 Data size: 91 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int), key2 (type: int), value (type: string)
@@ -488,7 +488,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 84 Data size: 979 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key2 is not null and key is not null) (type: boolean)
+                    predicate: (key is not null and key2 is not null) (type: boolean)
                     Statistics: Num rows: 84 Data size: 979 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int), key2 (type: int), value (type: string)
@@ -585,7 +585,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 10 Data size: 91 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key2 is not null and key is not null) (type: boolean)
+                    predicate: (key is not null and key2 is not null) (type: boolean)
                     Statistics: Num rows: 10 Data size: 91 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int), key2 (type: int), value (type: string)
@@ -610,7 +610,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 84 Data size: 979 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key2 is not null and key is not null) (type: boolean)
+                    predicate: (key is not null and key2 is not null) (type: boolean)
                     Statistics: Num rows: 84 Data size: 979 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int), key2 (type: int), value (type: string)
@@ -713,7 +713,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 10 Data size: 91 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key2 is not null and key is not null) (type: boolean)
+                    predicate: (key is not null and key2 is not null) (type: boolean)
                     Statistics: Num rows: 10 Data size: 91 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int), key2 (type: int), value (type: string)
@@ -738,7 +738,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 84 Data size: 979 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key2 is not null and key is not null) (type: boolean)
+                    predicate: (key is not null and key2 is not null) (type: boolean)
                     Statistics: Num rows: 84 Data size: 979 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int), key2 (type: int), value (type: string)
@@ -918,7 +918,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 10 Data size: 91 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key2 is not null and key is not null) (type: boolean)
+                    predicate: (key is not null and key2 is not null) (type: boolean)
                     Statistics: Num rows: 10 Data size: 91 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int), key2 (type: int), value (type: string)
@@ -943,7 +943,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 84 Data size: 979 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key2 is not null and key is not null) (type: boolean)
+                    predicate: (key is not null and key2 is not null) (type: boolean)
                     Statistics: Num rows: 84 Data size: 979 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int), key2 (type: int), value (type: string)
@@ -1133,7 +1133,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 10 Data size: 91 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key2 is not null and key is not null) (type: boolean)
+                    predicate: (key is not null and key2 is not null) (type: boolean)
                     Statistics: Num rows: 10 Data size: 91 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int), key2 (type: int), value (type: string)
@@ -1158,7 +1158,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 84 Data size: 979 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key2 is not null and key is not null) (type: boolean)
+                    predicate: (key is not null and key2 is not null) (type: boolean)
                     Statistics: Num rows: 84 Data size: 979 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/48b201ee/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_7.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_7.q.out b/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_7.q.out
index 0b64a87..5bc777d 100644
--- a/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_7.q.out
+++ b/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_7.q.out
@@ -89,7 +89,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key = 0) or (key = 5)) and key is not null) (type: boolean)
+                    predicate: (key is not null and ((key = 0) or (key = 5))) (type: boolean)
                     Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int), value (type: string)
@@ -114,7 +114,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 84 Data size: 736 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key = 0) or (key = 5)) and key is not null) (type: boolean)
+                    predicate: (key is not null and ((key = 0) or (key = 5))) (type: boolean)
                     Statistics: Num rows: 84 Data size: 736 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/48b201ee/ql/src/test/results/clientpositive/spark/constprog_partitioner.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/constprog_partitioner.q.out b/ql/src/test/results/clientpositive/spark/constprog_partitioner.q.out
index 8a6ab82..66cd5cc 100644
--- a/ql/src/test/results/clientpositive/spark/constprog_partitioner.q.out
+++ b/ql/src/test/results/clientpositive/spark/constprog_partitioner.q.out
@@ -121,7 +121,7 @@ STAGE PLANS:
                   alias: li
                   Statistics: Num rows: 100 Data size: 11999 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((l_linenumber = 1) and l_orderkey is not null) (type: boolean)
+                    predicate: (l_orderkey is not null and (l_linenumber = 1)) (type: boolean)
                     Statistics: Num rows: 50 Data size: 5999 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: l_orderkey (type: int), l_partkey (type: int), l_suppkey (type: int), 1 (type: int)
@@ -139,7 +139,7 @@ STAGE PLANS:
                   alias: li
                   Statistics: Num rows: 100 Data size: 11999 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((l_shipmode = 'AIR') and (l_linenumber = 1)) and l_orderkey is not null) (type: boolean)
+                    predicate: (((l_shipmode = 'AIR') and l_orderkey is not null) and (l_linenumber = 1)) (type: boolean)
                     Statistics: Num rows: 25 Data size: 2999 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: l_orderkey (type: int)

http://git-wip-us.apache.org/repos/asf/hive/blob/48b201ee/ql/src/test/results/clientpositive/spark/dynamic_rdd_cache.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/dynamic_rdd_cache.q.out b/ql/src/test/results/clientpositive/spark/dynamic_rdd_cache.q.out
index 6e595ff..8639871 100644
--- a/ql/src/test/results/clientpositive/spark/dynamic_rdd_cache.q.out
+++ b/ql/src/test/results/clientpositive/spark/dynamic_rdd_cache.q.out
@@ -749,7 +749,7 @@ STAGE PLANS:
                   alias: date_dim
                   Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                   Filter Operator
-                    predicate: (((d_year = 1999) and (d_moy = 3)) and d_date_sk is not null) (type: boolean)
+                    predicate: (((d_year = 1999) and d_date_sk is not null) and (d_moy = 3)) (type: boolean)
                     Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                     Select Operator
                       expressions: d_date_sk (type: int)
@@ -819,7 +819,7 @@ STAGE PLANS:
                   alias: date_dim
                   Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                   Filter Operator
-                    predicate: (((d_moy = 4) and (d_year = 1999)) and d_date_sk is not null) (type: boolean)
+                    predicate: (((d_year = 1999) and d_date_sk is not null) and (d_moy = 4)) (type: boolean)
                     Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                     Select Operator
                       expressions: d_date_sk (type: int)
@@ -908,46 +908,46 @@ STAGE PLANS:
                 outputColumnNames: _col2, _col4, _col5, _col6
                 Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                 Select Operator
-                  expressions: _col4 (type: int), _col5 (type: int), _col6 (type: string), 4 (type: int), _col2 (type: int)
-                  outputColumnNames: _col4, _col5, _col6, _col9, _col2
+                  expressions: _col6 (type: string), _col5 (type: int), _col4 (type: int), _col2 (type: int)
+                  outputColumnNames: _col0, _col1, _col2, _col4
                   Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                   Group By Operator
-                    aggregations: stddev_samp(_col2), avg(_col2)
-                    keys: _col4 (type: int), _col5 (type: int), _col6 (type: string), _col9 (type: int)
+                    aggregations: avg(_col4), stddev_samp(_col4)
+                    keys: _col0 (type: string), _col1 (type: int), _col2 (type: int), 4 (type: int)
                     mode: hash
                     outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
                     Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                     Reduce Output Operator
-                      key expressions: _col0 (type: int), _col1 (type: int), _col2 (type: string), _col3 (type: int)
+                      key expressions: _col0 (type: string), _col1 (type: int), _col2 (type: int), 4 (type: int)
                       sort order: ++++
-                      Map-reduce partition columns: _col0 (type: int), _col1 (type: int), _col2 (type: string), _col3 (type: int)
+                      Map-reduce partition columns: _col0 (type: string), _col1 (type: int), _col2 (type: int), 4 (type: int)
                       Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-                      value expressions: _col4 (type: struct<count:bigint,sum:double,variance:double>), _col5 (type: struct<count:bigint,sum:double,input:int>)
+                      value expressions: _col4 (type: struct<count:bigint,sum:double,input:int>), _col5 (type: struct<count:bigint,sum:double,variance:double>)
         Reducer 15 
             Reduce Operator Tree:
               Group By Operator
-                aggregations: stddev_samp(VALUE._col0), avg(VALUE._col1)
-                keys: KEY._col0 (type: int), KEY._col1 (type: int), KEY._col2 (type: string), KEY._col3 (type: int)
+                aggregations: avg(VALUE._col0), stddev_samp(VALUE._col1)
+                keys: KEY._col0 (type: string), KEY._col1 (type: int), KEY._col2 (type: int), 4 (type: int)
                 mode: mergepartial
                 outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
                 Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                 Select Operator
-                  expressions: _col1 (type: int), _col0 (type: int), _col3 (type: int), _col4 (type: double), _col5 (type: double)
-                  outputColumnNames: _col1, _col2, _col3, _col4, _col5
+                  expressions: _col1 (type: int), _col2 (type: int), _col4 (type: double), _col5 (type: double)
+                  outputColumnNames: _col1, _col2, _col4, _col5
                   Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                   Filter Operator
-                    predicate: (CASE (_col5) WHEN (0) THEN (0) ELSE ((_col4 / _col5)) END > 1.0) (type: boolean)
+                    predicate: (CASE (_col4) WHEN (0) THEN (0) ELSE ((_col5 / _col4)) END > 1.0) (type: boolean)
                     Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                     Select Operator
-                      expressions: _col1 (type: int), _col2 (type: int), _col3 (type: int), _col5 (type: double), CASE (_col5) WHEN (0) THEN (null) ELSE ((_col4 / _col5)) END (type: double)
-                      outputColumnNames: _col1, _col2, _col3, _col4, _col5
+                      expressions: _col1 (type: int), _col2 (type: int), _col4 (type: double), CASE (_col4) WHEN (0) THEN (null) ELSE ((_col5 / _col4)) END (type: double)
+                      outputColumnNames: _col1, _col2, _col4, _col5
                       Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                       Reduce Output Operator
                         key expressions: _col2 (type: int), _col1 (type: int)
                         sort order: ++
                         Map-reduce partition columns: _col2 (type: int), _col1 (type: int)
                         Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-                        value expressions: _col3 (type: int), _col4 (type: double), _col5 (type: double)
+                        value expressions: _col4 (type: double), _col5 (type: double)
         Reducer 2 
             Reduce Operator Tree:
               Join Operator
@@ -1023,37 +1023,37 @@ STAGE PLANS:
                     Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                     Select Operator
                       expressions: _col1 (type: int), _col2 (type: int), _col4 (type: double), CASE (_col4) WHEN (0) THEN (null) ELSE ((_col5 / _col4)) END (type: double)
-                      outputColumnNames: _col0, _col1, _col2, _col3
+                      outputColumnNames: _col1, _col2, _col4, _col5
                       Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                       Reduce Output Operator
-                        key expressions: _col1 (type: int), _col0 (type: int)
+                        key expressions: _col2 (type: int), _col1 (type: int)
                         sort order: ++
-                        Map-reduce partition columns: _col1 (type: int), _col0 (type: int)
+                        Map-reduce partition columns: _col2 (type: int), _col1 (type: int)
                         Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-                        value expressions: _col2 (type: double), _col3 (type: double)
+                        value expressions: _col4 (type: double), _col5 (type: double)
         Reducer 6 
             Reduce Operator Tree:
               Join Operator
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 _col1 (type: int), _col0 (type: int)
+                  0 _col2 (type: int), _col1 (type: int)
                   1 _col2 (type: int), _col1 (type: int)
-                outputColumnNames: _col0, _col1, _col2, _col3, _col5, _col6, _col7, _col8, _col9
+                outputColumnNames: _col1, _col2, _col4, _col5, _col7, _col8, _col10, _col11
                 Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                 Select Operator
-                  expressions: _col0 (type: int), _col1 (type: int), _col2 (type: double), _col3 (type: double), _col5 (type: int), _col6 (type: int), _col7 (type: int), _col8 (type: double), _col9 (type: double)
-                  outputColumnNames: _col0, _col1, _col3, _col4, _col5, _col6, _col7, _col8, _col9
+                  expressions: _col1 (type: int), _col2 (type: int), _col4 (type: double), _col5 (type: double), _col7 (type: int), _col8 (type: int), _col10 (type: double), _col11 (type: double)
+                  outputColumnNames: _col0, _col1, _col3, _col4, _col5, _col6, _col8, _col9
                   Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                   Reduce Output Operator
-                    key expressions: _col0 (type: int), _col1 (type: int), 3 (type: int), _col3 (type: double), _col4 (type: double), _col7 (type: int), _col8 (type: double), _col9 (type: double)
+                    key expressions: _col0 (type: int), _col1 (type: int), 3 (type: int), _col3 (type: double), _col4 (type: double), 4 (type: int), _col8 (type: double), _col9 (type: double)
                     sort order: ++++++++
                     Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                     value expressions: _col5 (type: int), _col6 (type: int)
         Reducer 7 
             Reduce Operator Tree:
               Select Operator
-                expressions: KEY.reducesinkkey0 (type: int), KEY.reducesinkkey1 (type: int), 3 (type: int), KEY.reducesinkkey3 (type: double), KEY.reducesinkkey4 (type: double), VALUE._col0 (type: int), VALUE._col1 (type: int), KEY.reducesinkkey5 (type: int), KEY.reducesinkkey6 (type: double), KEY.reducesinkkey7 (type: double)
+                expressions: KEY.reducesinkkey0 (type: int), KEY.reducesinkkey1 (type: int), 3 (type: int), KEY.reducesinkkey3 (type: double), KEY.reducesinkkey4 (type: double), VALUE._col0 (type: int), VALUE._col1 (type: int), 4 (type: int), KEY.reducesinkkey6 (type: double), KEY.reducesinkkey7 (type: double)
                 outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9
                 Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                 File Output Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/48b201ee/ql/src/test/results/clientpositive/spark/filter_join_breaktask.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/filter_join_breaktask.q.out b/ql/src/test/results/clientpositive/spark/filter_join_breaktask.q.out
index 17a01c6..fa5a5c6 100644
--- a/ql/src/test/results/clientpositive/spark/filter_join_breaktask.q.out
+++ b/ql/src/test/results/clientpositive/spark/filter_join_breaktask.q.out
@@ -225,7 +225,7 @@ STAGE PLANS:
                   GatherStats: false
                   Filter Operator
                     isSamplingPred: false
-                    predicate: ((value is not null and (value <> '')) and key is not null) (type: boolean)
+                    predicate: ((key is not null and value is not null) and (value <> '')) (type: boolean)
                     Statistics: Num rows: 25 Data size: 211 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/48b201ee/ql/src/test/results/clientpositive/spark/groupby_position.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/groupby_position.q.out b/ql/src/test/results/clientpositive/spark/groupby_position.q.out
index 415703f..3f58948 100644
--- a/ql/src/test/results/clientpositive/spark/groupby_position.q.out
+++ b/ql/src/test/results/clientpositive/spark/groupby_position.q.out
@@ -586,7 +586,7 @@ STAGE PLANS:
                   alias: src1
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((((UDFToDouble(key) > 15.0) and (UDFToDouble(key) < 25.0)) and (UDFToDouble(key) < 20.0)) and (UDFToDouble(key) > 10.0)) (type: boolean)
+                    predicate: ((((UDFToDouble(key) > 15.0) and (UDFToDouble(key) < 25.0)) and (UDFToDouble(key) > 10.0)) and (UDFToDouble(key) < 20.0)) (type: boolean)
                     Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
                     Group By Operator
                       keys: key (type: string), value (type: string)