You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by ta...@apache.org on 2016/05/12 22:09:46 UTC

[11/50] [abbrv] incubator-impala git commit: IMPALA-2805: Order conjuncts based on selectivity and cost

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/8c2bf976/testdata/workloads/functional-planner/queries/PlannerTest/outer-joins.test
----------------------------------------------------------------------
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/outer-joins.test b/testdata/workloads/functional-planner/queries/PlannerTest/outer-joins.test
index 95c98cb..3d1d911 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/outer-joins.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/outer-joins.test
@@ -34,7 +34,7 @@ and t1.zip + t2.zip + t3.zip= 20
 |
 |--02:SCAN HDFS [functional.testtbl t3]
 |     partitions=1/1 files=0 size=0B
-|     predicates: t3.zip = 94720, t3.id > 0, t3.id IS NOT NULL
+|     predicates: t3.id IS NOT NULL, t3.zip = 94720, t3.id > 0
 |
 03:HASH JOIN [LEFT OUTER JOIN]
 |  hash predicates: t1.id - 1 = t2.id + 1
@@ -60,7 +60,7 @@ and t1.zip + t2.zip + t3.zip= 20
 |  |
 |  02:SCAN HDFS [functional.testtbl t3]
 |     partitions=1/1 files=0 size=0B
-|     predicates: t3.zip = 94720, t3.id > 0, t3.id IS NOT NULL
+|     predicates: t3.id IS NOT NULL, t3.zip = 94720, t3.id > 0
 |
 03:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
 |  hash predicates: t1.id - 1 = t2.id + 1
@@ -94,7 +94,7 @@ and t1.zip + t2.zip = 10 and t1.zip + t2.zip + t3.zip= 20
 |
 |--02:SCAN HDFS [functional.testtbl a3]
 |     partitions=1/1 files=0 size=0B
-|     predicates: a3.id > 0, a3.id IS NOT NULL, a3.zip = 94720
+|     predicates: a3.id IS NOT NULL, a3.id > 0, a3.zip = 94720
 |
 03:HASH JOIN [LEFT OUTER JOIN]
 |  hash predicates: a1.id - 1 = a2.id + 1
@@ -120,7 +120,7 @@ and t1.zip + t2.zip = 10 and t1.zip + t2.zip + t3.zip= 20
 |  |
 |  02:SCAN HDFS [functional.testtbl a3]
 |     partitions=1/1 files=0 size=0B
-|     predicates: a3.id > 0, a3.id IS NOT NULL, a3.zip = 94720
+|     predicates: a3.id IS NOT NULL, a3.id > 0, a3.zip = 94720
 |
 03:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
 |  hash predicates: a1.id - 1 = a2.id + 1
@@ -196,8 +196,8 @@ and t1.zip + t2.zip + t3.zip= 20
 ---- PLAN
 04:HASH JOIN [RIGHT OUTER JOIN]
 |  hash predicates: t1.id = t3.id
-|  other join predicates: t1.id - t2.id = 0, t3.zip = 94720
-|  other predicates: t1.id > 0, t2.id IS NULL, t1.zip + t2.zip = 10, t1.zip + t2.zip + t3.zip = 20
+|  other join predicates: t3.zip = 94720, t1.id - t2.id = 0
+|  other predicates: t2.id IS NULL, t1.id > 0, t1.zip + t2.zip = 10, t1.zip + t2.zip + t3.zip = 20
 |  runtime filters: RF000 <- t3.id
 |
 |--02:SCAN HDFS [functional.testtbl t3]
@@ -215,15 +215,15 @@ and t1.zip + t2.zip + t3.zip= 20
 |
 00:SCAN HDFS [functional.testtbl t1]
    partitions=1/1 files=0 size=0B
-   predicates: t1.id > 0, t1.id IS NOT NULL
+   predicates: t1.id IS NOT NULL, t1.id > 0
    runtime filters: RF000 -> t1.id, RF001 -> t1.id - 1
 ---- DISTRIBUTEDPLAN
 09:EXCHANGE [UNPARTITIONED]
 |
 04:HASH JOIN [RIGHT OUTER JOIN, PARTITIONED]
 |  hash predicates: t1.id = t3.id
-|  other join predicates: t1.id - t2.id = 0, t3.zip = 94720
-|  other predicates: t1.id > 0, t2.id IS NULL, t1.zip + t2.zip = 10, t1.zip + t2.zip + t3.zip = 20
+|  other join predicates: t3.zip = 94720, t1.id - t2.id = 0
+|  other predicates: t2.id IS NULL, t1.id > 0, t1.zip + t2.zip = 10, t1.zip + t2.zip + t3.zip = 20
 |  runtime filters: RF000 <- t3.id
 |
 |--08:EXCHANGE [HASH(t3.id)]
@@ -249,7 +249,7 @@ and t1.zip + t2.zip + t3.zip= 20
 |
 00:SCAN HDFS [functional.testtbl t1]
    partitions=1/1 files=0 size=0B
-   predicates: t1.id > 0, t1.id IS NOT NULL
+   predicates: t1.id IS NOT NULL, t1.id > 0
    runtime filters: RF000 -> t1.id, RF001 -> t1.id - 1
 ====
 # the same thing with subqueries; should produce the same result
@@ -263,7 +263,7 @@ and t1.zip + t2.zip = 10 and t1.zip + t2.zip + t3.zip= 20
 ---- PLAN
 04:HASH JOIN [RIGHT OUTER JOIN]
 |  hash predicates: a1.id = a3.id
-|  other join predicates: a1.id - a2.id = 0, a3.zip = 94720
+|  other join predicates: a3.zip = 94720, a1.id - a2.id = 0
 |  other predicates: a2.id IS NULL, a1.id > 0, a1.zip + a2.zip = 10, a1.zip + a2.zip + a3.zip = 20
 |  runtime filters: RF000 <- a3.id
 |
@@ -282,14 +282,14 @@ and t1.zip + t2.zip = 10 and t1.zip + t2.zip + t3.zip= 20
 |
 00:SCAN HDFS [functional.testtbl a1]
    partitions=1/1 files=0 size=0B
-   predicates: a1.id > 0, a1.id IS NOT NULL
+   predicates: a1.id IS NOT NULL, a1.id > 0
    runtime filters: RF000 -> a1.id, RF001 -> a1.id - 1
 ---- DISTRIBUTEDPLAN
 09:EXCHANGE [UNPARTITIONED]
 |
 04:HASH JOIN [RIGHT OUTER JOIN, PARTITIONED]
 |  hash predicates: a1.id = a3.id
-|  other join predicates: a1.id - a2.id = 0, a3.zip = 94720
+|  other join predicates: a3.zip = 94720, a1.id - a2.id = 0
 |  other predicates: a2.id IS NULL, a1.id > 0, a1.zip + a2.zip = 10, a1.zip + a2.zip + a3.zip = 20
 |  runtime filters: RF000 <- a3.id
 |
@@ -316,7 +316,7 @@ and t1.zip + t2.zip = 10 and t1.zip + t2.zip + t3.zip= 20
 |
 00:SCAN HDFS [functional.testtbl a1]
    partitions=1/1 files=0 size=0B
-   predicates: a1.id > 0, a1.id IS NOT NULL
+   predicates: a1.id IS NOT NULL, a1.id > 0
    runtime filters: RF000 -> a1.id, RF001 -> a1.id - 1
 ====
 # right outer join requires the join op to be partitioned, otherwise non-matches cause
@@ -489,7 +489,7 @@ where a.bool_col = false and a.float_col < b.float_col
 07:HASH JOIN [FULL OUTER JOIN]
 |  hash predicates: a.tinyint_col = d.tinyint_col
 |  other join predicates: b.int_col < 20
-|  other predicates: a.bool_col = FALSE, a.float_col < b.float_col
+|  other predicates: a.float_col < b.float_col, a.bool_col = FALSE
 |
 |--03:SCAN HDFS [functional.alltypes d]
 |     partitions=24/24 files=24 size=478.45KB
@@ -608,7 +608,7 @@ where a.float_col = b.float_col and b.smallint_col = 1 and d.tinyint_col < 10
 06:HASH JOIN [FULL OUTER JOIN]
 |  hash predicates: b.string_col = d.string_col
 |  other join predicates: a.tinyint_col < b.tinyint_col
-|  other predicates: a.float_col = b.float_col, b.smallint_col = 1, d.tinyint_col < 10
+|  other predicates: b.smallint_col = 1, a.float_col = b.float_col, d.tinyint_col < 10
 |
 |--03:SCAN HDFS [functional.alltypes d]
 |     partitions=24/24 files=24 size=478.45KB

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/8c2bf976/testdata/workloads/functional-planner/queries/PlannerTest/predicate-propagation.test
----------------------------------------------------------------------
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/predicate-propagation.test b/testdata/workloads/functional-planner/queries/PlannerTest/predicate-propagation.test
index 11dbc8f..a596868 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/predicate-propagation.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/predicate-propagation.test
@@ -50,7 +50,7 @@ where month = id and id = int_col and tinyint_col = int_col and int_col < 2
 |
 00:SCAN HDFS [functional.alltypes]
    partitions=2/24 files=2 size=40.32KB
-   predicates: month = id, id = int_col, tinyint_col = int_col, functional.alltypes.id < 2, int_col < 2, functional.alltypes.tinyint_col < 2
+   predicates: month = id, id = int_col, functional.alltypes.id < 2, int_col < 2, functional.alltypes.tinyint_col < 2, tinyint_col = int_col
 ====
 # all subquery results get materialized correctly;
 # a.string_col = 'a' needs to be evaluated by the join itself, not the scan
@@ -190,16 +190,16 @@ where a.year = 2009 and b.month + 2 <= 4 and b.id = 17
   and cast(sin(c.int_col) as boolean) = true
 ---- PLAN
 04:HASH JOIN [INNER JOIN]
-|  hash predicates: b.smallint_col = c.int_col, b.id = c.id, b.year = c.year, b.month = c.month
-|  runtime filters: RF000 <- c.int_col, RF001 <- c.id, RF002 <- c.year, RF003 <- c.month
+|  hash predicates: b.id = c.id, b.year = c.year, b.month = c.month, b.smallint_col = c.int_col
+|  runtime filters: RF000 <- c.id, RF001 <- c.year, RF002 <- c.month, RF003 <- c.int_col
 |
 |--02:SCAN HDFS [functional.alltypestiny c]
 |     partitions=2/4 files=2 size=230B
 |     predicates: c.id = 17, CAST(sin(c.int_col) AS BOOLEAN) = TRUE
 |
 03:HASH JOIN [INNER JOIN]
-|  hash predicates: a.tinyint_col = b.smallint_col, a.id = b.id, a.year = b.year, a.month = b.month
-|  runtime filters: RF004 <- b.smallint_col, RF005 <- b.id, RF006 <- b.year, RF007 <- b.month
+|  hash predicates: a.id = b.id, a.year = b.year, a.month = b.month, a.tinyint_col = b.smallint_col
+|  runtime filters: RF004 <- b.id, RF005 <- b.year, RF006 <- b.month, RF007 <- b.smallint_col
 |
 |--01:SCAN HDFS [functional.alltypessmall b]
 |     partitions=2/4 files=2 size=3.16KB
@@ -208,7 +208,7 @@ where a.year = 2009 and b.month + 2 <= 4 and b.id = 17
 00:SCAN HDFS [functional.alltypes a]
    partitions=2/24 files=2 size=38.07KB
    predicates: a.id = 17, CAST(sin(a.tinyint_col) AS BOOLEAN) = TRUE
-   runtime filters: RF000 -> a.tinyint_col, RF001 -> a.id, RF002 -> a.year, RF003 -> a.month, RF004 -> a.tinyint_col, RF005 -> a.id, RF006 -> a.year, RF007 -> a.month
+   runtime filters: RF000 -> a.id, RF001 -> a.year, RF002 -> a.month, RF003 -> a.tinyint_col, RF004 -> a.id, RF005 -> a.year, RF006 -> a.month, RF007 -> a.tinyint_col
 ---- SCANRANGELOCATIONS
 NODE 0:
   HDFS SPLIT hdfs://localhost:20500/test-warehouse/alltypes/year=2009/month=1/090101.txt 0:20433
@@ -223,31 +223,31 @@ NODE 2:
 08:EXCHANGE [UNPARTITIONED]
 |
 04:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: b.smallint_col = c.int_col, b.id = c.id, b.year = c.year, b.month = c.month
-|  runtime filters: RF000 <- c.int_col, RF001 <- c.id, RF002 <- c.year, RF003 <- c.month
+|  hash predicates: b.id = c.id, b.year = c.year, b.month = c.month, b.smallint_col = c.int_col
+|  runtime filters: RF000 <- c.id, RF001 <- c.year, RF002 <- c.month, RF003 <- c.int_col
 |
-|--07:EXCHANGE [HASH(c.int_col,c.id,c.year,c.month)]
+|--07:EXCHANGE [HASH(c.id,c.year,c.month,c.int_col)]
 |  |
 |  02:SCAN HDFS [functional.alltypestiny c]
 |     partitions=2/4 files=2 size=230B
 |     predicates: c.id = 17, CAST(sin(c.int_col) AS BOOLEAN) = TRUE
 |
 03:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: a.tinyint_col = b.smallint_col, a.id = b.id, a.year = b.year, a.month = b.month
-|  runtime filters: RF004 <- b.smallint_col, RF005 <- b.id, RF006 <- b.year, RF007 <- b.month
+|  hash predicates: a.id = b.id, a.year = b.year, a.month = b.month, a.tinyint_col = b.smallint_col
+|  runtime filters: RF004 <- b.id, RF005 <- b.year, RF006 <- b.month, RF007 <- b.smallint_col
 |
