You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by vg...@apache.org on 2018/12/07 00:28:55 UTC

[3/3] hive git commit: HIVE-20988: Wrong results for group by queries with primary key on multiple columns (Vineet Garg, reviewed by Jesus Camacho Rodriguez)

HIVE-20988: Wrong results for group by queries with primary key on multiple columns (Vineet Garg, reviewed by Jesus Camacho Rodriguez)


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

Branch: refs/heads/master
Commit: 83d1fd23a22ee96dd2c464d67303eadf31194454
Parents: 9f2e8e6
Author: Vineet Garg <vg...@apache.org>
Authored: Thu Dec 6 16:28:16 2018 -0800
Committer: Vineet Garg <vg...@apache.org>
Committed: Thu Dec 6 16:28:16 2018 -0800

----------------------------------------------------------------------
 .../ql/optimizer/calcite/RelOptHiveTable.java   |   2 +-
 .../clientpositive/constraints_optimization.q   |   7 +
 .../llap/constraints_optimization.q.out         |  63 +++
 .../llap/materialized_view_rewrite_1.q.out      |  12 +-
 .../perf/tez/constraints/cbo_query16.q.out      |   5 +-
 .../perf/tez/constraints/cbo_query23.q.out      |  72 +--
 .../perf/tez/constraints/cbo_query39.q.out      |  20 +-
 .../perf/tez/constraints/cbo_query94.q.out      |   5 +-
 .../perf/tez/constraints/cbo_query95.q.out      |  24 +-
 .../perf/tez/constraints/query16.q.out          | 130 +++---
 .../perf/tez/constraints/query23.q.out          | 451 ++++++++++---------
 .../perf/tez/constraints/query39.q.out          | 126 +++---
 .../perf/tez/constraints/query94.q.out          | 130 +++---
 .../perf/tez/constraints/query95.q.out          | 345 ++++++++------
 14 files changed, 773 insertions(+), 619 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/83d1fd23/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/RelOptHiveTable.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/RelOptHiveTable.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/RelOptHiveTable.java