-|--06:EXCHANGE [HASH(b.smallint_col,b.id,b.year,b.month)]
+|--06:EXCHANGE [HASH(b.id,b.year,b.month,b.smallint_col)]
 |  |
 |  01:SCAN HDFS [functional.alltypessmall b]
 |     partitions=2/4 files=2 size=3.16KB
 |     predicates: b.id = 17, CAST(sin(b.smallint_col) AS BOOLEAN) = TRUE
 |
-05:EXCHANGE [HASH(a.tinyint_col,a.id,a.year,a.month)]
+05:EXCHANGE [HASH(a.id,a.year,a.month,a.tinyint_col)]
 |
 00:SCAN HDFS [functional.alltypes a]
    partitions=2/24 files=2 size=38.07KB
    predicates: a.id = 17, CAST(sin(a.tinyint_col) AS BOOLEAN) = TRUE
-   runtime filters: RF000 -> a.tinyint_col, RF001 -> a.id, RF002 -> a.year, RF003 -> a.month, RF004 -> a.tinyint_col, RF005 -> a.id, RF006 -> a.year, RF007 -> a.month
+   runtime filters: RF000 -> a.id, RF001 -> a.year, RF002 -> a.month, RF003 -> a.tinyint_col, RF004 -> a.id, RF005 -> a.year, RF006 -> a.month, RF007 -> a.tinyint_col
 ====
 # basic propagation between equivalence classes, with partition pruning;
 # variation with inline views
@@ -261,16 +261,16 @@ where a.year = 2009 and b.month + 2 <= 4 and b.id = 17
   and cast(sin(c.int_col) as boolean) = true
 ---- PLAN
 04:HASH JOIN [INNER JOIN]
-|  hash predicates: functional.alltypessmall.smallint_col = functional.alltypestiny.int_col, functional.alltypessmall.id = functional.alltypestiny.id, functional.alltypessmall.year = functional.alltypestiny.year, functional.alltypessmall.month = functional.alltypestiny.month
-|  runtime filters: RF000 <- functional.alltypestiny.int_col, RF001 <- functional.alltypestiny.id, RF002 <- functional.alltypestiny.year, RF003 <- functional.alltypestiny.month
+|  hash predicates: functional.alltypessmall.id = functional.alltypestiny.id, functional.alltypessmall.year = functional.alltypestiny.year, functional.alltypessmall.month = functional.alltypestiny.month, functional.alltypessmall.smallint_col = functional.alltypestiny.int_col
+|  runtime filters: RF000 <- functional.alltypestiny.id, RF001 <- functional.alltypestiny.year, RF002 <- functional.alltypestiny.month, RF003 <- functional.alltypestiny.int_col
 |
 |--02:SCAN HDFS [functional.alltypestiny]
 |     partitions=2/4 files=2 size=230B
 |     predicates: functional.alltypestiny.id = 17, CAST(sin(functional.alltypestiny.int_col) AS BOOLEAN) = TRUE
 |
 03:HASH JOIN [INNER JOIN]
-|  hash predicates: functional.alltypes.tinyint_col = functional.alltypessmall.smallint_col, functional.alltypes.id = functional.alltypessmall.id, functional.alltypes.year = functional.alltypessmall.year, functional.alltypes.month = functional.alltypessmall.month
-|  runtime filters: RF004 <- functional.alltypessmall.smallint_col, RF005 <- functional.alltypessmall.id, RF006 <- functional.alltypessmall.year, RF007 <- functional.alltypessmall.month
+|  hash predicates: functional.alltypes.id = functional.alltypessmall.id, functional.alltypes.year = functional.alltypessmall.year, functional.alltypes.month = functional.alltypessmall.month, functional.alltypes.tinyint_col = functional.alltypessmall.smallint_col
+|  runtime filters: RF004 <- functional.alltypessmall.id, RF005 <- functional.alltypessmall.year, RF006 <- functional.alltypessmall.month, RF007 <- functional.alltypessmall.smallint_col
 |
 |--01:SCAN HDFS [functional.alltypessmall]
 |     partitions=2/4 files=2 size=3.16KB
@@ -279,7 +279,7 @@ where a.year = 2009 and b.month + 2 <= 4 and b.id = 17
 00:SCAN HDFS [functional.alltypes]
    partitions=2/24 files=2 size=38.07KB
    predicates: functional.alltypes.id = 17, CAST(sin(functional.alltypes.tinyint_col) AS BOOLEAN) = TRUE
-   runtime filters: RF000 -> functional.alltypes.tinyint_col, RF001 -> functional.alltypes.id, RF002 -> functional.alltypes.year, RF003 -> functional.alltypes.month, RF004 -> functional.alltypes.tinyint_col, RF005 -> functional.alltypes.id, RF006 -> functional.alltypes.year, RF007 -> functional.alltypes.month
+   runtime filters: RF000 -> functional.alltypes.id, RF001 -> functional.alltypes.year, RF002 -> functional.alltypes.month, RF003 -> functional.alltypes.tinyint_col, RF004 -> functional.alltypes.id, RF005 -> functional.alltypes.year, RF006 -> functional.alltypes.month, RF007 -> functional.alltypes.tinyint_col
 ---- SCANRANGELOCATIONS
 NODE 0:
   HDFS SPLIT hdfs://localhost:20500/test-warehouse/alltypes/year=2009/month=1/090101.txt 0:20433
@@ -294,31 +294,31 @@ NODE 2:
 08:EXCHANGE [UNPARTITIONED]
 |
 04:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: functional.alltypessmall.smallint_col = functional.alltypestiny.int_col, functional.alltypessmall.id = functional.alltypestiny.id, functional.alltypessmall.year = functional.alltypestiny.year, functional.alltypessmall.month = functional.alltypestiny.month
-|  runtime filters: RF000 <- functional.alltypestiny.int_col, RF001 <- functional.alltypestiny.id, RF002 <- functional.alltypestiny.year, RF003 <- functional.alltypestiny.month
+|  hash predicates: functional.alltypessmall.id = functional.alltypestiny.id, functional.alltypessmall.year = functional.alltypestiny.year, functional.alltypessmall.month = functional.alltypestiny.month, functional.alltypessmall.smallint_col = functional.alltypestiny.int_col
+|  runtime filters: RF000 <- functional.alltypestiny.id, RF001 <- functional.alltypestiny.year, RF002 <- functional.alltypestiny.month, RF003 <- functional.alltypestiny.int_col
 |
-|--07:EXCHANGE [HASH(functional.alltypestiny.int_col,functional.alltypestiny.id,functional.alltypestiny.year,functional.alltypestiny.month)]
+|--07:EXCHANGE [HASH(functional.alltypestiny.id,functional.alltypestiny.year,functional.alltypestiny.month,functional.alltypestiny.int_col)]
 |  |
 |  02:SCAN HDFS [functional.alltypestiny]
 |     partitions=2/4 files=2 size=230B
 |     predicates: functional.alltypestiny.id = 17, CAST(sin(functional.alltypestiny.int_col) AS BOOLEAN) = TRUE
 |
 03:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: functional.alltypes.tinyint_col = functional.alltypessmall.smallint_col, functional.alltypes.id = functional.alltypessmall.id, functional.alltypes.year = functional.alltypessmall.year, functional.alltypes.month = functional.alltypessmall.month
-|  runtime filters: RF004 <- functional.alltypessmall.smallint_col, RF005 <- functional.alltypessmall.id, RF006 <- functional.alltypessmall.year, RF007 <- functional.alltypessmall.month
+|  hash predicates: functional.alltypes.id = functional.alltypessmall.id, functional.alltypes.year = functional.alltypessmall.year, functional.alltypes.month = functional.alltypessmall.month, functional.alltypes.tinyint_col = functional.alltypessmall.smallint_col
+|  runtime filters: RF004 <- functional.alltypessmall.id, RF005 <- functional.alltypessmall.year, RF006 <- functional.alltypessmall.month, RF007 <- functional.alltypessmall.smallint_col
 |
-|--06:EXCHANGE [HASH(functional.alltypessmall.smallint_col,functional.alltypessmall.id,functional.alltypessmall.year,functional.alltypessmall.month)]
+|--06:EXCHANGE [HASH(functional.alltypessmall.id,functional.alltypessmall.year,functional.alltypessmall.month,functional.alltypessmall.smallint_col)]
 |  |
 |  01:SCAN HDFS [functional.alltypessmall]
 |     partitions=2/4 files=2 size=3.16KB
 |     predicates: functional.alltypessmall.id = 17, CAST(sin(functional.alltypessmall.smallint_col) AS BOOLEAN) = TRUE
 |
-05:EXCHANGE [HASH(functional.alltypes.tinyint_col,functional.alltypes.id,functional.alltypes.year,functional.alltypes.month)]
+05:EXCHANGE [HASH(functional.alltypes.id,functional.alltypes.year,functional.alltypes.month,functional.alltypes.tinyint_col)]
 |
 00:SCAN HDFS [functional.alltypes]
    partitions=2/24 files=2 size=38.07KB
    predicates: functional.alltypes.id = 17, CAST(sin(functional.alltypes.tinyint_col) AS BOOLEAN) = TRUE
-   runtime filters: RF000 -> functional.alltypes.tinyint_col, RF001 -> functional.alltypes.id, RF002 -> functional.alltypes.year, RF003 -> functional.alltypes.month, RF004 -> functional.alltypes.tinyint_col, RF005 -> functional.alltypes.id, RF006 -> functional.alltypes.year, RF007 -> functional.alltypes.month
+   runtime filters: RF000 -> functional.alltypes.id, RF001 -> functional.alltypes.year, RF002 -> functional.alltypes.month, RF003 -> functional.alltypes.tinyint_col, RF004 -> functional.alltypes.id, RF005 -> functional.alltypes.year, RF006 -> functional.alltypes.month, RF007 -> functional.alltypes.tinyint_col
 ====
 # propagation between outer-joined tables only goes in one direction:
 # - predicates on a.year and a.tinyint_col are propagated to b
@@ -338,15 +338,15 @@ where a.year = 2009 and a.tinyint_col = 7 and a.id is null and b.id = 17 and b.i
 ---- PLAN
 02:HASH JOIN [LEFT OUTER JOIN]
 |  hash predicates: a.tinyint_col = b.tinyint_col, a.id = b.id, a.year = b.year, a.month = b.month
-|  other predicates: b.id = 17, b.int_col IS NULL
+|  other predicates: b.int_col IS NULL, b.id = 17
 |
 |--01:SCAN HDFS [functional.alltypessmall b]
 |     partitions=1/4 files=1 size=1.57KB
-|     predicates: b.tinyint_col = 7, b.id = 17
+|     predicates: b.id = 17, b.tinyint_col = 7
 |
 00:SCAN HDFS [functional.alltypes a]
    partitions=12/24 files=12 size=238.68KB
-   predicates: a.tinyint_col = 7, a.id IS NULL
+   predicates: a.id IS NULL, a.tinyint_col = 7
 ---- SCANRANGELOCATIONS
 NODE 0:
   HDFS SPLIT hdfs://localhost:20500/test-warehouse/alltypes/year=2009/month=1/090101.txt 0:20433
@@ -368,17 +368,17 @@ NODE 1:
 |
 02:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
 |  hash predicates: a.tinyint_col = b.tinyint_col, a.id = b.id, a.year = b.year, a.month = b.month
-|  other predicates: b.id = 17, b.int_col IS NULL
+|  other predicates: b.int_col IS NULL, b.id = 17
 |
 |--03:EXCHANGE [BROADCAST]
 |  |
 |  01:SCAN HDFS [functional.alltypessmall b]
 |     partitions=1/4 files=1 size=1.57KB
-|     predicates: b.tinyint_col = 7, b.id = 17
+|     predicates: b.id = 17, b.tinyint_col = 7
 |
 00:SCAN HDFS [functional.alltypes a]
    partitions=12/24 files=12 size=238.68KB
-   predicates: a.tinyint_col = 7, a.id IS NULL
+   predicates: a.id IS NULL, a.tinyint_col = 7
 ====
 # propagation between outer-joined tables only goes in one direction:
 # - predicates on b.year, b.tinyint_col are propagated to a
@@ -398,36 +398,36 @@ where b.year = 2009 and b.tinyint_col = 7 and b.id is null and a.id = 17 and a.i
 ---- PLAN
 02:HASH JOIN [RIGHT OUTER JOIN]
 |  hash predicates: a.tinyint_col = b.tinyint_col, a.id = b.id, a.year = b.year, a.month = b.month
-|  other predicates: a.id = 17, a.int_col IS NULL
+|  other predicates: a.int_col IS NULL, a.id = 17
 |  runtime filters: RF000 <- b.tinyint_col, RF001 <- b.id, RF002 <- b.year, RF003 <- b.month
 |
 |--01:SCAN HDFS [functional.alltypes b]
 |     partitions=12/24 files=12 size=238.68KB
-|     predicates: b.tinyint_col = 7, b.id IS NULL
+|     predicates: b.id IS NULL, b.tinyint_col = 7
 |
 00:SCAN HDFS [functional.alltypessmall a]
    partitions=1/4 files=1 size=1.57KB
-   predicates: a.tinyint_col = 7, a.id = 17
+   predicates: a.id = 17, a.tinyint_col = 7
    runtime filters: RF000 -> a.tinyint_col, RF001 -> a.id, RF002 -> a.year, RF003 -> a.month
 ---- DISTRIBUTEDPLAN
 05:EXCHANGE [UNPARTITIONED]
 |
 02:HASH JOIN [RIGHT OUTER JOIN, PARTITIONED]
 |  hash predicates: a.tinyint_col = b.tinyint_col, a.id = b.id, a.year = b.year, a.month = b.month
-|  other predicates: a.id = 17, a.int_col IS NULL
+|  other predicates: a.int_col IS NULL, a.id = 17
 |  runtime filters: RF000 <- b.tinyint_col, RF001 <- b.id, RF002 <- b.year, RF003 <- b.month
 |
 |--04:EXCHANGE [HASH(b.tinyint_col,b.id,b.year,b.month)]
 |  |
 |  01:SCAN HDFS [functional.alltypes b]
 |     partitions=12/24 files=12 size=238.68KB
-|     predicates: b.tinyint_col = 7, b.id IS NULL
+|     predicates: b.id IS NULL, b.tinyint_col = 7
 |
 03:EXCHANGE [HASH(a.tinyint_col,a.id,a.year,a.month)]
 |
 00:SCAN HDFS [functional.alltypessmall a]
    partitions=1/4 files=1 size=1.57KB
-   predicates: a.tinyint_col = 7, a.id = 17
+   predicates: a.id = 17, a.tinyint_col = 7
    runtime filters: RF000 -> a.tinyint_col, RF001 -> a.id, RF002 -> a.year, RF003 -> a.month
 ====
 # propagation into inline view with aggregation:
@@ -445,8 +445,8 @@ from functional.alltypes a
 where a.year = 2009 and b.month <= 2 and b.count_col + 1 = 17 and a.tinyint_col != 5
 ---- PLAN
 03:HASH JOIN [INNER JOIN]
-|  hash predicates: a.id = id, a.tinyint_col = int_col, a.year = year, a.month = month
-|  runtime filters: RF000 <- id, RF001 <- int_col, RF002 <- year, RF003 <- month
+|  hash predicates: a.id = id, a.year = year, a.month = month, a.tinyint_col = int_col
+|  runtime filters: RF000 <- id, RF001 <- year, RF002 <- month, RF003 <- int_col
 |
 |--02:AGGREGATE [FINALIZE]
 |  |  output: count(*)
@@ -460,7 +460,7 @@ where a.year = 2009 and b.month <= 2 and b.count_col + 1 = 17 and a.tinyint_col
 00:SCAN HDFS [functional.alltypes a]
    partitions=2/24 files=2 size=38.07KB
    predicates: a.id > 11, a.tinyint_col != 5
-   runtime filters: RF000 -> a.id, RF001 -> a.tinyint_col, RF002 -> a.year, RF003 -> a.month
+   runtime filters: RF000 -> a.id, RF001 -> a.year, RF002 -> a.month, RF003 -> a.tinyint_col
 ---- SCANRANGELOCATIONS
 NODE 0:
   HDFS SPLIT hdfs://localhost:20500/test-warehouse/alltypes/year=2009/month=1/090101.txt 0:20433
@@ -472,8 +472,8 @@ NODE 1:
 07:EXCHANGE [UNPARTITIONED]
 |
 03:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: a.id = id, a.tinyint_col = int_col, a.year = year, a.month = month
-|  runtime filters: RF000 <- id, RF001 <- int_col, RF002 <- year, RF003 <- month
+|  hash predicates: a.id = id, a.year = year, a.month = month, a.tinyint_col = int_col
+|  runtime filters: RF000 <- id, RF001 <- year, RF002 <- month, RF003 <- int_col
 |
 |--06:EXCHANGE [BROADCAST]
 |  |
@@ -495,7 +495,7 @@ NODE 1:
 00:SCAN HDFS [functional.alltypes a]
    partitions=2/24 files=2 size=38.07KB
    predicates: a.id > 11, a.tinyint_col != 5
-   runtime filters: RF000 -> a.id, RF001 -> a.tinyint_col, RF002 -> a.year, RF003 -> a.month
+   runtime filters: RF000 -> a.id, RF001 -> a.year, RF002 -> a.month, RF003 -> a.tinyint_col
 ====
 # Same as above but with cross join
 select straight_join a.id, b.id
@@ -515,8 +515,8 @@ where a.id = b.id and
       a.tinyint_col != 5
 ---- PLAN
 03:HASH JOIN [INNER JOIN]
-|  hash predicates: a.id = id, a.tinyint_col = int_col, a.year = year, a.month = month
-|  runtime filters: RF000 <- id, RF001 <- int_col, RF002 <- year, RF003 <- month
+|  hash predicates: a.id = id, a.year = year, a.month = month, a.tinyint_col = int_col
+|  runtime filters: RF000 <- id, RF001 <- year, RF002 <- month, RF003 <- int_col
 |
 |--02:AGGREGATE [FINALIZE]
 |  |  output: count(*)
@@ -530,13 +530,13 @@ where a.id = b.id and
 00:SCAN HDFS [functional.alltypes a]
    partitions=2/24 files=2 size=38.07KB
    predicates: a.id > 11, a.tinyint_col != 5
-   runtime filters: RF000 -> a.id, RF001 -> a.tinyint_col, RF002 -> a.year, RF003 -> a.month
+   runtime filters: RF000 -> a.id, RF001 -> a.year, RF002 -> a.month, RF003 -> a.tinyint_col
 ---- DISTRIBUTEDPLAN
 07:EXCHANGE [UNPARTITIONED]
 |
 03:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: a.id = id, a.tinyint_col = int_col, a.year = year, a.month = month
-|  runtime filters: RF000 <- id, RF001 <- int_col, RF002 <- year, RF003 <- month
+|  hash predicates: a.id = id, a.year = year, a.month = month, a.tinyint_col = int_col
+|  runtime filters: RF000 <- id, RF001 <- year, RF002 <- month, RF003 <- int_col
 |
 |--06:EXCHANGE [BROADCAST]
 |  |
@@ -558,7 +558,7 @@ where a.id = b.id and
 00:SCAN HDFS [functional.alltypes a]
    partitions=2/24 files=2 size=38.07KB
    predicates: a.id > 11, a.tinyint_col != 5
-   runtime filters: RF000 -> a.id, RF001 -> a.tinyint_col, RF002 -> a.year, RF003 -> a.month
+   runtime filters: RF000 -> a.id, RF001 -> a.year, RF002 -> a.month, RF003 -> a.tinyint_col
 ====
 # no propagation into select block with limit;
 # propagation out of that block is okay;
@@ -576,8 +576,8 @@ from functional.alltypes a
 where a.year = 2009 and b.month <= 2 and b.count_col + 1 = 17 and a.tinyint_col != 5
 ---- PLAN
 04:HASH JOIN [INNER JOIN]
-|  hash predicates: a.id = id, a.tinyint_col = int_col, a.year = year, a.month = month
-|  runtime filters: RF000 <- id, RF001 <- int_col, RF002 <- year, RF003 <- month
+|  hash predicates: a.id = id, a.year = year, a.month = month, a.tinyint_col = int_col
+|  runtime filters: RF000 <- id, RF001 <- year, RF002 <- month, RF003 <- int_col
 |
 |--03:SELECT
 |  |  predicates: count(*) + 1 = 17
@@ -594,7 +594,7 @@ where a.year = 2009 and b.month <= 2 and b.count_col + 1 = 17 and a.tinyint_col
 00:SCAN HDFS [functional.alltypes a]
    partitions=2/24 files=2 size=38.07KB
    predicates: a.id > 11, a.tinyint_col != 5
-   runtime filters: RF000 -> a.id, RF001 -> a.tinyint_col, RF002 -> a.year, RF003 -> a.month
+   runtime filters: RF000 -> a.id, RF001 -> a.year, RF002 -> a.month, RF003 -> a.tinyint_col
 ---- SCANRANGELOCATIONS
 NODE 0:
   HDFS SPLIT hdfs://localhost:20500/test-warehouse/alltypes/year=2009/month=1/090101.txt 0:20433
@@ -608,8 +608,8 @@ NODE 1:
 09:EXCHANGE [UNPARTITIONED]
 |
 04:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: a.id = id, a.tinyint_col = int_col, a.year = year, a.month = month
-|  runtime filters: RF000 <- id, RF001 <- int_col, RF002 <- year, RF003 <- month
+|  hash predicates: a.id = id, a.year = year, a.month = month, a.tinyint_col = int_col
+|  runtime filters: RF000 <- id, RF001 <- year, RF002 <- month, RF003 <- int_col
 |
 |--08:EXCHANGE [BROADCAST]
 |  |
@@ -637,7 +637,7 @@ NODE 1:
 00:SCAN HDFS [functional.alltypes a]
    partitions=2/24 files=2 size=38.07KB
    predicates: a.id > 11, a.tinyint_col != 5
-   runtime filters: RF000 -> a.id, RF001 -> a.tinyint_col, RF002 -> a.year, RF003 -> a.month
+   runtime filters: RF000 -> a.id, RF001 -> a.year, RF002 -> a.month, RF003 -> a.tinyint_col
 ====
 # Similar to the above, converts the cross join to a hash join
 select straight_join a.id, b.id
@@ -658,8 +658,8 @@ where a.year = 2009 and
       a.month = b.month
 ---- PLAN
 04:HASH JOIN [INNER JOIN]
-|  hash predicates: a.id = id, a.tinyint_col = int_col, a.year = year, a.month = month
-|  runtime filters: RF000 <- id, RF001 <- int_col, RF002 <- year, RF003 <- month
+|  hash predicates: a.id = id, a.year = year, a.month = month, a.tinyint_col = int_col
+|  runtime filters: RF000 <- id, RF001 <- year, RF002 <- month, RF003 <- int_col
 |
 |--03:SELECT
 |  |  predicates: count(*) + 1 = 17
@@ -676,13 +676,13 @@ where a.year = 2009 and
 00:SCAN HDFS [functional.alltypes a]
    partitions=2/24 files=2 size=38.07KB
    predicates: a.id > 11, a.tinyint_col != 5
-   runtime filters: RF000 -> a.id, RF001 -> a.tinyint_col, RF002 -> a.year, RF003 -> a.month
+   runtime filters: RF000 -> a.id, RF001 -> a.year, RF002 -> a.month, RF003 -> a.tinyint_col
 ---- DISTRIBUTEDPLAN
 09:EXCHANGE [UNPARTITIONED]
 |
 04:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: a.id = id, a.tinyint_col = int_col, a.year = year, a.month = month
-|  runtime filters: RF000 <- id, RF001 <- int_col, RF002 <- year, RF003 <- month
+|  hash predicates: a.id = id, a.year = year, a.month = month, a.tinyint_col = int_col
+|  runtime filters: RF000 <- id, RF001 <- year, RF002 <- month, RF003 <- int_col
 |
 |--08:EXCHANGE [BROADCAST]
 |  |
@@ -710,7 +710,7 @@ where a.year = 2009 and
 00:SCAN HDFS [functional.alltypes a]
    partitions=2/24 files=2 size=38.07KB
    predicates: a.id > 11, a.tinyint_col != 5
-   runtime filters: RF000 -> a.id, RF001 -> a.tinyint_col, RF002 -> a.year, RF003 -> a.month
+   runtime filters: RF000 -> a.id, RF001 -> a.year, RF002 -> a.month, RF003 -> a.tinyint_col
 ====
 # propagation of z.month=1 to alltypesagg is prevented
 select straight_join x.int_col, z.int_col
@@ -783,7 +783,7 @@ where a.id is null and isnull(b.id, 0) = 0 and b.int_col = 17
 ---- PLAN
 03:HASH JOIN [LEFT OUTER JOIN]
 |  hash predicates: a.id = id
-|  other predicates: isnull(id, 0) = 0, int_col = 17
+|  other predicates: int_col = 17, isnull(id, 0) = 0
 |
 |--02:AGGREGATE [FINALIZE]
 |  |  group by: id, int_col
@@ -835,7 +835,7 @@ where a.id is null and isnull(b.id, 0) = 0 and b.int_col = 17
 ---- PLAN
 03:HASH JOIN [RIGHT OUTER JOIN]
 |  hash predicates: id = a.id
-|  other predicates: isnull(id, 0) = 0, int_col = 17
+|  other predicates: int_col = 17, isnull(id, 0) = 0
 |  runtime filters: RF000 <- a.id
 |
 |--02:SCAN HDFS [functional.alltypes a]
@@ -944,7 +944,7 @@ having bool_col = false and int_col > 0 and count(bigint_col) > 0
 |
 00:SCAN HDFS [functional.alltypes]
    partitions=24/24 files=24 size=478.45KB
-   predicates: functional.alltypes.bool_col = FALSE, functional.alltypes.int_col > 0
+   predicates: functional.alltypes.int_col > 0, functional.alltypes.bool_col = FALSE
 ====
 # basic propagation of multi-slot, single-tuple predicates
 select straight_join 1 from
@@ -964,9 +964,9 @@ and t2.id + t2.smallint_col + t2.bigint_col > 30
 and t2.id + t3.int_col > 40
 ---- PLAN
 04:HASH JOIN [INNER JOIN]
-|  hash predicates: t2.id = functional.alltypestiny.id, t2.smallint_col = functional.alltypestiny.int_col, t2.bigint_col = functional.alltypestiny.bigint_col
+|  hash predicates: t2.id = functional.alltypestiny.id, t2.bigint_col = functional.alltypestiny.bigint_col, t2.smallint_col = functional.alltypestiny.int_col
 |  other predicates: t2.id + functional.alltypestiny.int_col > 40
-|  runtime filters: RF000 <- functional.alltypestiny.id, RF001 <- functional.alltypestiny.int_col, RF002 <- functional.alltypestiny.bigint_col
+|  runtime filters: RF000 <- functional.alltypestiny.id, RF002 <- functional.alltypestiny.int_col, RF001 <- functional.alltypestiny.bigint_col
 |
 |--02:SCAN HDFS [functional.alltypestiny]
 |     partitions=4/4 files=4 size=460B