index fc9178f..995ff9b 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/RelOptHiveTable.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/RelOptHiveTable.java
@@ -222,7 +222,7 @@ public class RelOptHiveTable implements RelOptTable {
   // Given a key this method returns true if all of the columns in the key are not nullable
   public boolean isNonNullableKey(ImmutableBitSet columns) {
     for (ImmutableBitSet key : nonNullablekeys) {
-      if (key.contains(columns)) {
+      if (columns.contains(key)) {
         return true;
       }
     }

http://git-wip-us.apache.org/repos/asf/hive/blob/83d1fd23/ql/src/test/queries/clientpositive/constraints_optimization.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/constraints_optimization.q b/ql/src/test/queries/clientpositive/constraints_optimization.q
index 3646e19..4f76442 100644
--- a/ql/src/test/queries/clientpositive/constraints_optimization.q
+++ b/ql/src/test/queries/clientpositive/constraints_optimization.q
@@ -428,3 +428,10 @@ GROUP BY
 ,	C_LOGIN
 ;
 
+create table web_sales(ws_order_number int, ws_item_sk int, ws_price float,
+    constraint pk1 primary key(ws_order_number, ws_item_sk) disable rely);
+insert into web_sales values(1, 1, 1.2);
+insert into web_sales values(1, 1, 1.2);
+ explain cbo select count(distinct ws_order_number) from web_sales;
+ select count(distinct ws_order_number) from web_sales;
+ drop table web_sales;

http://git-wip-us.apache.org/repos/asf/hive/blob/83d1fd23/ql/src/test/results/clientpositive/llap/constraints_optimization.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/constraints_optimization.q.out b/ql/src/test/results/clientpositive/llap/constraints_optimization.q.out
index bf60646..f7ed9f5 100644
--- a/ql/src/test/results/clientpositive/llap/constraints_optimization.q.out
+++ b/ql/src/test/results/clientpositive/llap/constraints_optimization.q.out
@@ -2742,3 +2742,66 @@ HiveAggregate(group=[{1}])
       HiveFilter(condition=[IS NOT NULL($3)])
         HiveTableScan(table=[[default, store_sales]], table:alias=[store_sales])
 
+PREHOOK: query: create table web_sales(ws_order_number int, ws_item_sk int, ws_price float,
+    constraint pk1 primary key(ws_order_number, ws_item_sk) disable rely)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@web_sales
+POSTHOOK: query: create table web_sales(ws_order_number int, ws_item_sk int, ws_price float,
+    constraint pk1 primary key(ws_order_number, ws_item_sk) disable rely)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@web_sales
+PREHOOK: query: insert into web_sales values(1, 1, 1.2)
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+PREHOOK: Output: default@web_sales
+POSTHOOK: query: insert into web_sales values(1, 1, 1.2)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+POSTHOOK: Output: default@web_sales
+POSTHOOK: Lineage: web_sales.ws_item_sk SCRIPT []
+POSTHOOK: Lineage: web_sales.ws_order_number SCRIPT []
+POSTHOOK: Lineage: web_sales.ws_price SCRIPT []
+PREHOOK: query: insert into web_sales values(1, 1, 1.2)
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+PREHOOK: Output: default@web_sales
+POSTHOOK: query: insert into web_sales values(1, 1, 1.2)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+POSTHOOK: Output: default@web_sales
+POSTHOOK: Lineage: web_sales.ws_item_sk SCRIPT []
+POSTHOOK: Lineage: web_sales.ws_order_number SCRIPT []
+POSTHOOK: Lineage: web_sales.ws_price SCRIPT []
+PREHOOK: query: explain cbo select count(distinct ws_order_number) from web_sales
+PREHOOK: type: QUERY
+PREHOOK: Input: default@web_sales
+#### A masked pattern was here ####
+POSTHOOK: query: explain cbo select count(distinct ws_order_number) from web_sales
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@web_sales
+#### A masked pattern was here ####
+CBO PLAN:
+HiveAggregate(group=[{}], agg#0=[count()])
+  HiveProject(ws_order_number=[$0])
+    HiveAggregate(group=[{0}])
+      HiveTableScan(table=[[default, web_sales]], table:alias=[web_sales])
+
+PREHOOK: query: select count(distinct ws_order_number) from web_sales
+PREHOOK: type: QUERY
+PREHOOK: Input: default@web_sales
+#### A masked pattern was here ####
+POSTHOOK: query: select count(distinct ws_order_number) from web_sales
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@web_sales
+#### A masked pattern was here ####
+1
+PREHOOK: query: drop table web_sales
+PREHOOK: type: DROPTABLE
+PREHOOK: Input: default@web_sales
+PREHOOK: Output: default@web_sales
+POSTHOOK: query: drop table web_sales
+POSTHOOK: type: DROPTABLE
+POSTHOOK: Input: default@web_sales
+POSTHOOK: Output: default@web_sales

http://git-wip-us.apache.org/repos/asf/hive/blob/83d1fd23/ql/src/test/results/clientpositive/llap/materialized_view_rewrite_1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/materialized_view_rewrite_1.q.out b/ql/src/test/results/clientpositive/llap/materialized_view_rewrite_1.q.out
index a7a1a0b..735a4db 100644
--- a/ql/src/test/results/clientpositive/llap/materialized_view_rewrite_1.q.out
+++ b/ql/src/test/results/clientpositive/llap/materialized_view_rewrite_1.q.out
@@ -641,13 +641,11 @@ PREHOOK: query: explain
 select empid, deptno from emps_n3 group by empid, deptno
 PREHOOK: type: QUERY
 PREHOOK: Input: default@emps_n3
-PREHOOK: Input: default@mv1_n2
 #### A masked pattern was here ####
 POSTHOOK: query: explain
 select empid, deptno from emps_n3 group by empid, deptno
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@emps_n3
-POSTHOOK: Input: default@mv1_n2
 #### A masked pattern was here ####
 STAGE DEPENDENCIES:
   Stage-0 is a root stage
@@ -658,7 +656,7 @@ STAGE PLANS:
       limit: -1
       Processor Tree:
         TableScan
-          alias: default.mv1_n2
+          alias: emps_n3
           Select Operator
             expressions: empid (type: int), deptno (type: int)
             outputColumnNames: _col0, _col1
@@ -667,12 +665,10 @@ STAGE PLANS:
 PREHOOK: query: select empid, deptno from emps_n3 group by empid, deptno
 PREHOOK: type: QUERY
 PREHOOK: Input: default@emps_n3
-PREHOOK: Input: default@mv1_n2
 #### A masked pattern was here ####
 POSTHOOK: query: select empid, deptno from emps_n3 group by empid, deptno
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@emps_n3
-POSTHOOK: Input: default@mv1_n2
 #### A masked pattern was here ####
 100	10
 110	10
@@ -713,13 +709,11 @@ PREHOOK: query: explain
 select empid, name from emps_n3 group by empid, name
 PREHOOK: type: QUERY
 PREHOOK: Input: default@emps_n3
-PREHOOK: Input: default@mv1_n2
 #### A masked pattern was here ####
 POSTHOOK: query: explain
 select empid, name from emps_n3 group by empid, name
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@emps_n3
-POSTHOOK: Input: default@mv1_n2
 #### A masked pattern was here ####
 STAGE DEPENDENCIES:
   Stage-0 is a root stage
@@ -730,7 +724,7 @@ STAGE PLANS:
       limit: -1
       Processor Tree:
         TableScan
-          alias: default.mv1_n2
+          alias: emps_n3
           Select Operator
             expressions: empid (type: int), name (type: varchar(256))
             outputColumnNames: _col0, _col1
@@ -739,12 +733,10 @@ STAGE PLANS:
 PREHOOK: query: select empid, name from emps_n3 group by empid, name
 PREHOOK: type: QUERY
 PREHOOK: Input: default@emps_n3
-PREHOOK: Input: default@mv1_n2
 #### A masked pattern was here ####
 POSTHOOK: query: select empid, name from emps_n3 group by empid, name
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@emps_n3
-POSTHOOK: Input: default@mv1_n2
 #### A masked pattern was here ####
 100	Bill
 110	Theodore

http://git-wip-us.apache.org/repos/asf/hive/blob/83d1fd23/ql/src/test/results/clientpositive/perf/tez/constraints/cbo_query16.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/cbo_query16.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/cbo_query16.q.out
index ddbf80a..251fd68 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/cbo_query16.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/cbo_query16.q.out
@@ -97,6 +97,7 @@ HiveProject(order count=[$0], total shipping cost=[$1], total net profit=[$2])
               HiveProject(cs_warehouse_sk=[$14], cs_order_number=[$17])
                 HiveFilter(condition=[IS NOT NULL($14)])
                   HiveTableScan(table=[[default, catalog_sales]], table:alias=[cs2])
-            HiveProject(cr_order_number0=[$16], $f1=[true])
-              HiveTableScan(table=[[default, catalog_returns]], table:alias=[cr1])
+            HiveProject(cr_order_number0=[$0], $f1=[true])
+              HiveAggregate(group=[{16}])
+                HiveTableScan(table=[[default, catalog_returns]], table:alias=[cr1])
 

http://git-wip-us.apache.org/repos/asf/hive/blob/83d1fd23/ql/src/test/results/clientpositive/perf/tez/constraints/cbo_query23.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/cbo_query23.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/cbo_query23.q.out
index 1d2e0df..e5b0d19 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/cbo_query23.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/cbo_query23.q.out
@@ -1,7 +1,7 @@
-Warning: Shuffle Join MERGEJOIN[437][tables = [$hdt$_1, $hdt$_2]] in Stage 'Reducer 19' is a cross product
-Warning: Shuffle Join MERGEJOIN[438][tables = [$hdt$_1, $hdt$_2, $hdt$_0]] in Stage 'Reducer 20' is a cross product
-Warning: Shuffle Join MERGEJOIN[440][tables = [$hdt$_2, $hdt$_3]] in Stage 'Reducer 23' is a cross product
-Warning: Shuffle Join MERGEJOIN[441][tables = [$hdt$_2, $hdt$_3, $hdt$_1]] in Stage 'Reducer 24' is a cross product
+Warning: Shuffle Join MERGEJOIN[443][tables = [$hdt$_1, $hdt$_2]] in Stage 'Reducer 19' is a cross product
+Warning: Shuffle Join MERGEJOIN[444][tables = [$hdt$_1, $hdt$_2, $hdt$_0]] in Stage 'Reducer 20' is a cross product
+Warning: Shuffle Join MERGEJOIN[446][tables = [$hdt$_1, $hdt$_2]] in Stage 'Reducer 23' is a cross product
+Warning: Shuffle Join MERGEJOIN[447][tables = [$hdt$_1, $hdt$_2, $hdt$_0]] in Stage 'Reducer 24' is a cross product
 PREHOOK: query: explain cbo
 with frequent_ss_items as 
  (select substr(i_item_desc,1,30) itemdesc,i_item_sk item_sk,d_date solddate,count(*) cnt
@@ -122,10 +122,10 @@ CBO PLAN:
 HiveSortLimit(fetch=[100])
   HiveProject($f0=[$0])
     HiveAggregate(group=[{}], agg#0=[sum($0)])
-      HiveProject(sales=[$0])
+      HiveProject($f0=[$0])
         HiveUnion(all=[true])
-          HiveProject(sales=[*(CAST($4):DECIMAL(10, 0), $5)])
-            HiveJoin(condition=[=($3, $7)], joinType=[inner], algorithm=[none], cost=[not available])
+          HiveProject($f0=[*(CAST($4):DECIMAL(10, 0), $5)])
+            HiveSemiJoin(condition=[=($3, $8)], joinType=[inner])
               HiveJoin(condition=[=($2, $0)], joinType=[inner], algorithm=[none], cost=[not available])
                 HiveProject($f0=[$0])
                   HiveJoin(condition=[>($1, *(0.95, $3))], joinType=[inner], algorithm=[none], cost=[not available])
@@ -169,34 +169,22 @@ HiveSortLimit(fetch=[100])
                   HiveProject(d_date_sk=[$0])
                     HiveFilter(condition=[AND(=($6, 1999), =($8, 1))])
                       HiveTableScan(table=[[default, date_dim]], table:alias=[date_dim])
-              HiveProject(item_sk=[$0])
-                HiveFilter(condition=[>($1, 4)])
-                  HiveAggregate(group=[{4}], agg#0=[count()])
-                    HiveJoin(condition=[=($1, $4)], joinType=[inner], algorithm=[none], cost=[not available])
-                      HiveJoin(condition=[=($0, $2)], joinType=[inner], algorithm=[none], cost=[not available])
-                        HiveProject(ss_sold_date_sk=[$0], ss_item_sk=[$2])
-                          HiveFilter(condition=[IS NOT NULL($0)])
-                            HiveTableScan(table=[[default, store_sales]], table:alias=[store_sales])
-                        HiveProject(d_date_sk=[$0], d_date=[$2])
-                          HiveFilter(condition=[IN($6, 1999, 2000, 2001, 2002)])
-                            HiveTableScan(table=[[default, date_dim]], table:alias=[date_dim])
-                      HiveProject(i_item_sk=[$0], substr=[substr($4, 1, 30)])
-                        HiveTableScan(table=[[default, item]], table:alias=[item])
-          HiveProject(sales=[*(CAST($5):DECIMAL(10, 0), $6)])
-            HiveJoin(condition=[=($3, $0)], joinType=[inner], algorithm=[none], cost=[not available])
-              HiveProject(item_sk=[$0])
-                HiveFilter(condition=[>($1, 4)])
-                  HiveAggregate(group=[{4}], agg#0=[count()])
-                    HiveJoin(condition=[=($1, $4)], joinType=[inner], algorithm=[none], cost=[not available])
-                      HiveJoin(condition=[=($0, $2)], joinType=[inner], algorithm=[none], cost=[not available])
-                        HiveProject(ss_sold_date_sk=[$0], ss_item_sk=[$2])
-                          HiveFilter(condition=[IS NOT NULL($0)])
-                            HiveTableScan(table=[[default, store_sales]], table:alias=[store_sales])
-                        HiveProject(d_date_sk=[$0], d_date=[$2])
-                          HiveFilter(condition=[IN($6, 1999, 2000, 2001, 2002)])
-                            HiveTableScan(table=[[default, date_dim]], table:alias=[date_dim])
-                      HiveProject(i_item_sk=[$0], substr=[substr($4, 1, 30)])
-                        HiveTableScan(table=[[default, item]], table:alias=[item])
+              HiveProject(substr=[$0], i_item_sk=[$1], d_date=[$2], $f3=[$3])
+                HiveFilter(condition=[>($3, 4)])
+                  HiveProject(substr=[$2], i_item_sk=[$1], d_date=[$0], $f3=[$3])
+                    HiveAggregate(group=[{3, 4, 5}], agg#0=[count()])
+                      HiveJoin(condition=[=($1, $4)], joinType=[inner], algorithm=[none], cost=[not available])
+                        HiveJoin(condition=[=($0, $2)], joinType=[inner], algorithm=[none], cost=[not available])
+                          HiveProject(ss_sold_date_sk=[$0], ss_item_sk=[$2])
+                            HiveFilter(condition=[IS NOT NULL($0)])
+                              HiveTableScan(table=[[default, store_sales]], table:alias=[store_sales])
+                          HiveProject(d_date_sk=[$0], d_date=[$2])
+                            HiveFilter(condition=[IN($6, 1999, 2000, 2001, 2002)])
+                              HiveTableScan(table=[[default, date_dim]], table:alias=[date_dim])
+                        HiveProject(i_item_sk=[$0], substr=[substr($4, 1, 30)])
+                          HiveTableScan(table=[[default, item]], table:alias=[item])
+          HiveProject($f0=[*(CAST($4):DECIMAL(10, 0), $5)])
+            HiveSemiJoin(condition=[=($2, $8)], joinType=[inner])
               HiveJoin(condition=[=($3, $0)], joinType=[inner], algorithm=[none], cost=[not available])
                 HiveProject($f0=[$0])
                   HiveJoin(condition=[>($1, *(0.95, $3))], joinType=[inner], algorithm=[none], cost=[not available])
@@ -240,4 +228,18 @@ HiveSortLimit(fetch=[100])
                   HiveProject(d_date_sk=[$0])
                     HiveFilter(condition=[AND(=($6, 1999), =($8, 1))])
                       HiveTableScan(table=[[default, date_dim]], table:alias=[date_dim])
+              HiveProject(substr=[$0], i_item_sk=[$1], d_date=[$2], $f3=[$3])
+                HiveFilter(condition=[>($3, 4)])
+                  HiveProject(substr=[$2], i_item_sk=[$1], d_date=[$0], $f3=[$3])
+                    HiveAggregate(group=[{3, 4, 5}], agg#0=[count()])
+                      HiveJoin(condition=[=($1, $4)], joinType=[inner], algorithm=[none], cost=[not available])
+                        HiveJoin(condition=[=($0, $2)], joinType=[inner], algorithm=[none], cost=[not available])
+                          HiveProject(ss_sold_date_sk=[$0], ss_item_sk=[$2])
+                            HiveFilter(condition=[IS NOT NULL($0)])
+                              HiveTableScan(table=[[default, store_sales]], table:alias=[store_sales])
+                          HiveProject(d_date_sk=[$0], d_date=[$2])
+                            HiveFilter(condition=[IN($6, 1999, 2000, 2001, 2002)])
+                              HiveTableScan(table=[[default, date_dim]], table:alias=[date_dim])
+                        HiveProject(i_item_sk=[$0], substr=[substr($4, 1, 30)])
+                          HiveTableScan(table=[[default, item]], table:alias=[item])
 

http://git-wip-us.apache.org/repos/asf/hive/blob/83d1fd23/ql/src/test/results/clientpositive/perf/tez/constraints/cbo_query39.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/cbo_query39.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/cbo_query39.q.out
index 272bedc..88ffbbe 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/cbo_query39.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/cbo_query39.q.out
@@ -63,31 +63,31 @@ POSTHOOK: Output: hdfs://### HDFS PATH ###
 CBO PLAN:
 HiveProject(w_warehouse_sk=[$0], i_item_sk=[$1], d_moy=[CAST(4):INTEGER], mean=[$2], cov=[$3], w_warehouse_sk1=[$4], i_item_sk1=[$5], d_moy1=[CAST(5):INTEGER], mean1=[$6], cov1=[$7])
   HiveSortLimit(sort0=[$0], sort1=[$1], sort2=[$2], sort3=[$3], sort4=[$6], sort5=[$7], dir0=[ASC], dir1=[ASC], dir2=[ASC], dir3=[ASC], dir4=[ASC], dir5=[ASC])
-    HiveProject(w_warehouse_sk=[$0], i_item_sk=[$1], mean=[$6], cov=[$7], w_warehouse_sk0=[$0], i_item_sk0=[$1], mean0=[$2], cov0=[$3])
-      HiveJoin(condition=[AND(=($5, $1), =($4, $0))], joinType=[inner], algorithm=[none], cost=[not available])
-        HiveProject(w_warehouse_sk=[$0], i_item_sk=[$1], mean=[/(CAST($5):DOUBLE, $4)], cov=[CASE(=(/(CAST($5):DOUBLE, $4), 0), null, /(POWER(/(-($2, /(*($3, $3), $4)), CASE(=($4, 1), null, -($4, 1))), 0.5), /(CAST($5):DOUBLE, $4)))])
-          HiveFilter(condition=[CASE(=(/(CAST($5):DOUBLE, $4), 0), false, >(/(POWER(/(-($2, /(*($3, $3), $4)), CASE(=($4, 1), null, -($4, 1))), 0.5), /(CAST($5):DOUBLE, $4)), 1))])
-            HiveAggregate(group=[{1, 2}], agg#0=[sum($5)], agg#1=[sum($4)], agg#2=[count($3)], agg#3=[sum($3)])
+    HiveProject(w_warehouse_sk=[$0], i_item_sk=[$1], mean=[$2], cov=[$3], w_warehouse_sk0=[$4], i_item_sk0=[$5], mean0=[$6], cov0=[$7])
+      HiveJoin(condition=[AND(=($1, $5), =($0, $4))], joinType=[inner], algorithm=[none], cost=[not available])
+        HiveProject(w_warehouse_sk=[$1], i_item_sk=[$2], mean=[/(CAST($6):DOUBLE, $5)], cov=[CASE(=(/(CAST($6):DOUBLE, $5), 0), null, /(POWER(/(-($3, /(*($4, $4), $5)), CASE(=($5, 1), null, -($5, 1))), 0.5), /(CAST($6):DOUBLE, $5)))])
+          HiveFilter(condition=[CASE(=(/(CAST($6):DOUBLE, $5), 0), false, >(/(POWER(/(-($3, /(*($4, $4), $5)), CASE(=($5, 1), null, -($5, 1))), 0.5), /(CAST($6):DOUBLE, $5)), 1))])
+            HiveAggregate(group=[{0, 1, 2}], agg#0=[sum($5)], agg#1=[sum($4)], agg#2=[count($3)], agg#3=[sum($3)])
               HiveProject($f0=[$6], $f1=[$5], $f2=[$3], $f4=[$2], $f40=[CAST($2):DOUBLE], $f6=[*(CAST($2):DOUBLE, CAST($2):DOUBLE)])
                 HiveJoin(condition=[=($1, $5)], joinType=[inner], algorithm=[none], cost=[not available])
                   HiveJoin(condition=[=($0, $4)], joinType=[inner], algorithm=[none], cost=[not available])
                     HiveProject(inv_date_sk=[$0], inv_warehouse_sk=[$2], inv_quantity_on_hand=[$3], inv_item_sk=[$1])
                       HiveTableScan(table=[[default, inventory]], table:alias=[inventory])
                     HiveProject(d_date_sk=[$0])
-                      HiveFilter(condition=[AND(=($6, 1999), =($8, 5))])
+                      HiveFilter(condition=[AND(=($6, 1999), =($8, 4))])
                         HiveTableScan(table=[[default, date_dim]], table:alias=[date_dim])
                   HiveProject(w_warehouse_sk=[$0], w_warehouse_name=[$2])
                     HiveTableScan(table=[[default, warehouse]], table:alias=[warehouse])
-        HiveProject(w_warehouse_sk=[$0], i_item_sk=[$1], mean=[/(CAST($5):DOUBLE, $4)], cov=[CASE(=(/(CAST($5):DOUBLE, $4), 0), null, /(POWER(/(-($2, /(*($3, $3), $4)), CASE(=($4, 1), null, -($4, 1))), 0.5), /(CAST($5):DOUBLE, $4)))])
-          HiveFilter(condition=[CASE(=(/(CAST($5):DOUBLE, $4), 0), false, >(/(POWER(/(-($2, /(*($3, $3), $4)), CASE(=($4, 1), null, -($4, 1))), 0.5), /(CAST($5):DOUBLE, $4)), 1))])
-            HiveAggregate(group=[{1, 2}], agg#0=[sum($5)], agg#1=[sum($4)], agg#2=[count($3)], agg#3=[sum($3)])
+        HiveProject(w_warehouse_sk=[$1], i_item_sk=[$2], mean=[/(CAST($6):DOUBLE, $5)], cov=[CASE(=(/(CAST($6):DOUBLE, $5), 0), null, /(POWER(/(-($3, /(*($4, $4), $5)), CASE(=($5, 1), null, -($5, 1))), 0.5), /(CAST($6):DOUBLE, $5)))])
+          HiveFilter(condition=[CASE(=(/(CAST($6):DOUBLE, $5), 0), false, >(/(POWER(/(-($3, /(*($4, $4), $5)), CASE(=($5, 1), null, -($5, 1))), 0.5), /(CAST($6):DOUBLE, $5)), 1))])
+            HiveAggregate(group=[{0, 1, 2}], agg#0=[sum($5)], agg#1=[sum($4)], agg#2=[count($3)], agg#3=[sum($3)])
               HiveProject($f0=[$6], $f1=[$5], $f2=[$3], $f4=[$2], $f40=[CAST($2):DOUBLE], $f6=[*(CAST($2):DOUBLE, CAST($2):DOUBLE)])
                 HiveJoin(condition=[=($1, $5)], joinType=[inner], algorithm=[none], cost=[not available])
                   HiveJoin(condition=[=($0, $4)], joinType=[inner], algorithm=[none], cost=[not available])
                     HiveProject(inv_date_sk=[$0], inv_warehouse_sk=[$2], inv_quantity_on_hand=[$3], inv_item_sk=[$1])
                       HiveTableScan(table=[[default, inventory]], table:alias=[inventory])
                     HiveProject(d_date_sk=[$0])
-                      HiveFilter(condition=[AND(=($6, 1999), =($8, 4))])
+                      HiveFilter(condition=[AND(=($6, 1999), =($8, 5))])
                         HiveTableScan(table=[[default, date_dim]], table:alias=[date_dim])
                   HiveProject(w_warehouse_sk=[$0], w_warehouse_name=[$2])
                     HiveTableScan(table=[[default, warehouse]], table:alias=[warehouse])

http://git-wip-us.apache.org/repos/asf/hive/blob/83d1fd23/ql/src/test/results/clientpositive/perf/tez/constraints/cbo_query94.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/cbo_query94.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/cbo_query94.q.out
index 198778f..19c5312 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/cbo_query94.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/cbo_query94.q.out
@@ -93,6 +93,7 @@ HiveProject(order count=[$0], total shipping cost=[$1], total net profit=[$2])
               HiveProject(ws_warehouse_sk=[$15], ws_order_number=[$17])
                 HiveFilter(condition=[IS NOT NULL($15)])
                   HiveTableScan(table=[[default, web_sales]], table:alias=[ws2])
-            HiveProject(wr_order_number0=[$13], $f1=[true])
-              HiveTableScan(table=[[default, web_returns]], table:alias=[wr1])
+            HiveProject(wr_order_number0=[$0], $f1=[true])
+              HiveAggregate(group=[{13}])
+                HiveTableScan(table=[[default, web_returns]], table:alias=[wr1])
 

http://git-wip-us.apache.org/repos/asf/hive/blob/83d1fd23/ql/src/test/results/clientpositive/perf/tez/constraints/cbo_query95.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/cbo_query95.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/cbo_query95.q.out
index 0546f1c..526dafb 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/cbo_query95.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/cbo_query95.q.out
@@ -78,22 +78,24 @@ HiveProject(order count=[$0], total shipping cost=[$1], total net profit=[$2])
     HiveProject(order count=[$0], total shipping cost=[$1], total net profit=[$2], (tok_functiondi count (tok_table_or_col ws_order_number))=[$0])
       HiveAggregate(group=[{}], agg#0=[count(DISTINCT $6)], agg#1=[sum($7)], agg#2=[sum($8)])
         HiveJoin(condition=[=($6, $0)], joinType=[inner], algorithm=[none], cost=[not available])
-          HiveProject(wr_order_number=[$14])
-            HiveJoin(condition=[=($14, $0)], joinType=[inner], algorithm=[none], cost=[not available])
-              HiveProject(ws_order_number=[$1])
+          HiveProject(wr_order_number=[$0])
+            HiveAggregate(group=[{14}])
+              HiveJoin(condition=[=($14, $0)], joinType=[inner], algorithm=[none], cost=[not available])
+                HiveProject(ws_order_number=[$1])
+                  HiveJoin(condition=[AND(=($1, $3), <>($0, $2))], joinType=[inner], algorithm=[none], cost=[not available])
+                    HiveProject(ws_warehouse_sk=[$15], ws_order_number=[$17])
+                      HiveTableScan(table=[[default, web_sales]], table:alias=[ws1])
+                    HiveProject(ws_warehouse_sk=[$15], ws_order_number=[$17])
+                      HiveTableScan(table=[[default, web_sales]], table:alias=[ws2])
+                HiveTableScan(table=[[default, web_returns]], table:alias=[web_returns])
+          HiveJoin(condition=[=($5, $0)], joinType=[inner], algorithm=[none], cost=[not available])
+            HiveProject(ws_order_number=[$0])
+              HiveAggregate(group=[{1}])
                 HiveJoin(condition=[AND(=($1, $3), <>($0, $2))], joinType=[inner], algorithm=[none], cost=[not available])
                   HiveProject(ws_warehouse_sk=[$15], ws_order_number=[$17])
                     HiveTableScan(table=[[default, web_sales]], table:alias=[ws1])
                   HiveProject(ws_warehouse_sk=[$15], ws_order_number=[$17])
                     HiveTableScan(table=[[default, web_sales]], table:alias=[ws2])
-              HiveTableScan(table=[[default, web_returns]], table:alias=[web_returns])
-          HiveJoin(condition=[=($5, $0)], joinType=[inner], algorithm=[none], cost=[not available])
-            HiveProject(ws_order_number=[$1])
-              HiveJoin(condition=[AND(=($1, $3), <>($0, $2))], joinType=[inner], algorithm=[none], cost=[not available])
-                HiveProject(ws_warehouse_sk=[$15], ws_order_number=[$17])
-                  HiveTableScan(table=[[default, web_sales]], table:alias=[ws1])
-                HiveProject(ws_warehouse_sk=[$15], ws_order_number=[$17])
-                  HiveTableScan(table=[[default, web_sales]], table:alias=[ws2])
             HiveJoin(condition=[=($3, $9)], joinType=[inner], algorithm=[none], cost=[not available])
               HiveJoin(condition=[=($2, $0)], joinType=[inner], algorithm=[none], cost=[not available])
                 HiveProject(ca_address_sk=[$0])

http://git-wip-us.apache.org/repos/asf/hive/blob/83d1fd23/ql/src/test/results/clientpositive/perf/tez/constraints/query16.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query16.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query16.q.out
index d094847..3c63887 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query16.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query16.q.out
@@ -77,11 +77,12 @@ Map 1 <- Reducer 13 (BROADCAST_EDGE)
 Map 15 <- Reducer 10 (BROADCAST_EDGE)
 Reducer 10 <- Reducer 4 (CUSTOM_SIMPLE_EDGE)
 Reducer 13 <- Map 12 (CUSTOM_SIMPLE_EDGE)
+Reducer 17 <- Map 16 (SIMPLE_EDGE)
 Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 11 (SIMPLE_EDGE)
 Reducer 3 <- Map 12 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
 Reducer 4 <- Map 14 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
 Reducer 5 <- Map 15 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE)
-Reducer 6 <- Map 16 (SIMPLE_EDGE), Reducer 5 (ONE_TO_ONE_EDGE)
+Reducer 6 <- Reducer 17 (ONE_TO_ONE_EDGE), Reducer 5 (ONE_TO_ONE_EDGE)
 Reducer 7 <- Reducer 6 (SIMPLE_EDGE)
 Reducer 8 <- Reducer 7 (CUSTOM_SIMPLE_EDGE)
 Reducer 9 <- Reducer 8 (SIMPLE_EDGE)
@@ -91,130 +92,137 @@ Stage-0
     limit:-1
     Stage-1
       Reducer 9 vectorized
-      File Output Operator [FS_159]
-        Limit [LIM_158] (rows=1 width=240)
+      File Output Operator [FS_166]
+        Limit [LIM_165] (rows=1 width=240)
           Number of rows:100
-          Select Operator [SEL_157] (rows=1 width=240)
+          Select Operator [SEL_164] (rows=1 width=240)
             Output:["_col0","_col1","_col2"]
           <-Reducer 8 [SIMPLE_EDGE] vectorized
-            SHUFFLE [RS_156]
-              Select Operator [SEL_155] (rows=1 width=240)
+            SHUFFLE [RS_163]
+              Select Operator [SEL_162] (rows=1 width=240)
                 Output:["_col1","_col2","_col3"]
-                Group By Operator [GBY_154] (rows=1 width=232)
+                Group By Operator [GBY_161] (rows=1 width=232)
                   Output:["_col0","_col1","_col2"],aggregations:["count(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)"]
                 <-Reducer 7 [CUSTOM_SIMPLE_EDGE] vectorized
-                  PARTITION_ONLY_SHUFFLE [RS_153]
-                    Group By Operator [GBY_152] (rows=1 width=232)
+                  PARTITION_ONLY_SHUFFLE [RS_160]
+                    Group By Operator [GBY_159] (rows=1 width=232)
                       Output:["_col0","_col1","_col2"],aggregations:["count(_col0)","sum(_col1)","sum(_col2)"]
-                      Group By Operator [GBY_151] (rows=5150256 width=228)
+                      Group By Operator [GBY_158] (rows=5150256 width=228)
                         Output:["_col0","_col1","_col2"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)"],keys:KEY._col0
                       <-Reducer 6 [SIMPLE_EDGE]
-                        SHUFFLE [RS_69]
+                        SHUFFLE [RS_73]
                           PartitionCols:_col0
-                          Group By Operator [GBY_68] (rows=5150256 width=228)
+                          Group By Operator [GBY_72] (rows=5150256 width=228)
                             Output:["_col0","_col2","_col3"],aggregations:["sum(_col5)","sum(_col6)"],keys:_col4
-                            Select Operator [SEL_37] (rows=5150256 width=218)
+                            Select Operator [SEL_41] (rows=5150256 width=214)
                               Output:["_col4","_col5","_col6"]
-                              Filter Operator [FIL_36] (rows=5150256 width=218)
+                              Filter Operator [FIL_40] (rows=5150256 width=214)
                                 predicate:_col14 is null
-                                Merge Join Operator [MERGEJOIN_125] (rows=13282454 width=218)
-                                  Conds:RS_33._col4=RS_150._col0(Left Outer),Output:["_col4","_col5","_col6","_col14"]
-                                <-Map 16 [SIMPLE_EDGE] vectorized
-                                  SHUFFLE [RS_150]
+                                Merge Join Operator [MERGEJOIN_129] (rows=10300512 width=214)
+                                  Conds:RS_37._col4=RS_157._col0(Left Outer),Output:["_col4","_col5","_col6","_col14"]
+                                <-Reducer 17 [ONE_TO_ONE_EDGE] vectorized
+                                  FORWARD [RS_157]
                                     PartitionCols:_col0
-                                    Select Operator [SEL_149] (rows=28798881 width=8)
+                                    Select Operator [SEL_156] (rows=18238808 width=8)
                                       Output:["_col0","_col1"]
-                                      TableScan [TS_25] (rows=28798881 width=4)
-                                        default@catalog_returns,cr1,Tbl:COMPLETE,Col:COMPLETE,Output:["cr_order_number"]
+                                      Group By Operator [GBY_155] (rows=18238808 width=4)
+                                        Output:["_col0"],keys:KEY._col0
+                                      <-Map 16 [SIMPLE_EDGE] vectorized
+                                        SHUFFLE [RS_154]
+                                          PartitionCols:_col0
+                                          Group By Operator [GBY_153] (rows=28798881 width=4)
+                                            Output:["_col0"],keys:cr_order_number
+                                            TableScan [TS_25] (rows=28798881 width=4)
+                                              default@catalog_returns,cr1,Tbl:COMPLETE,Col:COMPLETE,Output:["cr_order_number"]
                                 <-Reducer 5 [ONE_TO_ONE_EDGE]
-                                  FORWARD [RS_33]
+                                  FORWARD [RS_37]
                                     PartitionCols:_col4
-                                    Select Operator [SEL_32] (rows=5150256 width=200)
+                                    Select Operator [SEL_36] (rows=5150256 width=200)
                                       Output:["_col4","_col5","_col6"]
-                                      Merge Join Operator [MERGEJOIN_124] (rows=5150256 width=202)
-                                        Conds:RS_29._col4=RS_148._col0(Left Semi),Output:["_col3","_col4","_col5","_col6","_col14"],residual filter predicates:{(_col3 <> _col14)}
+                                      Merge Join Operator [MERGEJOIN_128] (rows=5150256 width=202)
+                                        Conds:RS_33._col4=RS_152._col0(Left Semi),Output:["_col3","_col4","_col5","_col6","_col14"],residual filter predicates:{(_col3 <> _col14)}
                                       <-Reducer 4 [SIMPLE_EDGE]
-                                        SHUFFLE [RS_29]
+                                        SHUFFLE [RS_33]
                                           PartitionCols:_col4
-                                          Merge Join Operator [MERGEJOIN_123] (rows=5150256 width=200)
-                                            Conds:RS_18._col2=RS_142._col0(Inner),Output:["_col3","_col4","_col5","_col6"]
+                                          Merge Join Operator [MERGEJOIN_127] (rows=5150256 width=200)
+                                            Conds:RS_18._col2=RS_146._col0(Inner),Output:["_col3","_col4","_col5","_col6"]
                                           <-Map 14 [SIMPLE_EDGE] vectorized
-                                            SHUFFLE [RS_142]
+                                            SHUFFLE [RS_146]
                                               PartitionCols:_col0
-                                              Select Operator [SEL_141] (rows=10 width=102)
+                                              Select Operator [SEL_145] (rows=10 width=102)
                                                 Output:["_col0"]
-                                                Filter Operator [FIL_140] (rows=10 width=102)
+                                                Filter Operator [FIL_144] (rows=10 width=102)
                                                   predicate:(cc_county) IN ('Ziebach County', 'Levy County', 'Huron County', 'Franklin Parish', 'Daviess County')
                                                   TableScan [TS_9] (rows=60 width=102)
                                                     default@call_center,call_center,Tbl:COMPLETE,Col:COMPLETE,Output:["cc_call_center_sk","cc_county"]
                                           <-Reducer 3 [SIMPLE_EDGE]
                                             SHUFFLE [RS_18]
                                               PartitionCols:_col2
-                                              Merge Join Operator [MERGEJOIN_122] (rows=30901534 width=230)
-                                                Conds:RS_15._col1=RS_128._col0(Inner),Output:["_col2","_col3","_col4","_col5","_col6"]
+                                              Merge Join Operator [MERGEJOIN_126] (rows=30901534 width=230)
+                                                Conds:RS_15._col1=RS_132._col0(Inner),Output:["_col2","_col3","_col4","_col5","_col6"]
                                               <-Map 12 [SIMPLE_EDGE] vectorized
-                                                SHUFFLE [RS_128]
+                                                SHUFFLE [RS_132]
                                                   PartitionCols:_col0
-                                                  Select Operator [SEL_127] (rows=784314 width=90)
+                                                  Select Operator [SEL_131] (rows=784314 width=90)
                                                     Output:["_col0"]
-                                                    Filter Operator [FIL_126] (rows=784314 width=90)
+                                                    Filter Operator [FIL_130] (rows=784314 width=90)
                                                       predicate:(ca_state = 'NY')
                                                       TableScan [TS_6] (rows=40000000 width=90)
                                                         default@customer_address,customer_address,Tbl:COMPLETE,Col:COMPLETE,Output:["ca_address_sk","ca_state"]
                                               <-Reducer 2 [SIMPLE_EDGE]
                                                 SHUFFLE [RS_15]
                                                   PartitionCols:_col1
-                                                  Merge Join Operator [MERGEJOIN_121] (rows=31519516 width=234)
-                                                    Conds:RS_136._col0=RS_139._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col5","_col6"]
+                                                  Merge Join Operator [MERGEJOIN_125] (rows=31519516 width=234)
+                                                    Conds:RS_140._col0=RS_143._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col5","_col6"]
                                                   <-Map 1 [SIMPLE_EDGE] vectorized
-                                                    SHUFFLE [RS_136]
+                                                    SHUFFLE [RS_140]
                                                       PartitionCols:_col0
-                                                      Select Operator [SEL_135] (rows=283695062 width=243)
+                                                      Select Operator [SEL_139] (rows=283695062 width=243)
                                                         Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
-                                                        Filter Operator [FIL_134] (rows=283695062 width=243)
+                                                        Filter Operator [FIL_138] (rows=283695062 width=243)
                                                           predicate:((cs_ship_addr_sk BETWEEN DynamicValue(RS_16_customer_address_ca_address_sk_min) AND DynamicValue(RS_16_customer_address_ca_address_sk_max) and in_bloom_filter(cs_ship_addr_sk, DynamicValue(RS_16_customer_address_ca_address_sk_bloom_filter))) and cs_call_center_sk is not null and cs_ship_addr_sk is not null and cs_ship_date_sk is not null)
                                                           TableScan [TS_0] (rows=287989836 width=243)
                                                             default@catalog_sales,cs1,Tbl:COMPLETE,Col:COMPLETE,Output:["cs_ship_date_sk","cs_ship_addr_sk","cs_call_center_sk","cs_warehouse_sk","cs_order_number","cs_ext_ship_cost","cs_net_profit"]
                                                           <-Reducer 13 [BROADCAST_EDGE] vectorized
-                                                            BROADCAST [RS_133]
-                                                              Group By Operator [GBY_132] (rows=1 width=12)
+                                                            BROADCAST [RS_137]
+                                                              Group By Operator [GBY_136] (rows=1 width=12)
                                                                 Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
                                                               <-Map 12 [CUSTOM_SIMPLE_EDGE] vectorized
-                                                                SHUFFLE [RS_131]
-                                                                  Group By Operator [GBY_130] (rows=1 width=12)
+                                                                SHUFFLE [RS_135]
+                                                                  Group By Operator [GBY_134] (rows=1 width=12)
                                                                     Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
-                                                                    Select Operator [SEL_129] (rows=784314 width=4)
+                                                                    Select Operator [SEL_133] (rows=784314 width=4)
                                                                       Output:["_col0"]
-                                                                       Please refer to the previous Select Operator [SEL_127]
+                                                                       Please refer to the previous Select Operator [SEL_131]
                                                   <-Map 11 [SIMPLE_EDGE] vectorized
-                                                    SHUFFLE [RS_139]
+                                                    SHUFFLE [RS_143]
                                                       PartitionCols:_col0
-                                                      Select Operator [SEL_138] (rows=8116 width=98)
+                                                      Select Operator [SEL_142] (rows=8116 width=98)
                                                         Output:["_col0"]
-                                                        Filter Operator [FIL_137] (rows=8116 width=98)
+                                                        Filter Operator [FIL_141] (rows=8116 width=98)
                                                           predicate:CAST( d_date AS TIMESTAMP) BETWEEN TIMESTAMP'2001-04-01 00:00:00' AND TIMESTAMP'2001-05-31 00:00:00'
                                                           TableScan [TS_3] (rows=73049 width=98)
                                                             default@date_dim,date_dim,Tbl:COMPLETE,Col:COMPLETE,Output:["d_date_sk","d_date"]
                                       <-Map 15 [SIMPLE_EDGE] vectorized
-                                        SHUFFLE [RS_148]
+                                        SHUFFLE [RS_152]
                                           PartitionCols:_col0
-                                          Group By Operator [GBY_147] (rows=286548719 width=7)
+                                          Group By Operator [GBY_151] (rows=286548719 width=7)
                                             Output:["_col0","_col1"],keys:_col0, _col1
-                                            Select Operator [SEL_146] (rows=286548719 width=7)
+                                            Select Operator [SEL_150] (rows=286548719 width=7)
                                               Output:["_col0","_col1"]
-                                              Filter Operator [FIL_145] (rows=286548719 width=7)
-                                                predicate:((cs_order_number BETWEEN DynamicValue(RS_29_cs1_cs_order_number_min) AND DynamicValue(RS_29_cs1_cs_order_number_max) and in_bloom_filter(cs_order_number, DynamicValue(RS_29_cs1_cs_order_number_bloom_filter))) and cs_warehouse_sk is not null)
+                                              Filter Operator [FIL_149] (rows=286548719 width=7)
+                                                predicate:((cs_order_number BETWEEN DynamicValue(RS_33_cs1_cs_order_number_min) AND DynamicValue(RS_33_cs1_cs_order_number_max) and in_bloom_filter(cs_order_number, DynamicValue(RS_33_cs1_cs_order_number_bloom_filter))) and cs_warehouse_sk is not null)
                                                 TableScan [TS_22] (rows=287989836 width=7)
                                                   default@catalog_sales,cs2,Tbl:COMPLETE,Col:COMPLETE,Output:["cs_warehouse_sk","cs_order_number"]
                                                 <-Reducer 10 [BROADCAST_EDGE] vectorized
-                                                  BROADCAST [RS_144]
-                                                    Group By Operator [GBY_143] (rows=1 width=12)
+                                                  BROADCAST [RS_148]
+                                                    Group By Operator [GBY_147] (rows=1 width=12)
                                                       Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
                                                     <-Reducer 4 [CUSTOM_SIMPLE_EDGE]
-                                                      SHUFFLE [RS_111]
-                                                        Group By Operator [GBY_110] (rows=1 width=12)
+                                                      SHUFFLE [RS_115]
+                                                        Group By Operator [GBY_114] (rows=1 width=12)
                                                           Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
-                                                          Select Operator [SEL_109] (rows=5150256 width=8)
+                                                          Select Operator [SEL_113] (rows=5150256 width=8)
                                                             Output:["_col0"]
-                                                             Please refer to the previous Merge Join Operator [MERGEJOIN_123]
+                                                             Please refer to the previous Merge Join Operator [MERGEJOIN_127]