@@ -979,12 +979,12 @@ and t2.id + t3.int_col > 40
 |--01:SCAN HDFS [functional.alltypessmall t2]
 |     partitions=4/4 files=4 size=6.32KB
 |     predicates: t2.id + t2.smallint_col > 10, t2.id + t2.bigint_col > 20, t2.id + t2.smallint_col + t2.bigint_col > 30
-|     runtime filters: RF002 -> t2.bigint_col
+|     runtime filters: RF001 -> t2.bigint_col
 |
 00:SCAN HDFS [functional.alltypes t1]
    partitions=24/24 files=24 size=478.45KB
    predicates: t1.id + t1.tinyint_col > 10
-   runtime filters: RF000 -> t1.id, RF001 -> t1.tinyint_col, RF003 -> t1.id, RF004 -> t1.tinyint_col
+   runtime filters: RF000 -> t1.id, RF002 -> t1.tinyint_col, RF003 -> t1.id, RF004 -> t1.tinyint_col
 ====
 # basic propagation of multi-slot, single-tuple predicates with aggregates
 select straight_join 1 from
@@ -1057,7 +1057,7 @@ and t1.id * t1.int_col < 100
 |
 |--02:SCAN HDFS [functional.alltypestiny]
 |     partitions=4/4 files=4 size=460B
-|     predicates: functional.alltypestiny.tinyint_col + functional.alltypestiny.smallint_col + functional.alltypestiny.int_col > 10, functional.alltypestiny.id * functional.alltypestiny.int_col < 100
+|     predicates: functional.alltypestiny.id * functional.alltypestiny.int_col < 100, functional.alltypestiny.tinyint_col + functional.alltypestiny.smallint_col + functional.alltypestiny.int_col > 10
 |
 03:HASH JOIN [LEFT OUTER JOIN]
 |  hash predicates: t1.id = t2.id, t1.int_col = t2.int_col
@@ -1088,7 +1088,7 @@ where t2.year + t2.month > 10
 |
 00:SCAN HDFS [functional.alltypes t1]
    partitions=24/24 files=24 size=478.45KB
-   predicates: t1.year + t1.id > 10, t1.id = t1.month
+   predicates: t1.id = t1.month, t1.year + t1.id > 10
    runtime filters: RF000 -> t1.id, RF001 -> t1.year
 ====
 # TODO: Fix this limitation of our getBindingPredicates() implementation:
@@ -1108,7 +1108,7 @@ where t1.id + t1.tinyint_col > 10
 |
 |--01:SCAN HDFS [functional.alltypessmall t2]
 |     partitions=4/4 files=4 size=6.32KB
-|     predicates: t2.id + t2.tinyint_col > 10, t2.id = t2.smallint_col, t2.tinyint_col = t2.int_col
+|     predicates: t2.id = t2.smallint_col, t2.tinyint_col = t2.int_col, t2.id + t2.tinyint_col > 10
 |
 00:SCAN HDFS [functional.alltypes t1]
    partitions=24/24 files=24 size=478.45KB
@@ -1128,8 +1128,8 @@ on (t1.id = t2.bigint_col and t1.int_col = t2.x)
 where t1.id + t1.int_col > 10
 ---- PLAN
 03:HASH JOIN [INNER JOIN]
-|  hash predicates: t1.id = bigint_col, t1.int_col = min(int_col)
-|  runtime filters: RF000 <- bigint_col, RF001 <- min(int_col)
+|  hash predicates: t1.int_col = min(int_col), t1.id = bigint_col
+|  runtime filters: RF000 <- min(int_col), RF001 <- bigint_col
 |
 |--02:AGGREGATE [FINALIZE]
 |  |  output: min(int_col), max(int_col)
@@ -1141,7 +1141,7 @@ where t1.id + t1.int_col > 10
 00:SCAN HDFS [functional.alltypes t1]
    partitions=24/24 files=24 size=478.45KB
    predicates: t1.id + t1.int_col > 10
-   runtime filters: RF000 -> t1.id, RF001 -> t1.int_col
+   runtime filters: RF000 -> t1.int_col, RF001 -> t1.id
 ====
 # Anti-joins have a uni-directional value transfer (IMPALA-1249).
 select * from
@@ -1254,7 +1254,7 @@ SELECT count(*) FROM
 |
 |--01:SCAN HDFS [tpch_parquet.nation n]
 |     partitions=1/1 files=1 size=2.17KB
-|     predicates: n_name = 'BRAZIL', n_regionkey = 1
+|     predicates: n_regionkey = 1, n_name = 'BRAZIL'
 |
 00:SCAN HDFS [tpch_parquet.customer c]
    partitions=1/1 files=1 size=12.47MB

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/8c2bf976/testdata/workloads/functional-planner/queries/PlannerTest/runtime-filter-propagation.test
----------------------------------------------------------------------
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/runtime-filter-propagation.test b/testdata/workloads/functional-planner/queries/PlannerTest/runtime-filter-propagation.test
index c04d216..8453658 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/runtime-filter-propagation.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/runtime-filter-propagation.test
@@ -143,7 +143,7 @@ and t1.int_col = 1 and 1 = t2.bigint_col
 ---- PLAN
 02:HASH JOIN [INNER JOIN]
 |  hash predicates: t1.id = t2.id
-|  other predicates: t1.year + t2.int_col = t1.month + t2.tinyint_col, t1.year = t1.month + t2.int_col, t1.year + t2.smallint_col = t2.tinyint_col
+|  other predicates: t1.year = t1.month + t2.int_col, t1.year + t2.smallint_col = t2.tinyint_col, t1.year + t2.int_col = t1.month + t2.tinyint_col
 |  runtime filters: RF000 <- t2.id
 |
 |--01:SCAN HDFS [functional.alltypesnopart t2]
@@ -162,8 +162,8 @@ where t1.year + t1.month = t2.id and t1.int_col + 1 - t1.tinyint_col = t2.smalli
 and t1.int_col * 100 = t2.bigint_col / 100 and t2.bool_col = false
 ---- PLAN
 02:HASH JOIN [INNER JOIN]
-|  hash predicates: t1.year + t1.month = t2.id, t1.int_col + 1 - t1.tinyint_col = t2.smallint_col + 10, t1.int_col * 100 = t2.bigint_col / 100
-|  runtime filters: RF000 <- t2.id, RF001 <- t2.smallint_col + 10, RF002 <- t2.bigint_col / 100
+|  hash predicates: t1.year + t1.month = t2.id, t1.int_col * 100 = t2.bigint_col / 100, t1.int_col + 1 - t1.tinyint_col = t2.smallint_col + 10
+|  runtime filters: RF000 <- t2.id, RF001 <- t2.bigint_col / 100, RF002 <- t2.smallint_col + 10
 |
 |--01:SCAN HDFS [functional.alltypesnopart t2]
 |     partitions=1/1 files=0 size=0B
@@ -171,7 +171,7 @@ and t1.int_col * 100 = t2.bigint_col / 100 and t2.bool_col = false
 |
 00:SCAN HDFS [functional.alltypesagg t1]
    partitions=11/11 files=11 size=814.73KB
-   runtime filters: RF000 -> t1.year + t1.month, RF001 -> t1.int_col + 1 - t1.tinyint_col, RF002 -> t1.int_col * 100
+   runtime filters: RF000 -> t1.year + t1.month, RF001 -> t1.int_col * 100, RF002 -> t1.int_col + 1 - t1.tinyint_col
 ====
 # Three-way join query with an inline view on the probe side of the join where the left
 # child of the equi-join predicate is an arithmetic expr between two slots from
@@ -208,8 +208,8 @@ select straight_join * from functional.alltypesagg t1,
 where v.cnt = t1.year and v.id = t1.month
 ---- PLAN
 03:HASH JOIN [INNER JOIN]
-|  hash predicates: t1.year = count(int_col), t1.month = id
-|  runtime filters: RF000 <- count(int_col), RF001 <- id
+|  hash predicates: t1.month = id, t1.year = count(int_col)
+|  runtime filters: RF000 <- id, RF001 <- count(int_col)
 |
 |--02:AGGREGATE [FINALIZE]
 |  |  output: count(int_col)
@@ -221,7 +221,7 @@ where v.cnt = t1.year and v.id = t1.month
 |
 00:SCAN HDFS [functional.alltypesagg t1]
    partitions=0/11 files=0 size=0B
-   runtime filters: RF000 -> t1.year, RF001 -> t1.month
+   runtime filters: RF000 -> t1.month, RF001 -> t1.year
 ====
 # Two-way join query with an inline view in the build side of the join that has a
 # two-way join (bushy plan)
@@ -231,8 +231,8 @@ select straight_join * from functional.alltypesagg t1,
 where v.id = t1.year and t1.month = v.tinyint_col
 ---- PLAN
 04:HASH JOIN [INNER JOIN]
-|  hash predicates: t1.year = t2.id + t3.id, t1.month = t3.tinyint_col
-|  runtime filters: RF000 <- t2.id + t3.id, RF001 <- t3.tinyint_col
+|  hash predicates: t1.month = t3.tinyint_col, t1.year = t2.id + t3.id
+|  runtime filters: RF000 <- t3.tinyint_col, RF001 <- t2.id + t3.id
 |
 |--03:HASH JOIN [INNER JOIN]
 |  |  hash predicates: t2.int_col = t3.int_col
@@ -247,7 +247,7 @@ where v.id = t1.year and t1.month = v.tinyint_col
 |
 00:SCAN HDFS [functional.alltypesagg t1]
    partitions=11/11 files=11 size=814.73KB
-   runtime filters: RF000 -> t1.year, RF001 -> t1.month
+   runtime filters: RF000 -> t1.month, RF001 -> t1.year
 ====
 # Four-way join query with an inline view in the build side of the join where the
 # inline view has a tree-way cyclic join (bushy plan)
@@ -448,7 +448,7 @@ where t2.id = 10 and t1.month = t2.tinyint_col and t1.int_col = 1
 02:HASH JOIN [RIGHT OUTER JOIN]
 |  hash predicates: t1.year = t2.int_col
 |  other join predicates: t2.int_col = 10
-|  other predicates: t1.month = t2.tinyint_col, t1.int_col = 1
+|  other predicates: t1.int_col = 1, t1.month = t2.tinyint_col
 |  runtime filters: RF000 <- t2.int_col, RF001 <- t2.tinyint_col
 |
 |--01:SCAN HDFS [functional.alltypesnopart t2]
@@ -706,7 +706,7 @@ select straight_join * from
 where v1.month = t3.tinyint_col and v1.year = t3.id and t3.bool_col = false
 ---- PLAN
 06:HASH JOIN [INNER JOIN]
-|  hash predicates: month = t3.tinyint_col, year = t3.id
+|  hash predicates: year = t3.id, month = t3.tinyint_col
 |
 |--05:SCAN HDFS [functional.alltypesnopart t3]
 |     partitions=1/1 files=0 size=0B

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/8c2bf976/testdata/workloads/functional-planner/queries/PlannerTest/subquery-rewrite.test
----------------------------------------------------------------------
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/subquery-rewrite.test b/testdata/workloads/functional-planner/queries/PlannerTest/subquery-rewrite.test
index cdcfe15..bbff166 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/subquery-rewrite.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/subquery-rewrite.test
@@ -341,7 +341,7 @@ select * from t where t.bool_col = false and t.int_col = 10
 |
 00:SCAN HDFS [functional.alltypes a]
    partitions=24/24 files=24 size=478.45KB
-   predicates: a.bool_col = FALSE, a.int_col = 10
+   predicates: a.int_col = 10, a.bool_col = FALSE
    runtime filters: RF000 -> id
 ====
 # Subqueries in WITH, FROM and WHERE clauses
@@ -1063,7 +1063,7 @@ and bool_col = false
 |  |
 |  01:SCAN HDFS [functional.alltypes]
 |     partitions=24/24 files=24 size=478.45KB
-|     predicates: bool_col = FALSE, id < 5
+|     predicates: id < 5, bool_col = FALSE
 |
 00:SCAN HDFS [functional.alltypesagg g]
    partitions=11/11 files=11 size=814.73KB
@@ -1466,7 +1466,7 @@ where
    where t1.id + t2.id = t.bigint_col) = t.int_col
 ---- PLAN
 05:HASH JOIN [RIGHT SEMI JOIN]
-|  hash predicates: sum(t1.id) = t.int_col, t1.id + t2.id = t.bigint_col
+|  hash predicates: t1.id + t2.id = t.bigint_col, sum(t1.id) = t.int_col
 |
 |--00:SCAN HDFS [functional.alltypestiny t]
 |     partitions=4/4 files=4 size=460B

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/8c2bf976/testdata/workloads/functional-planner/queries/PlannerTest/tpcds-all.test
----------------------------------------------------------------------
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds-all.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds-all.test
index 57060c6..42fb815 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds-all.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds-all.test
@@ -156,7 +156,7 @@ limit 100
 |
 |--01:SCAN HDFS [tpcds.customer_demographics]
 |     partitions=1/1 files=1 size=76.92MB
-|     predicates: cd_gender = 'F', cd_marital_status = 'W', cd_education_status = 'Primary'
+|     predicates: cd_marital_status = 'W', cd_gender = 'F', cd_education_status = 'Primary'
 |
 05:HASH JOIN [INNER JOIN]
 |  hash predicates: ss_promo_sk = p_promo_sk
@@ -214,7 +214,7 @@ limit 100
 |  |
 |  01:SCAN HDFS [tpcds.customer_demographics]
 |     partitions=1/1 files=1 size=76.92MB
-|     predicates: cd_gender = 'F', cd_marital_status = 'W', cd_education_status = 'Primary'
+|     predicates: cd_marital_status = 'W', cd_gender = 'F', cd_education_status = 'Primary'
 |
 12:EXCHANGE [HASH(ss_cdemo_sk)]
 |
@@ -483,7 +483,7 @@ limit 100
 |
 |--00:SCAN HDFS [tpcds.date_dim]
 |     partitions=1/1 files=1 size=9.84MB
-|     predicates: d_moy = 11, d_year = 1999, tpcds.date_dim.d_date_sk >= 2451484, tpcds.date_dim.d_date_sk <= 2451513
+|     predicates: d_year = 1999, d_moy = 11, tpcds.date_dim.d_date_sk >= 2451484, tpcds.date_dim.d_date_sk <= 2451513
 |
 08:HASH JOIN [INNER JOIN]
 |  hash predicates: ss_item_sk = i_item_sk
@@ -548,7 +548,7 @@ limit 100
 |  |
 |  00:SCAN HDFS [tpcds.date_dim]
 |     partitions=1/1 files=1 size=9.84MB
-|     predicates: d_moy = 11, d_year = 1999, tpcds.date_dim.d_date_sk >= 2451484, tpcds.date_dim.d_date_sk <= 2451513
+|     predicates: d_year = 1999, d_moy = 11, tpcds.date_dim.d_date_sk >= 2451484, tpcds.date_dim.d_date_sk <= 2451513
 |
 08:HASH JOIN [INNER JOIN, BROADCAST]
 |  hash predicates: ss_item_sk = i_item_sk
@@ -652,7 +652,7 @@ limit 100
 |
 |--01:SCAN HDFS [tpcds.customer_demographics]
 |     partitions=1/1 files=1 size=76.92MB
-|     predicates: cd_gender = 'F', cd_marital_status = 'W', cd_education_status = 'Primary'
+|     predicates: cd_marital_status = 'W', cd_gender = 'F', cd_education_status = 'Primary'
 |
 00:SCAN HDFS [tpcds.store_sales]
    partitions=120/120 files=120 size=21.31MB
@@ -712,7 +712,7 @@ limit 100
 |  |
 |  01:SCAN HDFS [tpcds.customer_demographics]
 |     partitions=1/1 files=1 size=76.92MB
-|     predicates: cd_gender = 'F', cd_marital_status = 'W', cd_education_status = 'Primary'
+|     predicates: cd_marital_status = 'W', cd_gender = 'F', cd_education_status = 'Primary'
 |
 11:EXCHANGE [HASH(ss_cdemo_sk)]
 |
@@ -791,7 +791,7 @@ limit 100000
 |  |
 |  |--01:SCAN HDFS [tpcds.date_dim]
 |  |     partitions=1/1 files=1 size=9.84MB
-|  |     predicates: (date_dim.d_dom BETWEEN 1 AND 3 OR date_dim.d_dom BETWEEN 25 AND 28), date_dim.d_year IN (1998, 1998 + 1, 1998 + 2)
+|  |     predicates: date_dim.d_year IN (1998, 1998 + 1, 1998 + 2), (date_dim.d_dom BETWEEN 1 AND 3 OR date_dim.d_dom BETWEEN 25 AND 28)
 |  |
 |  04:HASH JOIN [INNER JOIN]
 |  |  hash predicates: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
@@ -799,7 +799,7 @@ limit 100000
 |  |
 |  |--03:SCAN HDFS [tpcds.household_demographics]
 |  |     partitions=1/1 files=1 size=148.10KB
-|  |     predicates: (household_demographics.hd_buy_potential = '>10000' OR household_demographics.hd_buy_potential = 'unknown'), household_demographics.hd_vehicle_count > 0, (CASE WHEN household_demographics.hd_vehicle_count > 0 THEN household_demographics.hd_dep_count / household_demographics.hd_vehicle_count ELSE NULL END) > 1.2
+|  |     predicates: household_demographics.hd_vehicle_count > 0, (CASE WHEN household_demographics.hd_vehicle_count > 0 THEN household_demographics.hd_dep_count / household_demographics.hd_vehicle_count ELSE NULL END) > 1.2, (household_demographics.hd_buy_potential = '>10000' OR household_demographics.hd_buy_potential = 'unknown')
 |  |
 |  00:SCAN HDFS [tpcds.store_sales]
 |     partitions=120/120 files=120 size=21.31MB
@@ -851,7 +851,7 @@ limit 100000
 |  |  |
 |  |  01:SCAN HDFS [tpcds.date_dim]
 |  |     partitions=1/1 files=1 size=9.84MB
-|  |     predicates: (date_dim.d_dom BETWEEN 1 AND 3 OR date_dim.d_dom BETWEEN 25 AND 28), date_dim.d_year IN (1998, 1998 + 1, 1998 + 2)
+|  |     predicates: date_dim.d_year IN (1998, 1998 + 1, 1998 + 2), (date_dim.d_dom BETWEEN 1 AND 3 OR date_dim.d_dom BETWEEN 25 AND 28)
 |  |
 |  04:HASH JOIN [INNER JOIN, BROADCAST]
 |  |  hash predicates: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
@@ -861,7 +861,7 @@ limit 100000
 |  |  |
 |  |  03:SCAN HDFS [tpcds.household_demographics]
 |  |     partitions=1/1 files=1 size=148.10KB
-|  |     predicates: (household_demographics.hd_buy_potential = '>10000' OR household_demographics.hd_buy_potential = 'unknown'), household_demographics.hd_vehicle_count > 0, (CASE WHEN household_demographics.hd_vehicle_count > 0 THEN household_demographics.hd_dep_count / household_demographics.hd_vehicle_count ELSE NULL END) > 1.2
+|  |     predicates: household_demographics.hd_vehicle_count > 0, (CASE WHEN household_demographics.hd_vehicle_count > 0 THEN household_demographics.hd_dep_count / household_demographics.hd_vehicle_count ELSE NULL END) > 1.2, (household_demographics.hd_buy_potential = '>10000' OR household_demographics.hd_buy_potential = 'unknown')
 |  |
 |  00:SCAN HDFS [tpcds.store_sales]
 |     partitions=120/120 files=120 size=21.31MB
@@ -911,7 +911,7 @@ limit 100
 |
 |--00:SCAN HDFS [tpcds.date_dim dt]
 |     partitions=1/1 files=1 size=9.84MB
-|     predicates: dt.d_moy = 12, dt.d_year = 1998
+|     predicates: dt.d_year = 1998, dt.d_moy = 12
 |
 03:HASH JOIN [INNER JOIN]
 |  hash predicates: store_sales.ss_item_sk = item.i_item_sk
@@ -950,7 +950,7 @@ limit 100
 |  |
 |  00:SCAN HDFS [tpcds.date_dim dt]
 |     partitions=1/1 files=1 size=9.84MB
-|     predicates: dt.d_moy = 12, dt.d_year = 1998
+|     predicates: dt.d_year = 1998, dt.d_moy = 12
 |
 03:HASH JOIN [INNER JOIN, BROADCAST]
 |  hash predicates: store_sales.ss_item_sk = item.i_item_sk
@@ -1189,7 +1189,7 @@ limit 100
 |  |
 |  |--01:SCAN HDFS [tpcds.date_dim]
 |  |     partitions=1/1 files=1 size=9.84MB
-|  |     predicates: date_dim.d_dow IN (6, 0), date_dim.d_year IN (1999, 1999 + 1, 1999 + 2), tpcds.date_dim.d_date_sk IN (2451181, 2451182, 2451188, 2451189, 2451195, 2451196, 2451202, 2451203, 2451209, 2451210, 2451216, 2451217, 2451223, 2451224, 2451230, 2451231, 2451237, 2451238, 2451244, 2451245, 2451251, 2451252, 2451258, 2451259, 2451265, 2451266, 2451272, 2451273, 2451279, 2451280, 2451286, 2451287, 2451293, 2451294, 2451300, 2451301, 2451307, 2451308, 2451314, 2451315, 2451321, 2451322, 2451328, 2451329, 2451335, 2451336, 2451342, 2451343, 2451349, 2451350, 2451356, 2451357, 2451363, 2451364, 2451370, 2451371, 2451377, 2451378, 2451384, 2451385, 2451391, 2451392, 2451398, 2451399, 2451405, 2451406, 2451412, 2451413, 2451419, 2451420, 2451426, 2451427, 2451433, 2451434, 2451440, 2451441, 2451447, 2451448, 2451454, 2451455, 2451461, 2451462, 2451468, 2451469, 2451475, 2451476, 2451482, 2451483, 2451489, 2451490, 2451496, 2451497, 2451503, 2451504, 2451510, 2451511, 2451517, 2
 451518, 2451524, 2451525, 2451531, 2451532, 2451538, 2451539, 2451545, 2451546, 2451552, 2451553, 2451559, 2451560, 2451566, 2451567, 2451573, 2451574, 2451580, 2451581, 2451587, 2451588, 2451594, 2451595, 2451601, 2451602, 2451608, 2451609, 2451615, 2451616, 2451622, 2451623, 2451629, 2451630, 2451636, 2451637, 2451643, 2451644, 2451650, 2451651, 2451657, 2451658, 2451664, 2451665, 2451671, 2451672, 2451678, 2451679, 2451685, 2451686, 2451692, 2451693, 2451699, 2451700, 2451706, 2451707, 2451713, 2451714, 2451720, 2451721, 2451727, 2451728, 2451734, 2451735, 2451741, 2451742, 2451748, 2451749, 2451755, 2451756, 2451762, 2451763, 2451769, 2451770, 2451776, 2451777, 2451783, 2451784, 2451790, 2451791, 2451797, 2451798, 2451804, 2451805, 2451811, 2451812, 2451818, 2451819, 2451825, 2451826, 2451832, 2451833, 2451839, 2451840, 2451846, 2451847, 2451853, 2451854, 2451860, 2451861, 2451867, 2451868, 2451874, 2451875, 2451881, 2451882, 2451888, 2451889, 2451895, 2451896, 2451902, 2451903,
  2451909, 2451910, 2451916, 2451917, 2451923, 2451924, 2451930, 2451931, 2451937, 2451938, 2451944, 2451945, 2451951, 2451952, 2451958, 2451959, 2451965, 2451966, 2451972, 2451973, 2451979, 2451980, 2451986, 2451987, 2451993, 2451994, 2452000, 2452001, 2452007, 2452008, 2452014, 2452015, 2452021, 2452022, 2452028, 2452029, 2452035, 2452036, 2452042, 2452043, 2452049, 2452050, 2452056, 2452057, 2452063, 2452064, 2452070, 2452071, 2452077, 2452078, 2452084, 2452085, 2452091, 2452092, 2452098, 2452099, 2452105, 2452106, 2452112, 2452113, 2452119, 2452120, 2452126, 2452127, 2452133, 2452134, 2452140, 2452141, 2452147, 2452148, 2452154, 2452155, 2452161, 2452162, 2452168, 2452169, 2452175, 2452176, 2452182, 2452183, 2452189, 2452190, 2452196, 2452197, 2452203, 2452204, 2452210, 2452211, 2452217, 2452218, 2452224, 2452225, 2452231, 2452232, 2452238, 2452239, 2452245, 2452246, 2452252, 2452253, 2452259, 2452260, 2452266, 2452267, 2452273, 2452274)
+|  |     predicates: date_dim.d_year IN (1999, 1999 + 1, 1999 + 2), date_dim.d_dow IN (6, 0), tpcds.date_dim.d_date_sk IN (2451181, 2451182, 2451188, 2451189, 2451195, 2451196, 2451202, 2451203, 2451209, 2451210, 2451216, 2451217, 2451223, 2451224, 2451230, 2451231, 2451237, 2451238, 2451244, 2451245, 2451251, 2451252, 2451258, 2451259, 2451265, 2451266, 2451272, 2451273, 2451279, 2451280, 2451286, 2451287, 2451293, 2451294, 2451300, 2451301, 2451307, 2451308, 2451314, 2451315, 2451321, 2451322, 2451328, 2451329, 2451335, 2451336, 2451342, 2451343, 2451349, 2451350, 2451356, 2451357, 2451363, 2451364, 2451370, 2451371, 2451377, 2451378, 2451384, 2451385, 2451391, 2451392, 2451398, 2451399, 2451405, 2451406, 2451412, 2451413, 2451419, 2451420, 2451426, 2451427, 2451433, 2451434, 2451440, 2451441, 2451447, 2451448, 2451454, 2451455, 2451461, 2451462, 2451468, 2451469, 2451475, 2451476, 2451482, 2451483, 2451489, 2451490, 2451496, 2451497, 2451503, 2451504, 2451510, 2451511, 2451517, 2
 451518, 2451524, 2451525, 2451531, 2451532, 2451538, 2451539, 2451545, 2451546, 2451552, 2451553, 2451559, 2451560, 2451566, 2451567, 2451573, 2451574, 2451580, 2451581, 2451587, 2451588, 2451594, 2451595, 2451601, 2451602, 2451608, 2451609, 2451615, 2451616, 2451622, 2451623, 2451629, 2451630, 2451636, 2451637, 2451643, 2451644, 2451650, 2451651, 2451657, 2451658, 2451664, 2451665, 2451671, 2451672, 2451678, 2451679, 2451685, 2451686, 2451692, 2451693, 2451699, 2451700, 2451706, 2451707, 2451713, 2451714, 2451720, 2451721, 2451727, 2451728, 2451734, 2451735, 2451741, 2451742, 2451748, 2451749, 2451755, 2451756, 2451762, 2451763, 2451769, 2451770, 2451776, 2451777, 2451783, 2451784, 2451790, 2451791, 2451797, 2451798, 2451804, 2451805, 2451811, 2451812, 2451818, 2451819, 2451825, 2451826, 2451832, 2451833, 2451839, 2451840, 2451846, 2451847, 2451853, 2451854, 2451860, 2451861, 2451867, 2451868, 2451874, 2451875, 2451881, 2451882, 2451888, 2451889, 2451895, 2451896, 2451902, 2451903,
  2451909, 2451910, 2451916, 2451917, 2451923, 2451924, 2451930, 2451931, 2451937, 2451938, 2451944, 2451945, 2451951, 2451952, 2451958, 2451959, 2451965, 2451966, 2451972, 2451973, 2451979, 2451980, 2451986, 2451987, 2451993, 2451994, 2452000, 2452001, 2452007, 2452008, 2452014, 2452015, 2452021, 2452022, 2452028, 2452029, 2452035, 2452036, 2452042, 2452043, 2452049, 2452050, 2452056, 2452057, 2452063, 2452064, 2452070, 2452071, 2452077, 2452078, 2452084, 2452085, 2452091, 2452092, 2452098, 2452099, 2452105, 2452106, 2452112, 2452113, 2452119, 2452120, 2452126, 2452127, 2452133, 2452134, 2452140, 2452141, 2452147, 2452148, 2452154, 2452155, 2452161, 2452162, 2452168, 2452169, 2452175, 2452176, 2452182, 2452183, 2452189, 2452190, 2452196, 2452197, 2452203, 2452204, 2452210, 2452211, 2452217, 2452218, 2452224, 2452225, 2452231, 2452232, 2452238, 2452239, 2452245, 2452246, 2452252, 2452253, 2452259, 2452260, 2452266, 2452267, 2452273, 2452274)
 |  |
 |  05:HASH JOIN [INNER JOIN]
 |  |  hash predicates: customer_address.ca_address_sk = store_sales.ss_addr_sk
@@ -1268,7 +1268,7 @@ limit 100
 |  |  |
 |  |  01:SCAN HDFS [tpcds.date_dim]
 |  |     partitions=1/1 files=1 size=9.84MB
-|  |     predicates: date_dim.d_dow IN (6, 0), date_dim.d_year IN (1999, 1999 + 1, 1999 + 2), tpcds.date_dim.d_date_sk IN (2451181, 2451182, 2451188, 2451189, 2451195, 2451196, 2451202, 2451203, 2451209, 2451210, 2451216, 2451217, 2451223, 2451224, 2451230, 2451231, 2451237, 2451238, 2451244, 2451245, 2451251, 2451252, 2451258, 2451259, 2451265, 2451266, 2451272, 2451273, 2451279, 2451280, 2451286, 2451287, 2451293, 2451294, 2451300, 2451301, 2451307, 2451308, 2451314, 2451315, 2451321, 2451322, 2451328, 2451329, 2451335, 2451336, 2451342, 2451343, 2451349, 2451350, 2451356, 2451357, 2451363, 2451364, 2451370, 2451371, 2451377, 2451378, 2451384, 2451385, 2451391, 2451392, 2451398, 2451399, 2451405, 2451406, 2451412, 2451413, 2451419, 2451420, 2451426, 2451427, 2451433, 2451434, 2451440, 2451441, 2451447, 2451448, 2451454, 2451455, 2451461, 2451462, 2451468, 2451469, 2451475, 2451476, 2451482, 2451483, 2451489, 2451490, 2451496, 2451497, 2451503, 2451504, 2451510, 2451511, 2451517, 2
 451518, 2451524, 2451525, 2451531, 2451532, 2451538, 2451539, 2451545, 2451546, 2451552, 2451553, 2451559, 2451560, 2451566, 2451567, 2451573, 2451574, 2451580, 2451581, 2451587, 2451588, 2451594, 2451595, 2451601, 2451602, 2451608, 2451609, 2451615, 2451616, 2451622, 2451623, 2451629, 2451630, 2451636, 2451637, 2451643, 2451644, 2451650, 2451651, 2451657, 2451658, 2451664, 2451665, 2451671, 2451672, 2451678, 2451679, 2451685, 2451686, 2451692, 2451693, 2451699, 2451700, 2451706, 2451707, 2451713, 2451714, 2451720, 2451721, 2451727, 2451728, 2451734, 2451735, 2451741, 2451742, 2451748, 2451749, 2451755, 2451756, 2451762, 2451763, 2451769, 2451770, 2451776, 2451777, 2451783, 2451784, 2451790, 2451791, 2451797, 2451798, 2451804, 2451805, 2451811, 2451812, 2451818, 2451819, 2451825, 2451826, 2451832, 2451833, 2451839, 2451840, 2451846, 2451847, 2451853, 2451854, 2451860, 2451861, 2451867, 2451868, 2451874, 2451875, 2451881, 2451882, 2451888, 2451889, 2451895, 2451896, 2451902, 2451903,
  2451909, 2451910, 2451916, 2451917, 2451923, 2451924, 2451930, 2451931, 2451937, 2451938, 2451944, 2451945, 2451951, 2451952, 2451958, 2451959, 2451965, 2451966, 2451972, 2451973, 2451979, 2451980, 2451986, 2451987, 2451993, 2451994, 2452000, 2452001, 2452007, 2452008, 2452014, 2452015, 2452021, 2452022, 2452028, 2452029, 2452035, 2452036, 2452042, 2452043, 2452049, 2452050, 2452056, 2452057, 2452063, 2452064, 2452070, 2452071, 2452077, 2452078, 2452084, 2452085, 2452091, 2452092, 2452098, 2452099, 2452105, 2452106, 2452112, 2452113, 2452119, 2452120, 2452126, 2452127, 2452133, 2452134, 2452140, 2452141, 2452147, 2452148, 2452154, 2452155, 2452161, 2452162, 2452168, 2452169, 2452175, 2452176, 2452182, 2452183, 2452189, 2452190, 2452196, 2452197, 2452203, 2452204, 2452210, 2452211, 2452217, 2452218, 2452224, 2452225, 2452231, 2452232, 2452238, 2452239, 2452245, 2452246, 2452252, 2452253, 2452259, 2452260, 2452266, 2452267, 2452273, 2452274)
+|  |     predicates: date_dim.d_year IN (1999, 1999 + 1, 1999 + 2), date_dim.d_dow IN (6, 0), tpcds.date_dim.d_date_sk IN (2451181, 2451182, 2451188, 2451189, 2451195, 2451196, 2451202, 2451203, 2451209, 2451210, 2451216, 2451217, 2451223, 2451224, 2451230, 2451231, 2451237, 2451238, 2451244, 2451245, 2451251, 2451252, 2451258, 2451259, 2451265, 2451266, 2451272, 2451273, 2451279, 2451280, 2451286, 2451287, 2451293, 2451294, 2451300, 2451301, 2451307, 2451308, 2451314, 2451315, 2451321, 2451322, 2451328, 2451329, 2451335, 2451336, 2451342, 2451343, 2451349, 2451350, 2451356, 2451357, 2451363, 2451364, 2451370, 2451371, 2451377, 2451378, 2451384, 2451385, 2451391, 2451392, 2451398, 2451399, 2451405, 2451406, 2451412, 2451413, 2451419, 2451420, 2451426, 2451427, 2451433, 2451434, 2451440, 2451441, 2451447, 2451448, 2451454, 2451455, 2451461, 2451462, 2451468, 2451469, 2451475, 2451476, 2451482, 2451483, 2451489, 2451490, 2451496, 2451497, 2451503, 2451504, 2451510, 2451511, 2451517, 2
 451518, 2451524, 2451525, 2451531, 2451532, 2451538, 2451539, 2451545, 2451546, 2451552, 2451553, 2451559, 2451560, 2451566, 2451567, 2451573, 2451574, 2451580, 2451581, 2451587, 2451588, 2451594, 2451595, 2451601, 2451602, 2451608, 2451609, 2451615, 2451616, 2451622, 2451623, 2451629, 2451630, 2451636, 2451637, 2451643, 2451644, 2451650, 2451651, 2451657, 2451658, 2451664, 2451665, 2451671, 2451672, 2451678, 2451679, 2451685, 2451686, 2451692, 2451693, 2451699, 2451700, 2451706, 2451707, 2451713, 2451714, 2451720, 2451721, 2451727, 2451728, 2451734, 2451735, 2451741, 2451742, 2451748, 2451749, 2451755, 2451756, 2451762, 2451763, 2451769, 2451770, 2451776, 2451777, 2451783, 2451784, 2451790, 2451791, 2451797, 2451798, 2451804, 2451805, 2451811, 2451812, 2451818, 2451819, 2451825, 2451826, 2451832, 2451833, 2451839, 2451840, 2451846, 2451847, 2451853, 2451854, 2451860, 2451861, 2451867, 2451868, 2451874, 2451875, 2451881, 2451882, 2451888, 2451889, 2451895, 2451896, 2451902, 2451903,
  2451909, 2451910, 2451916, 2451917, 2451923, 2451924, 2451930, 2451931, 2451937, 2451938, 2451944, 2451945, 2451951, 2451952, 2451958, 2451959, 2451965, 2451966, 2451972, 2451973, 2451979, 2451980, 2451986, 2451987, 2451993, 2451994, 2452000, 2452001, 2452007, 2452008, 2452014, 2452015, 2452021, 2452022, 2452028, 2452029, 2452035, 2452036, 2452042, 2452043, 2452049, 2452050, 2452056, 2452057, 2452063, 2452064, 2452070, 2452071, 2452077, 2452078, 2452084, 2452085, 2452091, 2452092, 2452098, 2452099, 2452105, 2452106, 2452112, 2452113, 2452119, 2452120, 2452126, 2452127, 2452133, 2452134, 2452140, 2452141, 2452147, 2452148, 2452154, 2452155, 2452161, 2452162, 2452168, 2452169, 2452175, 2452176, 2452182, 2452183, 2452189, 2452190, 2452196, 2452197, 2452203, 2452204, 2452210, 2452211, 2452217, 2452218, 2452224, 2452225, 2452231, 2452232, 2452238, 2452239, 2452245, 2452246, 2452252, 2452253, 2452259, 2452260, 2452266, 2452267, 2452273, 2452274)
 |  |
 |  05:HASH JOIN [INNER JOIN, BROADCAST]
 |  |  hash predicates: customer_address.ca_address_sk = store_sales.ss_addr_sk
@@ -1327,7 +1327,7 @@ limit 100
 |
 |--00:SCAN HDFS [tpcds.date_dim dt]
 |     partitions=1/1 files=1 size=9.84MB
-|     predicates: dt.d_moy = 12, dt.d_year = 1998
+|     predicates: dt.d_year = 1998, dt.d_moy = 12
 |
 03:HASH JOIN [INNER JOIN]
 |  hash predicates: store_sales.ss_item_sk = item.i_item_sk
@@ -1366,7 +1366,7 @@ limit 100
 |  |
 |  00:SCAN HDFS [tpcds.date_dim dt]
 |     partitions=1/1 files=1 size=9.84MB
-|     predicates: dt.d_moy = 12, dt.d_year = 1998
+|     predicates: dt.d_year = 1998, dt.d_moy = 12
 |
 03:HASH JOIN [INNER JOIN, BROADCAST]
 |  hash predicates: store_sales.ss_item_sk = item.i_item_sk
@@ -1536,7 +1536,7 @@ limit 100
 |
 |--00:SCAN HDFS [tpcds.date_dim]
 |     partitions=1/1 files=1 size=9.84MB
-|     predicates: d_moy = 12, d_year = 2001
+|     predicates: d_year = 2001, d_moy = 12
 |
 03:HASH JOIN [INNER JOIN]
 |  hash predicates: ss_item_sk = i_item_sk
@@ -1575,7 +1575,7 @@ limit 100
 |  |
 |  00:SCAN HDFS [tpcds.date_dim]
 |     partitions=1/1 files=1 size=9.84MB
-|     predicates: d_moy = 12, d_year = 2001
+|     predicates: d_year = 2001, d_moy = 12
 |
 03:HASH JOIN [INNER JOIN, BROADCAST]
 |  hash predicates: ss_item_sk = i_item_sk
@@ -1678,8 +1678,8 @@ limit 100
 |  order by: s_store_name1 ASC, s_store_id1 ASC, d_week_seq1 ASC
 |
 16:HASH JOIN [INNER JOIN]
-|  hash predicates: s_store_id = s_store_id, d_week_seq = d_week_seq - 52
-|  runtime filters: RF001 <- d_week_seq - 52, RF000 <- s_store_id
+|  hash predicates: d_week_seq = d_week_seq - 52, s_store_id = s_store_id
+|  runtime filters: RF000 <- d_week_seq - 52, RF001 <- s_store_id
 |
 |--15:HASH JOIN [INNER JOIN]
 |  |  hash predicates: d_week_seq = d.d_week_seq
@@ -1726,7 +1726,7 @@ limit 100
 |
 |--04:SCAN HDFS [tpcds.store]
 |     partitions=1/1 files=1 size=3.08KB
-|     runtime filters: RF000 -> s_store_id
+|     runtime filters: RF001 -> s_store_id
 |
 03:AGGREGATE [FINALIZE]
 |  output: sum(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END)
@@ -1738,7 +1738,7 @@ limit 100
 |
 |--01:SCAN HDFS [tpcds.date_dim]
 |     partitions=1/1 files=1 size=9.84MB
-|     runtime filters: RF001 -> tpcds.date_dim.d_week_seq, RF002 -> tpcds.date_dim.d_week_seq
+|     runtime filters: RF000 -> tpcds.date_dim.d_week_seq, RF002 -> tpcds.date_dim.d_week_seq
 |
 00:SCAN HDFS [tpcds.store_sales]
    partitions=120/120 files=120 size=21.31MB
@@ -1752,10 +1752,10 @@ limit 100
 |  order by: s_store_name1 ASC, s_store_id1 ASC, d_week_seq1 ASC
 |
 16:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: s_store_id = s_store_id, d_week_seq = d_week_seq - 52
-|  runtime filters: RF001 <- d_week_seq - 52, RF000 <- s_store_id
+|  hash predicates: d_week_seq = d_week_seq - 52, s_store_id = s_store_id
+|  runtime filters: RF000 <- d_week_seq - 52, RF001 <- s_store_id
 |
-|--31:EXCHANGE [HASH(s_store_id,d_week_seq - 52)]
+|--31:EXCHANGE [HASH(d_week_seq - 52,s_store_id)]
 |  |
 |  15:HASH JOIN [INNER JOIN, BROADCAST]
 |  |  hash predicates: d_week_seq = d.d_week_seq
@@ -1802,7 +1802,7 @@ limit 100
 |     partitions=120/120 files=120 size=21.31MB
 |     runtime filters: RF006 -> tpcds.store_sales.ss_store_sk, RF007 -> ss_sold_date_sk
 |
-30:EXCHANGE [HASH(s_store_id,d_week_seq)]
+30:EXCHANGE [HASH(d_week_seq,s_store_id)]
 |
 07:HASH JOIN [INNER JOIN, BROADCAST]
 |  hash predicates: d_week_seq = d.d_week_seq
@@ -1822,7 +1822,7 @@ limit 100
 |  |
 |  04:SCAN HDFS [tpcds.store]
 |     partitions=1/1 files=1 size=3.08KB
-|     runtime filters: RF000 -> s_store_id
+|     runtime filters: RF001 -> s_store_id
 |
 21:AGGREGATE [FINALIZE]
 |  output: sum:merge(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END)
@@ -1842,7 +1842,7 @@ limit 100
 |  |
 |  01:SCAN HDFS [tpcds.date_dim]
 |     partitions=1/1 files=1 size=9.84MB
-|     runtime filters: RF001 -> tpcds.date_dim.d_week_seq, RF002 -> tpcds.date_dim.d_week_seq
+|     runtime filters: RF000 -> tpcds.date_dim.d_week_seq, RF002 -> tpcds.date_dim.d_week_seq
 |
 18:EXCHANGE [HASH(ss_sold_date_sk)]
 |
@@ -1917,7 +1917,7 @@ limit 100
 |
 |--02:SCAN HDFS [tpcds.date_dim]
 |     partitions=1/1 files=1 size=9.84MB
-|     predicates: d_month_seq IN (1212, 1212 + 1, 1212 + 2, 1212 + 3, 1212 + 4, 1212 + 5, 1212 + 6, 1212 + 7, 1212 + 8, 1212 + 9, 1212 + 10, 1212 + 11), tpcds.date_dim.d_date_sk >= 2451911, tpcds.date_dim.d_date_sk <= 2452275
+|     predicates: tpcds.date_dim.d_date_sk >= 2451911, tpcds.date_dim.d_date_sk <= 2452275, d_month_seq IN (1212, 1212 + 1, 1212 + 2, 1212 + 3, 1212 + 4, 1212 + 5, 1212 + 6, 1212 + 7, 1212 + 8, 1212 + 9, 1212 + 10, 1212 + 11)
 |
 04:HASH JOIN [INNER JOIN]
 |  hash predicates: ss_item_sk = i_item_sk
@@ -1975,7 +1975,7 @@ limit 100
 |  |
 |  02:SCAN HDFS [tpcds.date_dim]
 |     partitions=1/1 files=1 size=9.84MB
-|     predicates: d_month_seq IN (1212, 1212 + 1, 1212 + 2, 1212 + 3, 1212 + 4, 1212 + 5, 1212 + 6, 1212 + 7, 1212 + 8, 1212 + 9, 1212 + 10, 1212 + 11), tpcds.date_dim.d_date_sk >= 2451911, tpcds.date_dim.d_date_sk <= 2452275
+|     predicates: tpcds.date_dim.d_date_sk >= 2451911, tpcds.date_dim.d_date_sk <= 2452275, d_month_seq IN (1212, 1212 + 1, 1212 + 2, 1212 + 3, 1212 + 4, 1212 + 5, 1212 + 6, 1212 + 7, 1212 + 8, 1212 + 9, 1212 + 10, 1212 + 11)
 |
 13:EXCHANGE [HASH(ss_sold_date_sk)]
 |
@@ -2457,7 +2457,7 @@ limit 1000
 |  |
 |  |--03:SCAN HDFS [tpcds.household_demographics]
 |  |     partitions=1/1 files=1 size=148.10KB
-|  |     predicates: (household_demographics.hd_buy_potential = '>10000' OR household_demographics.hd_buy_potential = 'unknown'), household_demographics.hd_vehicle_count > 0, CASE WHEN household_demographics.hd_vehicle_count > 0 THEN household_demographics.hd_dep_count / household_demographics.hd_vehicle_count ELSE NULL END > 1
+|  |     predicates: household_demographics.hd_vehicle_count > 0, CASE WHEN household_demographics.hd_vehicle_count > 0 THEN household_demographics.hd_dep_count / household_demographics.hd_vehicle_count ELSE NULL END > 1, (household_demographics.hd_buy_potential = '>10000' OR household_demographics.hd_buy_potential = 'unknown')
 |  |
 |  00:SCAN HDFS [tpcds.store_sales]
 |     partitions=120/120 files=120 size=21.31MB
@@ -2520,7 +2520,7 @@ limit 1000
 |  |  |
 |  |  03:SCAN HDFS [tpcds.household_demographics]
 |  |     partitions=1/1 files=1 size=148.10KB
-|  |     predicates: (household_demographics.hd_buy_potential = '>10000' OR household_demographics.hd_buy_potential = 'unknown'), household_demographics.hd_vehicle_count > 0, CASE WHEN household_demographics.hd_vehicle_count > 0 THEN household_demographics.hd_dep_count / household_demographics.hd_vehicle_count ELSE NULL END > 1
+|  |     predicates: household_demographics.hd_vehicle_count > 0, CASE WHEN household_demographics.hd_vehicle_count > 0 THEN household_demographics.hd_dep_count / household_demographics.hd_vehicle_count ELSE NULL END > 1, (household_demographics.hd_buy_potential = '>10000' OR household_demographics.hd_buy_potential = 'unknown')
 |  |
 |  00:SCAN HDFS [tpcds.store_sales]
 |     partitions=120/120 files=120 size=21.31MB
@@ -3271,7 +3271,7 @@ with v1 as (
 |  order by: sum_sales - avg_monthly_sales ASC, d_year ASC
 |
 34:HASH JOIN [INNER JOIN]
-|  hash predicates: i_category = i_category, i_brand = i_brand, s_store_name = s_store_name, s_company_name = s_company_name, rank() = rank() - 1
+|  hash predicates: rank() = rank() - 1, s_store_name = s_store_name, i_category = i_category, s_company_name = s_company_name, i_brand = i_brand
 |
 |--32:ANALYTIC
 |  |  functions: rank()
@@ -3313,10 +3313,10 @@ with v1 as (
 |     runtime filters: RF006 -> ss_store_sk, RF007 -> ss_sold_date_sk, RF008 -> ss_item_sk
 |
 33:HASH JOIN [INNER JOIN]
-|  hash predicates: i_category = i_category, i_brand = i_brand, s_store_name = s_store_name, s_company_name = s_company_name, rank() + 1 = rank()
+|  hash predicates: rank() + 1 = rank(), s_store_name = s_store_name, i_category = i_category, s_company_name = s_company_name, i_brand = i_brand
 |
 |--12:SELECT
-|  |  predicates: d_year = 2000, CASE WHEN avg(sum(ss_sales_price)) > 0 THEN abs(sum(ss_sales_price) - avg(sum(ss_sales_price))) / avg(sum(ss_sales_price)) ELSE NULL END > 0.1, avg(sum(ss_sales_price)) > 0
+|  |  predicates: d_year = 2000, avg(sum(ss_sales_price)) > 0, CASE WHEN avg(sum(ss_sales_price)) > 0 THEN abs(sum(ss_sales_price) - avg(sum(ss_sales_price))) / avg(sum(ss_sales_price)) ELSE NULL END > 0.1
 |  |
 |  11:ANALYTIC
 |  |  functions: avg(sum(ss_sales_price))

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/8c2bf976/testdata/workloads/functional-planner/queries/PlannerTest/tpch-all.test
----------------------------------------------------------------------
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpch-all.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpch-all.test
index ee884d7..8fe3e3e 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpch-all.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpch-all.test
@@ -618,7 +618,7 @@ where
 |
 00:SCAN HDFS [tpch.lineitem]
    partitions=1/1 files=1 size=718.94MB
-   predicates: l_shipdate >= '1994-01-01', l_shipdate < '1995-01-01', l_discount >= 0.05, l_discount <= 0.07, l_quantity < 24
+   predicates: l_discount >= 0.05, l_discount <= 0.07, l_quantity < 24, l_shipdate >= '1994-01-01', l_shipdate < '1995-01-01'
 ---- DISTRIBUTEDPLAN
 03:AGGREGATE [FINALIZE]
 |  output: sum:merge(l_extendedprice * l_discount)
@@ -630,7 +630,7 @@ where
 |
 00:SCAN HDFS [tpch.lineitem]
    partitions=1/1 files=1 size=718.94MB
-   predicates: l_shipdate >= '1994-01-01', l_shipdate < '1995-01-01', l_discount >= 0.05, l_discount <= 0.07, l_quantity < 24
+   predicates: l_discount >= 0.05, l_discount <= 0.07, l_quantity < 24, l_shipdate >= '1994-01-01', l_shipdate < '1995-01-01'
 ====
 # TPCH-Q7
 # Q7 - Volume Shipping Query
@@ -1834,7 +1834,7 @@ order by
 |
 |--01:SCAN HDFS [tpch.part]
 |     partitions=1/1 files=1 size=22.83MB
-|     predicates: p_brand != 'Brand#45', NOT p_type LIKE 'MEDIUM POLISHED%', p_size IN (49, 14, 23, 45, 19, 3, 36, 9)
+|     predicates: p_size IN (49, 14, 23, 45, 19, 3, 36, 9), p_brand != 'Brand#45', NOT p_type LIKE 'MEDIUM POLISHED%'
 |
 00:SCAN HDFS [tpch.partsupp]
    partitions=1/1 files=1 size=112.71MB
@@ -1875,7 +1875,7 @@ order by
 |  |
 |  01:SCAN HDFS [tpch.part]
 |     partitions=1/1 files=1 size=22.83MB
-|     predicates: p_brand != 'Brand#45', NOT p_type LIKE 'MEDIUM POLISHED%', p_size IN (49, 14, 23, 45, 19, 3, 36, 9)
+|     predicates: p_size IN (49, 14, 23, 45, 19, 3, 36, 9), p_brand != 'Brand#45', NOT p_type LIKE 'MEDIUM POLISHED%'
 |
 00:SCAN HDFS [tpch.partsupp]
    partitions=1/1 files=1 size=112.71MB
@@ -1915,7 +1915,7 @@ where
 |  |
 |  |--01:SCAN HDFS [tpch.part]
 |  |     partitions=1/1 files=1 size=22.83MB
-|  |     predicates: p_brand = 'Brand#23', p_container = 'MED BOX'
+|  |     predicates: p_container = 'MED BOX', p_brand = 'Brand#23'
 |  |
 |  00:SCAN HDFS [tpch.lineitem]
 |     partitions=1/1 files=1 size=718.94MB
@@ -1952,7 +1952,7 @@ where
 |  |  |
 |  |  01:SCAN HDFS [tpch.part]
 |  |     partitions=1/1 files=1 size=22.83MB
-|  |     predicates: p_brand = 'Brand#23', p_container = 'MED BOX'
+|  |     predicates: p_container = 'MED BOX', p_brand = 'Brand#23'
 |  |
 |  00:SCAN HDFS [tpch.lineitem]
 |     partitions=1/1 files=1 size=718.94MB

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/8c2bf976/testdata/workloads/functional-planner/queries/PlannerTest/tpch-nested.test
----------------------------------------------------------------------
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpch-nested.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpch-nested.test
index cb5a4ac..c149d25 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpch-nested.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpch-nested.test
@@ -121,7 +121,7 @@ limit 100
 |  |  |
 |  |  16:SCAN HDFS [tpch_nested_parquet.region r]
 |  |     partitions=1/1 files=1 size=4.18KB
-|  |     predicates: !empty(r.r_nations), r_name = 'EUROPE'
+|  |     predicates: r_name = 'EUROPE', !empty(r.r_nations)
 |  |
 |  12:SUBPLAN
 |  |
@@ -150,7 +150,7 @@ limit 100
 |  |
 |  06:SCAN HDFS [tpch_nested_parquet.region r]
 |     partitions=1/1 files=1 size=4.18KB
-|     predicates: !empty(r.r_nations), r_name = 'EUROPE'
+|     predicates: r_name = 'EUROPE', !empty(r.r_nations)
 |
 23:HASH JOIN [INNER JOIN]
 |  hash predicates: ps_partkey = p_partkey
@@ -212,7 +212,7 @@ limit 100
 |  |  |
 |  |  16:SCAN HDFS [tpch_nested_parquet.region r]
 |  |     partitions=1/1 files=1 size=4.18KB
-|  |     predicates: !empty(r.r_nations), r_name = 'EUROPE'
+|  |     predicates: r_name = 'EUROPE', !empty(r.r_nations)
 |  |
 |  12:SUBPLAN
 |  |
@@ -243,7 +243,7 @@ limit 100
 |  |
 |  06:SCAN HDFS [tpch_nested_parquet.region r]
 |     partitions=1/1 files=1 size=4.18KB
-|     predicates: !empty(r.r_nations), r_name = 'EUROPE'
+|     predicates: r_name = 'EUROPE', !empty(r.r_nations)
 |
 23:HASH JOIN [INNER JOIN, BROADCAST]
 |  hash predicates: ps_partkey = p_partkey
@@ -317,7 +317,7 @@ limit 10
 |
 00:SCAN HDFS [tpch_nested_parquet.customer c]
    partitions=1/1 files=4 size=554.13MB
-   predicates: !empty(c.c_orders), c_mktsegment = 'BUILDING'
+   predicates: c_mktsegment = 'BUILDING', !empty(c.c_orders)
    predicates on o: !empty(o.o_lineitems), o_orderdate < '1995-03-15'
    predicates on l: l_shipdate > '1995-03-15'
 ---- DISTRIBUTEDPLAN
@@ -356,7 +356,7 @@ limit 10
 |
 00:SCAN HDFS [tpch_nested_parquet.customer c]
    partitions=1/1 files=4 size=554.13MB
-   predicates: !empty(c.c_orders), c_mktsegment = 'BUILDING'
+   predicates: c_mktsegment = 'BUILDING', !empty(c.c_orders)
    predicates on o: !empty(o.o_lineitems), o_orderdate < '1995-03-15'
    predicates on l: l_shipdate > '1995-03-15'
 ====
@@ -496,7 +496,7 @@ order by
 |  |
 |  10:SCAN HDFS [tpch_nested_parquet.region r]
 |     partitions=1/1 files=1 size=4.18KB
-|     predicates: !empty(r.r_nations), r_name = 'ASIA'
+|     predicates: r_name = 'ASIA', !empty(r.r_nations)
 |
 15:HASH JOIN [INNER JOIN]
 |  hash predicates: l_suppkey = s_suppkey, c_nationkey = s_nationkey
@@ -559,7 +559,7 @@ order by
 |  |
 |  10:SCAN HDFS [tpch_nested_parquet.region r]
 |     partitions=1/1 files=1 size=4.18KB
-|     predicates: !empty(r.r_nations), r_name = 'ASIA'
+|     predicates: r_name = 'ASIA', !empty(r.r_nations)
 |
 15:HASH JOIN [INNER JOIN, BROADCAST]
 |  hash predicates: l_suppkey = s_suppkey, c_nationkey = s_nationkey
@@ -609,7 +609,7 @@ where
 |
 00:SCAN HDFS [tpch_nested_parquet.customer.c_orders.o_lineitems]
    partitions=1/1 files=4 size=554.13MB
-   predicates: l_shipdate >= '1994-01-01', l_shipdate < '1995-01-01', l_discount >= 0.05, l_discount <= 0.07, l_quantity < 24
+   predicates: l_discount >= 0.05, l_discount <= 0.07, l_quantity < 24, l_shipdate >= '1994-01-01', l_shipdate < '1995-01-01'
 ---- DISTRIBUTEDPLAN
 03:AGGREGATE [FINALIZE]
 |  output: sum:merge(l_extendedprice * l_discount)
@@ -621,7 +621,7 @@ where
 |
 00:SCAN HDFS [tpch_nested_parquet.customer.c_orders.o_lineitems]
    partitions=1/1 files=4 size=554.13MB
-   predicates: l_shipdate >= '1994-01-01', l_shipdate < '1995-01-01', l_discount >= 0.05, l_discount <= 0.07, l_quantity < 24
+   predicates: l_discount >= 0.05, l_discount <= 0.07, l_quantity < 24, l_shipdate >= '1994-01-01', l_shipdate < '1995-01-01'
 ====
 # TPCH-Q7
 # Q7 - Volume Shipping Query
@@ -846,7 +846,7 @@ order by
 |  |
 |  11:SCAN HDFS [tpch_nested_parquet.region r]
 |     partitions=1/1 files=1 size=4.18KB
-|     predicates: !empty(r.r_nations), r_name = 'AMERICA'
+|     predicates: r_name = 'AMERICA', !empty(r.r_nations)
 |
 18:HASH JOIN [INNER JOIN]
 |  hash predicates: l_partkey = p_partkey
@@ -925,7 +925,7 @@ order by
 |  |
 |  11:SCAN HDFS [tpch_nested_parquet.region r]
 |     partitions=1/1 files=1 size=4.18KB
-|     predicates: !empty(r.r_nations), r_name = 'AMERICA'
+|     predicates: r_name = 'AMERICA', !empty(r.r_nations)
 |
 18:HASH JOIN [INNER JOIN, BROADCAST]
 |  hash predicates: l_partkey = p_partkey
@@ -1776,7 +1776,7 @@ order by
 |
 |--05:SCAN HDFS [tpch_nested_parquet.part p]
 |     partitions=1/1 files=1 size=6.30MB
-|     predicates: p_brand != 'Brand#45', NOT p_type LIKE 'MEDIUM POLISHED%', p_size IN (49, 14, 23, 45, 19, 3, 36, 9)
+|     predicates: p_size IN (49, 14, 23, 45, 19, 3, 36, 9), p_brand != 'Brand#45', NOT p_type LIKE 'MEDIUM POLISHED%'
 |
 01:SUBPLAN
 |
@@ -1788,7 +1788,7 @@ order by
 |
 00:SCAN HDFS [tpch_nested_parquet.supplier s]
    partitions=1/1 files=1 size=111.08MB
-   predicates: !empty(s.s_partsupps), NOT s_comment LIKE '%Customer%Complaints%'
+   predicates: NOT s_comment LIKE '%Customer%Complaints%', !empty(s.s_partsupps)
 ---- DISTRIBUTEDPLAN
 13:MERGING-EXCHANGE [UNPARTITIONED]
 |  order by: count(s_suppkey) DESC, p_brand ASC, p_type ASC, p_size ASC
@@ -1815,7 +1815,7 @@ order by
 |  |
 |  05:SCAN HDFS [tpch_nested_parquet.part p]
 |     partitions=1/1 files=1 size=6.30MB
-|     predicates: p_brand != 'Brand#45', NOT p_type LIKE 'MEDIUM POLISHED%', p_size IN (49, 14, 23, 45, 19, 3, 36, 9)
+|     predicates: p_size IN (49, 14, 23, 45, 19, 3, 36, 9), p_brand != 'Brand#45', NOT p_type LIKE 'MEDIUM POLISHED%'
 |
 01:SUBPLAN
 |
@@ -1827,7 +1827,7 @@ order by
 |
 00:SCAN HDFS [tpch_nested_parquet.supplier s]
    partitions=1/1 files=1 size=111.08MB
-   predicates: !empty(s.s_partsupps), NOT s_comment LIKE '%Customer%Complaints%'
+   predicates: NOT s_comment LIKE '%Customer%Complaints%', !empty(s.s_partsupps)
 ====
 # TPCH-Q17
 # Q17 - Small-Quantity-Order Revenue Query
@@ -1870,7 +1870,7 @@ where
 |
 |--01:SCAN HDFS [tpch_nested_parquet.part p]
 |     partitions=1/1 files=1 size=6.30MB
-|     predicates: p_brand = 'Brand#23', p_container = 'MED BOX'
+|     predicates: p_container = 'MED BOX', p_brand = 'Brand#23'
 |
 00:SCAN HDFS [tpch_nested_parquet.customer.c_orders.o_lineitems l]
    partitions=1/1 files=4 size=554.13MB
@@ -1912,7 +1912,7 @@ where
 |  |
 |  01:SCAN HDFS [tpch_nested_parquet.part p]
 |     partitions=1/1 files=1 size=6.30MB
-|     predicates: p_brand = 'Brand#23', p_container = 'MED BOX'
+|     predicates: p_container = 'MED BOX', p_brand = 'Brand#23'
 |
 00:SCAN HDFS [tpch_nested_parquet.customer.c_orders.o_lineitems l]
    partitions=1/1 files=4 size=554.13MB

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/8c2bf976/testdata/workloads/functional-planner/queries/PlannerTest/union.test
----------------------------------------------------------------------
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/union.test b/testdata/workloads/functional-planner/queries/PlannerTest/union.test
index 4e417a6..ea10a30 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/union.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/union.test
@@ -2411,7 +2411,7 @@ where a + b < 100 and c > 20 and d > 50
 |
 |--02:SCAN HDFS [functional.alltypes]
 |     partitions=24/24 files=24 size=478.45KB
-|     predicates: functional.alltypes.tinyint_col + functional.alltypes.int_col < 100, functional.alltypes.smallint_col > 20, functional.alltypes.bigint_col > 50
+|     predicates: functional.alltypes.smallint_col > 20, functional.alltypes.bigint_col > 50, functional.alltypes.tinyint_col + functional.alltypes.int_col < 100
 |
 01:SCAN HDFS [functional.alltypestiny]
    partitions=4/4 files=4 size=460B

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/8c2bf976/testdata/workloads/targeted-perf/queries/conjunct_ordering.test
----------------------------------------------------------------------
diff --git a/testdata/workloads/targeted-perf/queries/conjunct_ordering.test b/testdata/workloads/targeted-perf/queries/conjunct_ordering.test
new file mode 100644
index 0000000..155aebe
--- /dev/null
+++ b/testdata/workloads/targeted-perf/queries/conjunct_ordering.test
@@ -0,0 +1,73 @@
+====
+---- QUERY: conjunct_ordering_1
+-- Description : A simple select with one expensive conjunct and one cheap conjunct.
+SELECT *
+FROM lineitem
+WHERE (l_shipdate < current_timestamp() - interval 1 day) AND l_orderkey = -1;
+====
+---- QUERY: conjunct_ordering_2
+-- Description: Based on TPCH-Q19
+SELECT sum(l_extendedprice * (1 - l_discount)) AS revenue
+FROM lineitem, part
+WHERE p_partkey = l_partkey
+  AND ((p_brand = 'Brand#12'
+      AND p_container IN ('SM CASE', 'SM BOX', 'SM PACK', 'SM PKG')
+      AND l_quantity >= 1 AND l_quantity <= 11
+      AND p_size BETWEEN 1 AND 5
+      AND l_shipmode IN ('AIR', 'AIR REG')
+      AND l_shipinstruct = 'DELIVER IN PERSON')
+    OR (p_brand = 'Brand#23'
+      AND p_container IN ('MED BAG', 'MED BOX', 'MED PKG', 'MED PACK')
+      AND l_quantity >= 10 AND l_quantity <= 20
+      AND p_size BETWEEN 1 AND 10
+      AND l_shipmode IN ('AIR', 'AIR REG')
+      AND l_shipinstruct = 'DELIVER IN PERSON')
+    OR (p_brand = 'Brand#34'
+      AND p_container IN ('LG CASE', 'LG BOX', 'LG PACK', 'LG PKG')
+      AND l_quantity >= 20 AND l_quantity <= 30
+      AND p_size BETWEEN 1 AND 15
+      AND l_shipmode IN ('AIR', 'AIR REG')
+      AND l_shipinstruct = 'DELIVER IN PERSON'))
+  AND (p_partkey = 0 OR l_partkey = 0)
+====
+---- QUERY: conjunct_ordering_3
+-- Description: Based on TPCDS-Q28
+SELECT avg(l_extendedprice), count(l_extendedprice), count(distinct l_extendedprice)
+FROM lineitem
+WHERE
+  (l_discount BETWEEN 0.2 AND 0.3
+    OR l_discount BETWEEN 0.4 AND 0.5
+    OR l_tax BETWEEN 0.1 AND 0.2
+    OR l_tax BETWEEN 0 AND 0.09)
+  AND l_extendedprice BETWEEN 100 AND 500
+====
+---- QUERY: conjunct_ordering_4
+-- Description: Based on TPCDS-Q41
+SELECT p_mfgr, count(*) as item_cnt
+FROM part
+WHERE ((p_type LIKE '%STEEL%'
+      AND p_size BETWEEN 10 AND 40
+      AND p_container IN ('LG BOX', 'LG BAG', 'LG CASE'))
+    OR (p_type LIKE '%COPPER%'
+      AND p_size BETWEEN 20 AND 50
+      AND p_container IN ('JUMBO BOX', 'JUMBO BAG', 'JUMBO CASE'))
+    OR (p_type LIKE '%TIN%'
+      AND p_size BETWEEN 0 AND 30
+      AND p_container IN ('MED BOX', 'MED BAG', 'MED CASE'))
+    OR (p_type LIKE '%BRASS%'
+      AND p_size BETWEEN 0 AND 20
+      AND p_container IN ('SMALL BOX', 'SMALL BAG', 'SMALL CASE')))
+  AND p_partkey = -1
+GROUP BY p_mfgr
+====
+---- QUERY: conjunct_ordering_5
+-- Description: Based on TPCDS-Q48
+SELECT sum(l_quantity)
+FROM orders, lineitem,
+  (SELECT * FROM customer WHERE c_comment LIKE c_comment AND c_nationkey IN (5, 20)) as v1
+WHERE l_orderkey = o_orderkey
+  AND (v1.c_custkey = o_custkey
+    AND (o_totalprice BETWEEN 1000 AND 2000
+      OR o_totalprice BETWEEN 3000 AND 4000
+      OR o_totalprice BETWEEN 5000 AND 6000))
+====