You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by se...@apache.org on 2018/10/26 21:11:28 UTC

[18/75] [abbrv] [partial] hive git commit: HIVE-20718: Add perf cli driver with constraints (Jesus Camacho Rodriguez, reviewed by Ashutosh Chauhan)

http://git-wip-us.apache.org/repos/asf/hive/blob/b8299551/ql/src/test/results/clientpositive/perf/tez/constraints/query39.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query39.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query39.q.out
new file mode 100644
index 0000000..812928b
--- /dev/null
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query39.q.out
@@ -0,0 +1,236 @@
+PREHOOK: query: explain
+with inv as
+(select w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy
+       ,stdev,mean, case mean when 0 then null else stdev/mean end cov
+ from(select w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy
+            ,stddev_samp(inv_quantity_on_hand) stdev,avg(inv_quantity_on_hand) mean
+      from inventory
+          ,item
+          ,warehouse
+          ,date_dim
+      where inv_item_sk = i_item_sk
+        and inv_warehouse_sk = w_warehouse_sk
+        and inv_date_sk = d_date_sk
+        and d_year =1999
+      group by w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy) foo
+ where case mean when 0 then 0 else stdev/mean end > 1)
+select inv1.w_warehouse_sk,inv1.i_item_sk,inv1.d_moy,inv1.mean, inv1.cov
+        ,inv2.w_warehouse_sk,inv2.i_item_sk,inv2.d_moy,inv2.mean, inv2.cov
+from inv inv1,inv inv2
+where inv1.i_item_sk = inv2.i_item_sk
+  and inv1.w_warehouse_sk =  inv2.w_warehouse_sk
+  and inv1.d_moy=4
+  and inv2.d_moy=4+1
+order by inv1.w_warehouse_sk,inv1.i_item_sk,inv1.d_moy,inv1.mean,inv1.cov
+        ,inv2.d_moy,inv2.mean, inv2.cov
+PREHOOK: type: QUERY
+PREHOOK: Input: default@date_dim
+PREHOOK: Input: default@inventory
+PREHOOK: Input: default@item
+PREHOOK: Input: default@warehouse
+PREHOOK: Output: hdfs://### HDFS PATH ###
+POSTHOOK: query: explain
+with inv as
+(select w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy
+       ,stdev,mean, case mean when 0 then null else stdev/mean end cov
+ from(select w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy
+            ,stddev_samp(inv_quantity_on_hand) stdev,avg(inv_quantity_on_hand) mean
+      from inventory
+          ,item
+          ,warehouse
+          ,date_dim
+      where inv_item_sk = i_item_sk
+        and inv_warehouse_sk = w_warehouse_sk
+        and inv_date_sk = d_date_sk
+        and d_year =1999
+      group by w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy) foo
+ where case mean when 0 then 0 else stdev/mean end > 1)
+select inv1.w_warehouse_sk,inv1.i_item_sk,inv1.d_moy,inv1.mean, inv1.cov
+        ,inv2.w_warehouse_sk,inv2.i_item_sk,inv2.d_moy,inv2.mean, inv2.cov
+from inv inv1,inv inv2
+where inv1.i_item_sk = inv2.i_item_sk
+  and inv1.w_warehouse_sk =  inv2.w_warehouse_sk
+  and inv1.d_moy=4
+  and inv2.d_moy=4+1
+order by inv1.w_warehouse_sk,inv1.i_item_sk,inv1.d_moy,inv1.mean,inv1.cov
+        ,inv2.d_moy,inv2.mean, inv2.cov
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@date_dim
+POSTHOOK: Input: default@inventory
+POSTHOOK: Input: default@item
+POSTHOOK: Input: default@warehouse
+POSTHOOK: Output: hdfs://### HDFS PATH ###
+Plan optimized by CBO.
+
+Vertex dependency in root stage
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 10 (SIMPLE_EDGE)
+Reducer 3 <- Map 11 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
+Reducer 4 <- Reducer 3 (SIMPLE_EDGE)
+Reducer 5 <- Reducer 4 (ONE_TO_ONE_EDGE), Reducer 9 (ONE_TO_ONE_EDGE)
+Reducer 6 <- Reducer 5 (SIMPLE_EDGE)
+Reducer 7 <- Map 1 (SIMPLE_EDGE), Map 10 (SIMPLE_EDGE)
+Reducer 8 <- Map 11 (SIMPLE_EDGE), Reducer 7 (SIMPLE_EDGE)
+Reducer 9 <- Reducer 8 (SIMPLE_EDGE)
+
+Stage-0
+  Fetch Operator
+    limit:-1
+    Stage-1
+      Reducer 6 vectorized
+      File Output Operator [FS_166]
+        Select Operator [SEL_165] (rows=859 width=56)
+          Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9"]
+        <-Reducer 5 [SIMPLE_EDGE]
+          SHUFFLE [RS_44]
+            Select Operator [SEL_43] (rows=859 width=48)
+              Output:["_col0","_col1","_col2","_col3","_col6","_col7"]
+              Merge Join Operator [MERGEJOIN_144] (rows=859 width=40)
+                Conds:RS_160._col0, _col1=RS_164._col0, _col1(Inner),Output:["_col0","_col1","_col2","_col3","_col6","_col7"]
+              <-Reducer 4 [ONE_TO_ONE_EDGE] vectorized
+                FORWARD [RS_160]
+                  PartitionCols:_col0, _col1
+                  Select Operator [SEL_159] (rows=859 width=24)
+                    Output:["_col0","_col1","_col2","_col3"]
+                    Filter Operator [FIL_158] (rows=859 width=40)
+                      predicate:CASE WHEN (((UDFToDouble(_col2) / _col3) = 0)) THEN (false) ELSE (((power(((_col4 - ((_col5 * _col5) / _col3)) / CASE WHEN ((_col3 = 1L)) THEN (null) ELSE ((_col3 - 1)) END), 0.5) / (UDFToDouble(_col2) / _col3)) > 1.0D)) END
+                      Group By Operator [GBY_157] (rows=1719 width=40)
+                        Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(VALUE._col0)","count(VALUE._col1)","sum(VALUE._col2)","sum(VALUE._col3)"],keys:KEY._col0, KEY._col1
+                      <-Reducer 3 [SIMPLE_EDGE]
+                        SHUFFLE [RS_16]
+                          PartitionCols:_col0, _col1
+                          Group By Operator [GBY_15] (rows=1719 width=40)
+                            Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(_col3)","count(_col3)","sum(_col5)","sum(_col4)"],keys:_col1, _col2
+                            Select Operator [SEL_13] (rows=1032514 width=8)
+                              Output:["_col1","_col2","_col3","_col4","_col5"]
+                              Merge Join Operator [MERGEJOIN_141] (rows=1032514 width=8)
+                                Conds:RS_10._col1=RS_155._col0(Inner),Output:["_col2","_col3","_col5"]
+                              <-Map 11 [SIMPLE_EDGE] vectorized
+                                SHUFFLE [RS_155]
+                                  PartitionCols:_col0
+                                  Select Operator [SEL_154] (rows=27 width=4)
+                                    Output:["_col0"]
+                                    TableScan [TS_5] (rows=27 width=4)
+                                      default@warehouse,warehouse,Tbl:COMPLETE,Col:COMPLETE,Output:["w_warehouse_sk"]
+                              <-Reducer 2 [SIMPLE_EDGE]
+                                SHUFFLE [RS_10]
+                                  PartitionCols:_col1
+                                  Merge Join Operator [MERGEJOIN_140] (rows=1032514 width=8)
+                                    Conds:RS_146._col0=RS_152._col0(Inner),Output:["_col1","_col2","_col3"]
+                                  <-Map 1 [SIMPLE_EDGE] vectorized
+                                    SHUFFLE [RS_146]
+                                      PartitionCols:_col0
+                                      Select Operator [SEL_145] (rows=37584000 width=15)
+                                        Output:["_col0","_col1","_col2","_col3"]
+                                        TableScan [TS_0] (rows=37584000 width=15)
+                                          default@inventory,inventory,Tbl:COMPLETE,Col:COMPLETE,Output:["inv_date_sk","inv_item_sk","inv_warehouse_sk","inv_quantity_on_hand"]
+                                  <-Map 10 [SIMPLE_EDGE] vectorized
+                                    SHUFFLE [RS_152]
+                                      PartitionCols:_col0
+                                      Select Operator [SEL_150] (rows=50 width=4)
+                                        Output:["_col0"]
+                                        Filter Operator [FIL_148] (rows=50 width=12)
+                                          predicate:((d_moy = 5) and (d_year = 1999))
+                                          TableScan [TS_2] (rows=73049 width=12)
+                                            default@date_dim,date_dim,Tbl:COMPLETE,Col:COMPLETE,Output:["d_date_sk","d_year","d_moy"]
+              <-Reducer 9 [ONE_TO_ONE_EDGE] vectorized
+                FORWARD [RS_164]
+                  PartitionCols:_col0, _col1
+                  Select Operator [SEL_163] (rows=859 width=24)
+                    Output:["_col0","_col1","_col2","_col3"]
+                    Filter Operator [FIL_162] (rows=859 width=40)
+                      predicate:CASE WHEN (((UDFToDouble(_col2) / _col3) = 0)) THEN (false) ELSE (((power(((_col4 - ((_col5 * _col5) / _col3)) / CASE WHEN ((_col3 = 1L)) THEN (null) ELSE ((_col3 - 1)) END), 0.5) / (UDFToDouble(_col2) / _col3)) > 1.0D)) END
+                      Group By Operator [GBY_161] (rows=1719 width=40)
+                        Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(VALUE._col0)","count(VALUE._col1)","sum(VALUE._col2)","sum(VALUE._col3)"],keys:KEY._col0, KEY._col1
+                      <-Reducer 8 [SIMPLE_EDGE]
+                        SHUFFLE [RS_36]
+                          PartitionCols:_col0, _col1
+                          Group By Operator [GBY_35] (rows=1719 width=40)
+                            Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(_col3)","count(_col3)","sum(_col5)","sum(_col4)"],keys:_col1, _col2
+                            Select Operator [SEL_33] (rows=1032514 width=8)
+                              Output:["_col1","_col2","_col3","_col4","_col5"]
+                              Merge Join Operator [MERGEJOIN_143] (rows=1032514 width=8)
+                                Conds:RS_30._col1=RS_156._col0(Inner),Output:["_col2","_col3","_col5"]
+                              <-Map 11 [SIMPLE_EDGE] vectorized
+                                SHUFFLE [RS_156]
+                                  PartitionCols:_col0
+                                   Please refer to the previous Select Operator [SEL_154]
+                              <-Reducer 7 [SIMPLE_EDGE]
+                                SHUFFLE [RS_30]
+                                  PartitionCols:_col1
+                                  Merge Join Operator [MERGEJOIN_142] (rows=1032514 width=8)
+                                    Conds:RS_147._col0=RS_153._col0(Inner),Output:["_col1","_col2","_col3"]
+                                  <-Map 1 [SIMPLE_EDGE] vectorized
+                                    SHUFFLE [RS_147]
+                                      PartitionCols:_col0
+                                       Please refer to the previous Select Operator [SEL_145]
+                                  <-Map 10 [SIMPLE_EDGE] vectorized
+                                    SHUFFLE [RS_153]
+                                      PartitionCols:_col0
+                                      Select Operator [SEL_151] (rows=50 width=4)
+                                        Output:["_col0"]
+                                        Filter Operator [FIL_149] (rows=50 width=12)
+                                          predicate:((d_moy = 4) and (d_year = 1999))
+                                           Please refer to the previous TableScan [TS_2]
+
+PREHOOK: query: with inv as
+(select w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy
+       ,stdev,mean, case mean when 0 then null else stdev/mean end cov
+ from(select w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy
+            ,stddev_samp(inv_quantity_on_hand) stdev,avg(inv_quantity_on_hand) mean
+      from inventory
+          ,item
+          ,warehouse
+          ,date_dim
+      where inv_item_sk = i_item_sk
+        and inv_warehouse_sk = w_warehouse_sk
+        and inv_date_sk = d_date_sk
+        and d_year =1999
+      group by w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy) foo
+ where case mean when 0 then 0 else stdev/mean end > 1)
+select inv1.w_warehouse_sk,inv1.i_item_sk,inv1.d_moy,inv1.mean, inv1.cov
+        ,inv2.w_warehouse_sk,inv2.i_item_sk,inv2.d_moy,inv2.mean, inv2.cov
+from inv inv1,inv inv2
+where inv1.i_item_sk = inv2.i_item_sk
+  and inv1.w_warehouse_sk =  inv2.w_warehouse_sk
+  and inv1.d_moy=4
+  and inv2.d_moy=4+1
+  and inv1.cov > 1.5
+order by inv1.w_warehouse_sk,inv1.i_item_sk,inv1.d_moy,inv1.mean,inv1.cov
+        ,inv2.d_moy,inv2.mean, inv2.cov
+PREHOOK: type: QUERY
+PREHOOK: Input: default@date_dim
+PREHOOK: Input: default@inventory
+PREHOOK: Input: default@item
+PREHOOK: Input: default@warehouse
+PREHOOK: Output: hdfs://### HDFS PATH ###
+POSTHOOK: query: with inv as
+(select w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy
+       ,stdev,mean, case mean when 0 then null else stdev/mean end cov
+ from(select w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy
+            ,stddev_samp(inv_quantity_on_hand) stdev,avg(inv_quantity_on_hand) mean
+      from inventory
+          ,item
+          ,warehouse
+          ,date_dim
+      where inv_item_sk = i_item_sk
+        and inv_warehouse_sk = w_warehouse_sk
+        and inv_date_sk = d_date_sk
+        and d_year =1999
+      group by w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy) foo
+ where case mean when 0 then 0 else stdev/mean end > 1)
+select inv1.w_warehouse_sk,inv1.i_item_sk,inv1.d_moy,inv1.mean, inv1.cov
+        ,inv2.w_warehouse_sk,inv2.i_item_sk,inv2.d_moy,inv2.mean, inv2.cov
+from inv inv1,inv inv2
+where inv1.i_item_sk = inv2.i_item_sk
+  and inv1.w_warehouse_sk =  inv2.w_warehouse_sk
+  and inv1.d_moy=4
+  and inv2.d_moy=4+1
+  and inv1.cov > 1.5
+order by inv1.w_warehouse_sk,inv1.i_item_sk,inv1.d_moy,inv1.mean,inv1.cov
+        ,inv2.d_moy,inv2.mean, inv2.cov
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@date_dim
+POSTHOOK: Input: default@inventory
+POSTHOOK: Input: default@item
+POSTHOOK: Input: default@warehouse
+POSTHOOK: Output: hdfs://### HDFS PATH ###

http://git-wip-us.apache.org/repos/asf/hive/blob/b8299551/ql/src/test/results/clientpositive/perf/tez/constraints/query4.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query4.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query4.q.out
new file mode 100644
index 0000000..7291c14
--- /dev/null
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query4.q.out
@@ -0,0 +1,623 @@
+PREHOOK: query: explain
+with year_total as (
+ select c_customer_id customer_id
+       ,c_first_name customer_first_name
+       ,c_last_name customer_last_name
+       ,c_preferred_cust_flag customer_preferred_cust_flag
+       ,c_birth_country customer_birth_country
+       ,c_login customer_login
+       ,c_email_address customer_email_address
+       ,d_year dyear
+       ,sum(((ss_ext_list_price-ss_ext_wholesale_cost-ss_ext_discount_amt)+ss_ext_sales_price)/2) year_total
+       ,'s' sale_type
+ from customer
+     ,store_sales
+     ,date_dim
+ where c_customer_sk = ss_customer_sk
+   and ss_sold_date_sk = d_date_sk
+ group by c_customer_id
+         ,c_first_name
+         ,c_last_name
+         ,c_preferred_cust_flag
+         ,c_birth_country
+         ,c_login
+         ,c_email_address
+         ,d_year
+ union all
+ select c_customer_id customer_id
+       ,c_first_name customer_first_name
+       ,c_last_name customer_last_name
+       ,c_preferred_cust_flag customer_preferred_cust_flag
+       ,c_birth_country customer_birth_country
+       ,c_login customer_login
+       ,c_email_address customer_email_address
+       ,d_year dyear
+       ,sum((((cs_ext_list_price-cs_ext_wholesale_cost-cs_ext_discount_amt)+cs_ext_sales_price)/2) ) year_total
+       ,'c' sale_type
+ from customer
+     ,catalog_sales
+     ,date_dim
+ where c_customer_sk = cs_bill_customer_sk
+   and cs_sold_date_sk = d_date_sk
+ group by c_customer_id
+         ,c_first_name
+         ,c_last_name
+         ,c_preferred_cust_flag
+         ,c_birth_country
+         ,c_login
+         ,c_email_address
+         ,d_year
+union all
+ select c_customer_id customer_id
+       ,c_first_name customer_first_name
+       ,c_last_name customer_last_name
+       ,c_preferred_cust_flag customer_preferred_cust_flag
+       ,c_birth_country customer_birth_country
+       ,c_login customer_login
+       ,c_email_address customer_email_address
+       ,d_year dyear
+       ,sum((((ws_ext_list_price-ws_ext_wholesale_cost-ws_ext_discount_amt)+ws_ext_sales_price)/2) ) year_total
+       ,'w' sale_type
+ from customer
+     ,web_sales
+     ,date_dim
+ where c_customer_sk = ws_bill_customer_sk
+   and ws_sold_date_sk = d_date_sk
+ group by c_customer_id
+         ,c_first_name
+         ,c_last_name
+         ,c_preferred_cust_flag
+         ,c_birth_country
+         ,c_login
+         ,c_email_address
+         ,d_year
+         )
+  select  t_s_secyear.customer_preferred_cust_flag
+ from year_total t_s_firstyear
+     ,year_total t_s_secyear
+     ,year_total t_c_firstyear
+     ,year_total t_c_secyear
+     ,year_total t_w_firstyear
+     ,year_total t_w_secyear
+ where t_s_secyear.customer_id = t_s_firstyear.customer_id
+   and t_s_firstyear.customer_id = t_c_secyear.customer_id
+   and t_s_firstyear.customer_id = t_c_firstyear.customer_id
+   and t_s_firstyear.customer_id = t_w_firstyear.customer_id
+   and t_s_firstyear.customer_id = t_w_secyear.customer_id
+   and t_s_firstyear.sale_type = 's'
+   and t_c_firstyear.sale_type = 'c'
+   and t_w_firstyear.sale_type = 'w'
+   and t_s_secyear.sale_type = 's'
+   and t_c_secyear.sale_type = 'c'
+   and t_w_secyear.sale_type = 'w'
+   and t_s_firstyear.dyear =  2001
+   and t_s_secyear.dyear = 2001+1
+   and t_c_firstyear.dyear =  2001
+   and t_c_secyear.dyear =  2001+1
+   and t_w_firstyear.dyear = 2001
+   and t_w_secyear.dyear = 2001+1
+   and t_s_firstyear.year_total > 0
+   and t_c_firstyear.year_total > 0
+   and t_w_firstyear.year_total > 0
+   and case when t_c_firstyear.year_total > 0 then t_c_secyear.year_total / t_c_firstyear.year_total else null end
+           > case when t_s_firstyear.year_total > 0 then t_s_secyear.year_total / t_s_firstyear.year_total else null end
+   and case when t_c_firstyear.year_total > 0 then t_c_secyear.year_total / t_c_firstyear.year_total else null end
+           > case when t_w_firstyear.year_total > 0 then t_w_secyear.year_total / t_w_firstyear.year_total else null end
+ order by t_s_secyear.customer_preferred_cust_flag
+limit 100
+PREHOOK: type: QUERY
+PREHOOK: Input: default@catalog_sales
+PREHOOK: Input: default@customer
+PREHOOK: Input: default@date_dim
+PREHOOK: Input: default@store_sales
+PREHOOK: Input: default@web_sales
+PREHOOK: Output: hdfs://### HDFS PATH ###
+POSTHOOK: query: explain
+with year_total as (
+ select c_customer_id customer_id
+       ,c_first_name customer_first_name
+       ,c_last_name customer_last_name
+       ,c_preferred_cust_flag customer_preferred_cust_flag
+       ,c_birth_country customer_birth_country
+       ,c_login customer_login
+       ,c_email_address customer_email_address
+       ,d_year dyear
+       ,sum(((ss_ext_list_price-ss_ext_wholesale_cost-ss_ext_discount_amt)+ss_ext_sales_price)/2) year_total
+       ,'s' sale_type
+ from customer
+     ,store_sales
+     ,date_dim
+ where c_customer_sk = ss_customer_sk
+   and ss_sold_date_sk = d_date_sk
+ group by c_customer_id
+         ,c_first_name
+         ,c_last_name
+         ,c_preferred_cust_flag
+         ,c_birth_country
+         ,c_login
+         ,c_email_address
+         ,d_year
+ union all
+ select c_customer_id customer_id
+       ,c_first_name customer_first_name
+       ,c_last_name customer_last_name
+       ,c_preferred_cust_flag customer_preferred_cust_flag
+       ,c_birth_country customer_birth_country
+       ,c_login customer_login
+       ,c_email_address customer_email_address
+       ,d_year dyear
+       ,sum((((cs_ext_list_price-cs_ext_wholesale_cost-cs_ext_discount_amt)+cs_ext_sales_price)/2) ) year_total
+       ,'c' sale_type
+ from customer
+     ,catalog_sales
+     ,date_dim
+ where c_customer_sk = cs_bill_customer_sk
+   and cs_sold_date_sk = d_date_sk
+ group by c_customer_id
+         ,c_first_name
+         ,c_last_name
+         ,c_preferred_cust_flag
+         ,c_birth_country
+         ,c_login
+         ,c_email_address
+         ,d_year
+union all
+ select c_customer_id customer_id
+       ,c_first_name customer_first_name
+       ,c_last_name customer_last_name
+       ,c_preferred_cust_flag customer_preferred_cust_flag
+       ,c_birth_country customer_birth_country
+       ,c_login customer_login
+       ,c_email_address customer_email_address
+       ,d_year dyear
+       ,sum((((ws_ext_list_price-ws_ext_wholesale_cost-ws_ext_discount_amt)+ws_ext_sales_price)/2) ) year_total
+       ,'w' sale_type
+ from customer
+     ,web_sales
+     ,date_dim
+ where c_customer_sk = ws_bill_customer_sk
+   and ws_sold_date_sk = d_date_sk
+ group by c_customer_id
+         ,c_first_name
+         ,c_last_name
+         ,c_preferred_cust_flag
+         ,c_birth_country
+         ,c_login
+         ,c_email_address
+         ,d_year
+         )
+  select  t_s_secyear.customer_preferred_cust_flag
+ from year_total t_s_firstyear
+     ,year_total t_s_secyear
+     ,year_total t_c_firstyear
+     ,year_total t_c_secyear
+     ,year_total t_w_firstyear
+     ,year_total t_w_secyear
+ where t_s_secyear.customer_id = t_s_firstyear.customer_id
+   and t_s_firstyear.customer_id = t_c_secyear.customer_id
+   and t_s_firstyear.customer_id = t_c_firstyear.customer_id
+   and t_s_firstyear.customer_id = t_w_firstyear.customer_id
+   and t_s_firstyear.customer_id = t_w_secyear.customer_id
+   and t_s_firstyear.sale_type = 's'
+   and t_c_firstyear.sale_type = 'c'
+   and t_w_firstyear.sale_type = 'w'
+   and t_s_secyear.sale_type = 's'
+   and t_c_secyear.sale_type = 'c'
+   and t_w_secyear.sale_type = 'w'
+   and t_s_firstyear.dyear =  2001
+   and t_s_secyear.dyear = 2001+1
+   and t_c_firstyear.dyear =  2001
+   and t_c_secyear.dyear =  2001+1
+   and t_w_firstyear.dyear = 2001
+   and t_w_secyear.dyear = 2001+1
+   and t_s_firstyear.year_total > 0
+   and t_c_firstyear.year_total > 0
+   and t_w_firstyear.year_total > 0
+   and case when t_c_firstyear.year_total > 0 then t_c_secyear.year_total / t_c_firstyear.year_total else null end
+           > case when t_s_firstyear.year_total > 0 then t_s_secyear.year_total / t_s_firstyear.year_total else null end
+   and case when t_c_firstyear.year_total > 0 then t_c_secyear.year_total / t_c_firstyear.year_total else null end
+           > case when t_w_firstyear.year_total > 0 then t_w_secyear.year_total / t_w_firstyear.year_total else null end
+ order by t_s_secyear.customer_preferred_cust_flag
+limit 100
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@catalog_sales
+POSTHOOK: Input: default@customer
+POSTHOOK: Input: default@date_dim
+POSTHOOK: Input: default@store_sales
+POSTHOOK: Input: default@web_sales
+POSTHOOK: Output: hdfs://### HDFS PATH ###
+Plan optimized by CBO.
+
+Vertex dependency in root stage
+Map 1 <- Reducer 34 (BROADCAST_EDGE)
+Map 11 <- Reducer 35 (BROADCAST_EDGE)
+Map 15 <- Reducer 36 (BROADCAST_EDGE)
+Map 19 <- Reducer 37 (BROADCAST_EDGE)
+Map 23 <- Reducer 33 (BROADCAST_EDGE)
+Map 27 <- Reducer 32 (BROADCAST_EDGE)
+Reducer 10 <- Reducer 9 (SIMPLE_EDGE)
+Reducer 12 <- Map 11 (SIMPLE_EDGE), Map 31 (SIMPLE_EDGE)
+Reducer 13 <- Map 38 (SIMPLE_EDGE), Reducer 12 (SIMPLE_EDGE)
+Reducer 14 <- Reducer 13 (SIMPLE_EDGE)
+Reducer 16 <- Map 15 (SIMPLE_EDGE), Map 31 (SIMPLE_EDGE)
+Reducer 17 <- Map 38 (SIMPLE_EDGE), Reducer 16 (SIMPLE_EDGE)
+Reducer 18 <- Reducer 17 (SIMPLE_EDGE)
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 31 (SIMPLE_EDGE)
+Reducer 20 <- Map 19 (SIMPLE_EDGE), Map 31 (SIMPLE_EDGE)
+Reducer 21 <- Map 38 (SIMPLE_EDGE), Reducer 20 (SIMPLE_EDGE)
+Reducer 22 <- Reducer 21 (SIMPLE_EDGE)
+Reducer 24 <- Map 23 (SIMPLE_EDGE), Map 31 (SIMPLE_EDGE)
+Reducer 25 <- Map 38 (SIMPLE_EDGE), Reducer 24 (SIMPLE_EDGE)
+Reducer 26 <- Reducer 25 (SIMPLE_EDGE)
+Reducer 28 <- Map 27 (SIMPLE_EDGE), Map 31 (SIMPLE_EDGE)
+Reducer 29 <- Map 38 (SIMPLE_EDGE), Reducer 28 (SIMPLE_EDGE)
+Reducer 3 <- Map 38 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
+Reducer 30 <- Reducer 29 (SIMPLE_EDGE)
+Reducer 32 <- Map 31 (CUSTOM_SIMPLE_EDGE)
+Reducer 33 <- Map 31 (CUSTOM_SIMPLE_EDGE)
+Reducer 34 <- Map 31 (CUSTOM_SIMPLE_EDGE)
+Reducer 35 <- Map 31 (CUSTOM_SIMPLE_EDGE)
+Reducer 36 <- Map 31 (CUSTOM_SIMPLE_EDGE)
+Reducer 37 <- Map 31 (CUSTOM_SIMPLE_EDGE)
+Reducer 4 <- Reducer 3 (SIMPLE_EDGE)
+Reducer 5 <- Reducer 14 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE)
+Reducer 6 <- Reducer 18 (SIMPLE_EDGE), Reducer 5 (ONE_TO_ONE_EDGE)
+Reducer 7 <- Reducer 22 (SIMPLE_EDGE), Reducer 6 (ONE_TO_ONE_EDGE)
+Reducer 8 <- Reducer 26 (SIMPLE_EDGE), Reducer 7 (ONE_TO_ONE_EDGE)
+Reducer 9 <- Reducer 30 (SIMPLE_EDGE), Reducer 8 (ONE_TO_ONE_EDGE)
+
+Stage-0
+  Fetch Operator
+    limit:100
+    Stage-1
+      Reducer 10 vectorized
+      File Output Operator [FS_550]
+        Limit [LIM_549] (rows=100 width=85)
+          Number of rows:100
+          Select Operator [SEL_548] (rows=7323197 width=85)
+            Output:["_col0"]
+          <-Reducer 9 [SIMPLE_EDGE]
+            SHUFFLE [RS_135]
+              Select Operator [SEL_134] (rows=7323197 width=85)
+                Output:["_col0"]
+                Filter Operator [FIL_133] (rows=7323197 width=541)
+                  predicate:CASE WHEN (_col4) THEN (CASE WHEN (_col10) THEN (((_col12 / _col9) > (_col15 / _col3))) ELSE ((null > (_col15 / _col3))) END) ELSE (CASE WHEN (_col10) THEN (((_col12 / _col9) > null)) ELSE (null) END) END
+                  Merge Join Operator [MERGEJOIN_466] (rows=14646395 width=541)
+                    Conds:RS_130._col2=RS_547._col0(Inner),Output:["_col3","_col4","_col9","_col10","_col12","_col14","_col15"]
+                  <-Reducer 30 [SIMPLE_EDGE] vectorized
+                    SHUFFLE [RS_547]
+                      PartitionCols:_col0
+                      Select Operator [SEL_546] (rows=80000000 width=297)
+                        Output:["_col0","_col1","_col2"]
+                        Group By Operator [GBY_545] (rows=80000000 width=764)
+                          Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4, KEY._col5, KEY._col6
+                        <-Reducer 29 [SIMPLE_EDGE]
+                          SHUFFLE [RS_114]
+                            PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5, _col6
+                            Group By Operator [GBY_113] (rows=80000000 width=764)
+                              Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(_col2)"],keys:_col5, _col6, _col7, _col8, _col9, _col10, _col11
+                              Merge Join Operator [MERGEJOIN_461] (rows=187573258 width=764)
+                                Conds:RS_109._col1=RS_503._col0(Inner),Output:["_col2","_col5","_col6","_col7","_col8","_col9","_col10","_col11"]
+                              <-Map 38 [SIMPLE_EDGE] vectorized
+                                SHUFFLE [RS_503]
+                                  PartitionCols:_col0
+                                  Select Operator [SEL_502] (rows=80000000 width=656)
+                                    Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
+                                    TableScan [TS_104] (rows=80000000 width=656)
+                                      default@customer,customer,Tbl:COMPLETE,Col:COMPLETE,Output:["c_customer_sk","c_customer_id","c_first_name","c_last_name","c_preferred_cust_flag","c_birth_country","c_login","c_email_address"]
+                              <-Reducer 28 [SIMPLE_EDGE]
+                                SHUFFLE [RS_109]
+                                  PartitionCols:_col1
+                                  Merge Join Operator [MERGEJOIN_460] (rows=187573258 width=115)
+                                    Conds:RS_106._col0=RS_475._col0(Inner),Output:["_col1","_col2"]
+                                  <-Map 31 [SIMPLE_EDGE] vectorized
+                                    PARTITION_ONLY_SHUFFLE [RS_475]
+                                      PartitionCols:_col0
+                                      Select Operator [SEL_471] (rows=652 width=4)
+                                        Output:["_col0"]
+                                        Filter Operator [FIL_467] (rows=652 width=8)
+                                          predicate:(d_year = 2002)
+                                          TableScan [TS_101] (rows=73049 width=8)
+                                            default@date_dim,date_dim,Tbl:COMPLETE,Col:COMPLETE,Output:["d_date_sk","d_year"]
+                                  <-Map 27 [SIMPLE_EDGE]
+                                    SHUFFLE [RS_106]
+                                      PartitionCols:_col0
+                                      Select Operator [SEL_100] (rows=525327388 width=119)
+                                        Output:["_col0","_col1","_col2"]
+                                        Filter Operator [FIL_244] (rows=525327388 width=435)
+                                          predicate:((ss_sold_date_sk BETWEEN DynamicValue(RS_107_date_dim_d_date_sk_min) AND DynamicValue(RS_107_date_dim_d_date_sk_max) and in_bloom_filter(ss_sold_date_sk, DynamicValue(RS_107_date_dim_d_date_sk_bloom_filter))) and ss_customer_sk is not null and ss_sold_date_sk is not null)
+                                          TableScan [TS_98] (rows=575995635 width=435)
+                                            default@store_sales,store_sales,Tbl:COMPLETE,Col:COMPLETE,Output:["ss_sold_date_sk","ss_customer_sk","ss_ext_discount_amt","ss_ext_sales_price","ss_ext_wholesale_cost","ss_ext_list_price"]
+                                          <-Reducer 32 [BROADCAST_EDGE] vectorized
+                                            BROADCAST [RS_543]
+                                              Group By Operator [GBY_542] (rows=1 width=12)
+                                                Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
+                                              <-Map 31 [CUSTOM_SIMPLE_EDGE] vectorized
+                                                PARTITION_ONLY_SHUFFLE [RS_493]
+                                                  Group By Operator [GBY_487] (rows=1 width=12)
+                                                    Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                                    Select Operator [SEL_476] (rows=652 width=4)
+                                                      Output:["_col0"]
+                                                       Please refer to the previous Select Operator [SEL_471]
+                  <-Reducer 8 [ONE_TO_ONE_EDGE]
+                    FORWARD [RS_130]
+                      PartitionCols:_col2
+                      Filter Operator [FIL_129] (rows=12248093 width=672)
+                        predicate:CASE WHEN (_col7) THEN (CASE WHEN (_col10) THEN (((_col12 / _col9) > (_col1 / _col6))) ELSE ((null > (_col1 / _col6))) END) ELSE (CASE WHEN (_col10) THEN (((_col12 / _col9) > null)) ELSE (null) END) END
+                        Merge Join Operator [MERGEJOIN_465] (rows=24496186 width=672)
+                          Conds:RS_126._col2=RS_541._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col6","_col7","_col9","_col10","_col12"]
+                        <-Reducer 26 [SIMPLE_EDGE] vectorized
+                          SHUFFLE [RS_541]
+                            PartitionCols:_col0
+                            Select Operator [SEL_540] (rows=80000000 width=212)
+                              Output:["_col0","_col1"]
+                              Group By Operator [GBY_539] (rows=80000000 width=764)
+                                Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4, KEY._col5, KEY._col6
+                              <-Reducer 25 [SIMPLE_EDGE]
+                                SHUFFLE [RS_95]
+                                  PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5, _col6
+                                  Group By Operator [GBY_94] (rows=80000000 width=764)
+                                    Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(_col2)"],keys:_col5, _col6, _col7, _col8, _col9, _col10, _col11
+                                    Merge Join Operator [MERGEJOIN_459] (rows=101084444 width=764)
+                                      Conds:RS_90._col1=RS_504._col0(Inner),Output:["_col2","_col5","_col6","_col7","_col8","_col9","_col10","_col11"]
+                                    <-Map 38 [SIMPLE_EDGE] vectorized
+                                      SHUFFLE [RS_504]
+                                        PartitionCols:_col0
+                                         Please refer to the previous Select Operator [SEL_502]
+                                    <-Reducer 24 [SIMPLE_EDGE]
+                                      SHUFFLE [RS_90]
+                                        PartitionCols:_col1
+                                        Merge Join Operator [MERGEJOIN_458] (rows=101084444 width=115)
+                                          Conds:RS_87._col0=RS_477._col0(Inner),Output:["_col1","_col2"]
+                                        <-Map 31 [SIMPLE_EDGE] vectorized
+                                          PARTITION_ONLY_SHUFFLE [RS_477]
+                                            PartitionCols:_col0
+                                             Please refer to the previous Select Operator [SEL_471]
+                                        <-Map 23 [SIMPLE_EDGE]
+                                          SHUFFLE [RS_87]
+                                            PartitionCols:_col0
+                                            Select Operator [SEL_81] (rows=285117831 width=119)
+                                              Output:["_col0","_col1","_col2"]
+                                              Filter Operator [FIL_241] (rows=285117831 width=453)
+                                                predicate:((cs_sold_date_sk BETWEEN DynamicValue(RS_88_date_dim_d_date_sk_min) AND DynamicValue(RS_88_date_dim_d_date_sk_max) and in_bloom_filter(cs_sold_date_sk, DynamicValue(RS_88_date_dim_d_date_sk_bloom_filter))) and cs_bill_customer_sk is not null and cs_sold_date_sk is not null)
+                                                TableScan [TS_79] (rows=287989836 width=453)
+                                                  default@catalog_sales,catalog_sales,Tbl:COMPLETE,Col:COMPLETE,Output:["cs_sold_date_sk","cs_bill_customer_sk","cs_ext_discount_amt","cs_ext_sales_price","cs_ext_wholesale_cost","cs_ext_list_price"]
+                                                <-Reducer 33 [BROADCAST_EDGE] vectorized
+                                                  BROADCAST [RS_537]
+                                                    Group By Operator [GBY_536] (rows=1 width=12)
+                                                      Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
+                                                    <-Map 31 [CUSTOM_SIMPLE_EDGE] vectorized
+                                                      PARTITION_ONLY_SHUFFLE [RS_494]
+                                                        Group By Operator [GBY_488] (rows=1 width=12)
+                                                          Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                                          Select Operator [SEL_478] (rows=652 width=4)
+                                                            Output:["_col0"]
+                                                             Please refer to the previous Select Operator [SEL_471]
+                        <-Reducer 7 [ONE_TO_ONE_EDGE]
+                          FORWARD [RS_126]
+                            PartitionCols:_col2
+                            Merge Join Operator [MERGEJOIN_464] (rows=20485011 width=560)
+                              Conds:RS_123._col2=RS_535._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col6","_col7","_col9","_col10"]
+                            <-Reducer 22 [SIMPLE_EDGE] vectorized
+                              SHUFFLE [RS_535]
+                                PartitionCols:_col0
+                                Select Operator [SEL_534] (rows=26666666 width=216)
+                                  Output:["_col0","_col1","_col2"]
+                                  Filter Operator [FIL_533] (rows=26666666 width=212)
+                                    predicate:(_col7 > 0)
+                                    Select Operator [SEL_532] (rows=80000000 width=212)
+                                      Output:["_col0","_col7"]
+                                      Group By Operator [GBY_531] (rows=80000000 width=764)
+                                        Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4, KEY._col5, KEY._col6
+                                      <-Reducer 21 [SIMPLE_EDGE]
+                                        SHUFFLE [RS_75]
+                                          PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5, _col6
+                                          Group By Operator [GBY_74] (rows=80000000 width=764)
+                                            Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(_col2)"],keys:_col5, _col6, _col7, _col8, _col9, _col10, _col11
+                                            Merge Join Operator [MERGEJOIN_457] (rows=101084444 width=764)
+                                              Conds:RS_70._col1=RS_508._col0(Inner),Output:["_col2","_col5","_col6","_col7","_col8","_col9","_col10","_col11"]
+                                            <-Map 38 [SIMPLE_EDGE] vectorized
+                                              SHUFFLE [RS_508]
+                                                PartitionCols:_col0
+                                                 Please refer to the previous Select Operator [SEL_502]
+                                            <-Reducer 20 [SIMPLE_EDGE]
+                                              SHUFFLE [RS_70]
+                                                PartitionCols:_col1
+                                                Merge Join Operator [MERGEJOIN_456] (rows=101084444 width=115)
+                                                  Conds:RS_67._col0=RS_485._col0(Inner),Output:["_col1","_col2"]
+                                                <-Map 31 [SIMPLE_EDGE] vectorized
+                                                  PARTITION_ONLY_SHUFFLE [RS_485]
+                                                    PartitionCols:_col0
+                                                    Select Operator [SEL_474] (rows=652 width=4)
+                                                      Output:["_col0"]
+                                                      Filter Operator [FIL_470] (rows=652 width=8)
+                                                        predicate:(d_year = 2001)
+                                                         Please refer to the previous TableScan [TS_101]
+                                                <-Map 19 [SIMPLE_EDGE]
+                                                  SHUFFLE [RS_67]
+                                                    PartitionCols:_col0
+                                                    Select Operator [SEL_61] (rows=285117831 width=119)
+                                                      Output:["_col0","_col1","_col2"]
+                                                      Filter Operator [FIL_238] (rows=285117831 width=453)
+                                                        predicate:((cs_sold_date_sk BETWEEN DynamicValue(RS_68_date_dim_d_date_sk_min) AND DynamicValue(RS_68_date_dim_d_date_sk_max) and in_bloom_filter(cs_sold_date_sk, DynamicValue(RS_68_date_dim_d_date_sk_bloom_filter))) and cs_bill_customer_sk is not null and cs_sold_date_sk is not null)
+                                                        TableScan [TS_59] (rows=287989836 width=453)
+                                                          default@catalog_sales,catalog_sales,Tbl:COMPLETE,Col:COMPLETE,Output:["cs_sold_date_sk","cs_bill_customer_sk","cs_ext_discount_amt","cs_ext_sales_price","cs_ext_wholesale_cost","cs_ext_list_price"]
+                                                        <-Reducer 37 [BROADCAST_EDGE] vectorized
+                                                          BROADCAST [RS_529]
+                                                            Group By Operator [GBY_528] (rows=1 width=12)
+                                                              Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
+                                                            <-Map 31 [CUSTOM_SIMPLE_EDGE] vectorized
+                                                              PARTITION_ONLY_SHUFFLE [RS_498]
+                                                                Group By Operator [GBY_492] (rows=1 width=12)
+                                                                  Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                                                  Select Operator [SEL_486] (rows=652 width=4)
+                                                                    Output:["_col0"]
+                                                                     Please refer to the previous Select Operator [SEL_474]
+                            <-Reducer 6 [ONE_TO_ONE_EDGE]
+                              FORWARD [RS_123]
+                                PartitionCols:_col2
+                                Merge Join Operator [MERGEJOIN_463] (rows=20485011 width=444)
+                                  Conds:RS_120._col2=RS_527._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col6","_col7"]
+                                <-Reducer 18 [SIMPLE_EDGE] vectorized
+                                  SHUFFLE [RS_527]
+                                    PartitionCols:_col0
+                                    Select Operator [SEL_526] (rows=17130654 width=216)
+                                      Output:["_col0","_col1","_col2"]
+                                      Filter Operator [FIL_525] (rows=17130654 width=212)
+                                        predicate:(_col7 > 0)
+                                        Select Operator [SEL_524] (rows=51391963 width=212)
+                                          Output:["_col0","_col7"]
+                                          Group By Operator [GBY_523] (rows=51391963 width=764)
+                                            Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4, KEY._col5, KEY._col6
+                                          <-Reducer 17 [SIMPLE_EDGE]
+                                            SHUFFLE [RS_55]
+                                              PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5, _col6
+                                              Group By Operator [GBY_54] (rows=51391963 width=764)
+                                                Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(_col2)"],keys:_col5, _col6, _col7, _col8, _col9, _col10, _col11
+                                                Merge Join Operator [MERGEJOIN_455] (rows=51391963 width=764)
+                                                  Conds:RS_50._col1=RS_507._col0(Inner),Output:["_col2","_col5","_col6","_col7","_col8","_col9","_col10","_col11"]
+                                                <-Map 38 [SIMPLE_EDGE] vectorized
+                                                  SHUFFLE [RS_507]
+                                                    PartitionCols:_col0
+                                                     Please refer to the previous Select Operator [SEL_502]
+                                                <-Reducer 16 [SIMPLE_EDGE]
+                                                  SHUFFLE [RS_50]
+                                                    PartitionCols:_col1
+                                                    Merge Join Operator [MERGEJOIN_454] (rows=51391963 width=115)
+                                                      Conds:RS_47._col0=RS_483._col0(Inner),Output:["_col1","_col2"]
+                                                    <-Map 31 [SIMPLE_EDGE] vectorized
+                                                      PARTITION_ONLY_SHUFFLE [RS_483]
+                                                        PartitionCols:_col0
+                                                        Select Operator [SEL_473] (rows=652 width=4)
+                                                          Output:["_col0"]
+                                                          Filter Operator [FIL_469] (rows=652 width=8)
+                                                            predicate:(d_year = 2001)
+                                                             Please refer to the previous TableScan [TS_101]
+                                                    <-Map 15 [SIMPLE_EDGE]
+                                                      SHUFFLE [RS_47]
+                                                        PartitionCols:_col0
+                                                        Select Operator [SEL_41] (rows=143930993 width=119)
+                                                          Output:["_col0","_col1","_col2"]
+                                                          Filter Operator [FIL_235] (rows=143930993 width=455)
+                                                            predicate:((ws_sold_date_sk BETWEEN DynamicValue(RS_48_date_dim_d_date_sk_min) AND DynamicValue(RS_48_date_dim_d_date_sk_max) and in_bloom_filter(ws_sold_date_sk, DynamicValue(RS_48_date_dim_d_date_sk_bloom_filter))) and ws_bill_customer_sk is not null and ws_sold_date_sk is not null)
+                                                            TableScan [TS_39] (rows=144002668 width=455)
+                                                              default@web_sales,web_sales,Tbl:COMPLETE,Col:COMPLETE,Output:["ws_sold_date_sk","ws_bill_customer_sk","ws_ext_discount_amt","ws_ext_sales_price","ws_ext_wholesale_cost","ws_ext_list_price"]
+                                                            <-Reducer 36 [BROADCAST_EDGE] vectorized
+                                                              BROADCAST [RS_521]
+                                                                Group By Operator [GBY_520] (rows=1 width=12)
+                                                                  Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
+                                                                <-Map 31 [CUSTOM_SIMPLE_EDGE] vectorized
+                                                                  PARTITION_ONLY_SHUFFLE [RS_497]
+                                                                    Group By Operator [GBY_491] (rows=1 width=12)
+                                                                      Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                                                      Select Operator [SEL_484] (rows=652 width=4)
+                                                                        Output:["_col0"]
+                                                                         Please refer to the previous Select Operator [SEL_473]
+                                <-Reducer 5 [ONE_TO_ONE_EDGE]
+                                  FORWARD [RS_120]
+                                    PartitionCols:_col2
+                                    Merge Join Operator [MERGEJOIN_462] (rows=31888273 width=328)
+                                      Conds:RS_511._col0=RS_519._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
+                                    <-Reducer 14 [SIMPLE_EDGE] vectorized
+                                      SHUFFLE [RS_519]
+                                        PartitionCols:_col0
+                                        Select Operator [SEL_518] (rows=26666666 width=216)
+                                          Output:["_col0","_col1","_col2"]
+                                          Filter Operator [FIL_517] (rows=26666666 width=212)
+                                            predicate:(_col7 > 0)
+                                            Select Operator [SEL_516] (rows=80000000 width=212)
+                                              Output:["_col0","_col7"]
+                                              Group By Operator [GBY_515] (rows=80000000 width=764)
+                                                Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4, KEY._col5, KEY._col6
+                                              <-Reducer 13 [SIMPLE_EDGE]
+                                                SHUFFLE [RS_35]
+                                                  PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5, _col6
+                                                  Group By Operator [GBY_34] (rows=80000000 width=764)
+                                                    Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(_col2)"],keys:_col5, _col6, _col7, _col8, _col9, _col10, _col11
+                                                    Merge Join Operator [MERGEJOIN_453] (rows=187573258 width=764)
+                                                      Conds:RS_30._col1=RS_506._col0(Inner),Output:["_col2","_col5","_col6","_col7","_col8","_col9","_col10","_col11"]
+                                                    <-Map 38 [SIMPLE_EDGE] vectorized
+                                                      SHUFFLE [RS_506]
+                                                        PartitionCols:_col0
+                                                         Please refer to the previous Select Operator [SEL_502]
+                                                    <-Reducer 12 [SIMPLE_EDGE]
+                                                      SHUFFLE [RS_30]
+                                                        PartitionCols:_col1
+                                                        Merge Join Operator [MERGEJOIN_452] (rows=187573258 width=115)
+                                                          Conds:RS_27._col0=RS_481._col0(Inner),Output:["_col1","_col2"]
+                                                        <-Map 31 [SIMPLE_EDGE] vectorized
+                                                          PARTITION_ONLY_SHUFFLE [RS_481]
+                                                            PartitionCols:_col0
+                                                            Select Operator [SEL_472] (rows=652 width=4)
+                                                              Output:["_col0"]
+                                                              Filter Operator [FIL_468] (rows=652 width=8)
+                                                                predicate:(d_year = 2001)
+                                                                 Please refer to the previous TableScan [TS_101]
+                                                        <-Map 11 [SIMPLE_EDGE]
+                                                          SHUFFLE [RS_27]
+                                                            PartitionCols:_col0
+                                                            Select Operator [SEL_21] (rows=525327388 width=119)
+                                                              Output:["_col0","_col1","_col2"]
+                                                              Filter Operator [FIL_232] (rows=525327388 width=435)
+                                                                predicate:((ss_sold_date_sk BETWEEN DynamicValue(RS_28_date_dim_d_date_sk_min) AND DynamicValue(RS_28_date_dim_d_date_sk_max) and in_bloom_filter(ss_sold_date_sk, DynamicValue(RS_28_date_dim_d_date_sk_bloom_filter))) and ss_customer_sk is not null and ss_sold_date_sk is not null)
+                                                                TableScan [TS_19] (rows=575995635 width=435)
+                                                                  default@store_sales,store_sales,Tbl:COMPLETE,Col:COMPLETE,Output:["ss_sold_date_sk","ss_customer_sk","ss_ext_discount_amt","ss_ext_sales_price","ss_ext_wholesale_cost","ss_ext_list_price"]
+                                                                <-Reducer 35 [BROADCAST_EDGE] vectorized
+                                                                  BROADCAST [RS_513]
+                                                                    Group By Operator [GBY_512] (rows=1 width=12)
+                                                                      Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
+                                                                    <-Map 31 [CUSTOM_SIMPLE_EDGE] vectorized
+                                                                      PARTITION_ONLY_SHUFFLE [RS_496]
+                                                                        Group By Operator [GBY_490] (rows=1 width=12)
+                                                                          Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                                                          Select Operator [SEL_482] (rows=652 width=4)
+                                                                            Output:["_col0"]
+                                                                             Please refer to the previous Select Operator [SEL_472]
+                                    <-Reducer 4 [SIMPLE_EDGE] vectorized
+                                      SHUFFLE [RS_511]
+                                        PartitionCols:_col0
+                                        Select Operator [SEL_510] (rows=51391963 width=212)
+                                          Output:["_col0","_col1"]
+                                          Group By Operator [GBY_509] (rows=51391963 width=764)
+                                            Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4, KEY._col5, KEY._col6
+                                          <-Reducer 3 [SIMPLE_EDGE]
+                                            SHUFFLE [RS_16]
+                                              PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5, _col6
+                                              Group By Operator [GBY_15] (rows=51391963 width=764)
+                                                Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(_col2)"],keys:_col5, _col6, _col7, _col8, _col9, _col10, _col11
+                                                Merge Join Operator [MERGEJOIN_451] (rows=51391963 width=764)
+                                                  Conds:RS_11._col1=RS_505._col0(Inner),Output:["_col2","_col5","_col6","_col7","_col8","_col9","_col10","_col11"]
+                                                <-Map 38 [SIMPLE_EDGE] vectorized
+                                                  SHUFFLE [RS_505]
+                                                    PartitionCols:_col0
+                                                     Please refer to the previous Select Operator [SEL_502]
+                                                <-Reducer 2 [SIMPLE_EDGE]
+                                                  SHUFFLE [RS_11]
+                                                    PartitionCols:_col1
+                                                    Merge Join Operator [MERGEJOIN_450] (rows=51391963 width=115)
+                                                      Conds:RS_8._col0=RS_479._col0(Inner),Output:["_col1","_col2"]
+                                                    <-Map 31 [SIMPLE_EDGE] vectorized
+                                                      PARTITION_ONLY_SHUFFLE [RS_479]
+                                                        PartitionCols:_col0
+                                                         Please refer to the previous Select Operator [SEL_471]
+                                                    <-Map 1 [SIMPLE_EDGE]
+                                                      SHUFFLE [RS_8]
+                                                        PartitionCols:_col0
+                                                        Select Operator [SEL_2] (rows=143930993 width=119)
+                                                          Output:["_col0","_col1","_col2"]
+                                                          Filter Operator [FIL_229] (rows=143930993 width=455)
+                                                            predicate:((ws_sold_date_sk BETWEEN DynamicValue(RS_9_date_dim_d_date_sk_min) AND DynamicValue(RS_9_date_dim_d_date_sk_max) and in_bloom_filter(ws_sold_date_sk, DynamicValue(RS_9_date_dim_d_date_sk_bloom_filter))) and ws_bill_customer_sk is not null and ws_sold_date_sk is not null)
+                                                            TableScan [TS_0] (rows=144002668 width=455)
+                                                              default@web_sales,web_sales,Tbl:COMPLETE,Col:COMPLETE,Output:["ws_sold_date_sk","ws_bill_customer_sk","ws_ext_discount_amt","ws_ext_sales_price","ws_ext_wholesale_cost","ws_ext_list_price"]
+                                                            <-Reducer 34 [BROADCAST_EDGE] vectorized
+                                                              BROADCAST [RS_500]
+                                                                Group By Operator [GBY_499] (rows=1 width=12)
+                                                                  Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
+                                                                <-Map 31 [CUSTOM_SIMPLE_EDGE] vectorized
+                                                                  PARTITION_ONLY_SHUFFLE [RS_495]
+                                                                    Group By Operator [GBY_489] (rows=1 width=12)
+                                                                      Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                                                      Select Operator [SEL_480] (rows=652 width=4)
+                                                                        Output:["_col0"]
+                                                                         Please refer to the previous Select Operator [SEL_471]
+

http://git-wip-us.apache.org/repos/asf/hive/blob/b8299551/ql/src/test/results/clientpositive/perf/tez/constraints/query40.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query40.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query40.q.out
new file mode 100644
index 0000000..c05256f
--- /dev/null
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query40.q.out
@@ -0,0 +1,183 @@
+PREHOOK: query: explain
+select  
+   w_state
+  ,i_item_id
+  ,sum(case when (cast(d_date as date) < cast ('1998-04-08' as date)) 
+ 		then cs_sales_price - coalesce(cr_refunded_cash,0) else 0 end) as sales_before
+  ,sum(case when (cast(d_date as date) >= cast ('1998-04-08' as date)) 
+ 		then cs_sales_price - coalesce(cr_refunded_cash,0) else 0 end) as sales_after
+ from
+   catalog_sales left outer join catalog_returns on
+       (cs_order_number = cr_order_number 
+        and cs_item_sk = cr_item_sk)
+  ,warehouse 
+  ,item
+  ,date_dim
+ where
+     i_current_price between 0.99 and 1.49
+ and i_item_sk          = cs_item_sk
+ and cs_warehouse_sk    = w_warehouse_sk 
+ and cs_sold_date_sk    = d_date_sk
+ and d_date between (cast ('1998-04-08' as date) - 30 days)
+                and (cast ('1998-04-08' as date) + 30 days) 
+ group by
+    w_state,i_item_id
+ order by w_state,i_item_id
+limit 100
+PREHOOK: type: QUERY
+PREHOOK: Input: default@catalog_returns
+PREHOOK: Input: default@catalog_sales
+PREHOOK: Input: default@date_dim
+PREHOOK: Input: default@item
+PREHOOK: Input: default@warehouse
+PREHOOK: Output: hdfs://### HDFS PATH ###
+POSTHOOK: query: explain
+select  
+   w_state
+  ,i_item_id
+  ,sum(case when (cast(d_date as date) < cast ('1998-04-08' as date)) 
+ 		then cs_sales_price - coalesce(cr_refunded_cash,0) else 0 end) as sales_before
+  ,sum(case when (cast(d_date as date) >= cast ('1998-04-08' as date)) 
+ 		then cs_sales_price - coalesce(cr_refunded_cash,0) else 0 end) as sales_after
+ from
+   catalog_sales left outer join catalog_returns on
+       (cs_order_number = cr_order_number 
+        and cs_item_sk = cr_item_sk)
+  ,warehouse 
+  ,item
+  ,date_dim
+ where
+     i_current_price between 0.99 and 1.49
+ and i_item_sk          = cs_item_sk
+ and cs_warehouse_sk    = w_warehouse_sk 
+ and cs_sold_date_sk    = d_date_sk
+ and d_date between (cast ('1998-04-08' as date) - 30 days)
+                and (cast ('1998-04-08' as date) + 30 days) 
+ group by
+    w_state,i_item_id
+ order by w_state,i_item_id
+limit 100
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@catalog_returns
+POSTHOOK: Input: default@catalog_sales
+POSTHOOK: Input: default@date_dim
+POSTHOOK: Input: default@item
+POSTHOOK: Input: default@warehouse
+POSTHOOK: Output: hdfs://### HDFS PATH ###
+Plan optimized by CBO.
+
+Vertex dependency in root stage
+Map 1 <- Reducer 10 (BROADCAST_EDGE), Reducer 12 (BROADCAST_EDGE)
+Reducer 10 <- Map 9 (CUSTOM_SIMPLE_EDGE)
+Reducer 12 <- Map 11 (CUSTOM_SIMPLE_EDGE)
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 8 (SIMPLE_EDGE)
+Reducer 3 <- Map 9 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
+Reducer 4 <- Map 11 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
+Reducer 5 <- Map 13 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE)
+Reducer 6 <- Reducer 5 (SIMPLE_EDGE)
+Reducer 7 <- Reducer 6 (SIMPLE_EDGE)
+
+Stage-0
+  Fetch Operator
+    limit:100
+    Stage-1
+      Reducer 7 vectorized
+      File Output Operator [FS_127]
+        Limit [LIM_126] (rows=100 width=410)
+          Number of rows:100
+          Select Operator [SEL_125] (rows=769995 width=410)
+            Output:["_col0","_col1","_col2","_col3"]
+          <-Reducer 6 [SIMPLE_EDGE] vectorized
+            SHUFFLE [RS_124]
+              Group By Operator [GBY_123] (rows=769995 width=410)
+                Output:["_col0","_col1","_col2","_col3"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)"],keys:KEY._col0, KEY._col1
+              <-Reducer 5 [SIMPLE_EDGE]
+                SHUFFLE [RS_28]
+                  PartitionCols:_col0, _col1
+                  Group By Operator [GBY_27] (rows=5757278 width=410)
+                    Output:["_col0","_col1","_col2","_col3"],aggregations:["sum(_col2)","sum(_col3)"],keys:_col0, _col1
+                    Top N Key Operator [TNK_53] (rows=5757278 width=278)
+                      keys:_col0, _col1,sort order:++,top n:100
+                      Select Operator [SEL_25] (rows=5757278 width=278)
+                        Output:["_col0","_col1","_col2","_col3"]
+                        Merge Join Operator [MERGEJOIN_99] (rows=5757278 width=278)
+                          Conds:RS_22._col1=RS_122._col0(Inner),Output:["_col4","_col7","_col9","_col10","_col12","_col14"]
+                        <-Map 13 [SIMPLE_EDGE] vectorized
+                          SHUFFLE [RS_122]
+                            PartitionCols:_col0
+                            Select Operator [SEL_121] (rows=27 width=90)
+                              Output:["_col0","_col1"]
+                              TableScan [TS_11] (rows=27 width=90)
+                                default@warehouse,warehouse,Tbl:COMPLETE,Col:COMPLETE,Output:["w_warehouse_sk","w_state"]
+                        <-Reducer 4 [SIMPLE_EDGE]
+                          SHUFFLE [RS_22]
+                            PartitionCols:_col1
+                            Merge Join Operator [MERGEJOIN_98] (rows=5757278 width=195)
+                              Conds:RS_19._col2=RS_110._col0(Inner),Output:["_col1","_col4","_col7","_col9","_col10","_col12"]
+                            <-Map 11 [SIMPLE_EDGE] vectorized
+                              SHUFFLE [RS_110]
+                                PartitionCols:_col0
+                                Select Operator [SEL_109] (rows=51333 width=104)
+                                  Output:["_col0","_col1"]
+                                  Filter Operator [FIL_108] (rows=51333 width=215)
+                                    predicate:i_current_price BETWEEN 0.99 AND 1.49
+                                    TableScan [TS_8] (rows=462000 width=215)
+                                      default@item,item,Tbl:COMPLETE,Col:COMPLETE,Output:["i_item_sk","i_item_id","i_current_price"]
+                            <-Reducer 3 [SIMPLE_EDGE]
+                              SHUFFLE [RS_19]
+                                PartitionCols:_col2
+                                Merge Join Operator [MERGEJOIN_97] (rows=51815831 width=124)
+                                  Conds:RS_16._col0=RS_102._col0(Inner),Output:["_col1","_col2","_col4","_col7","_col9","_col10"]
+                                <-Map 9 [SIMPLE_EDGE] vectorized
+                                  SHUFFLE [RS_102]
+                                    PartitionCols:_col0
+                                    Select Operator [SEL_101] (rows=8116 width=12)
+                                      Output:["_col0","_col1","_col2"]
+                                      Filter Operator [FIL_100] (rows=8116 width=98)
+                                        predicate:CAST( d_date AS TIMESTAMP) BETWEEN TIMESTAMP'1998-03-09 00:00:00' AND TIMESTAMP'1998-05-08 00:00:00'
+                                        TableScan [TS_5] (rows=73049 width=98)
+                                          default@date_dim,date_dim,Tbl:COMPLETE,Col:COMPLETE,Output:["d_date_sk","d_date"]
+                                <-Reducer 2 [SIMPLE_EDGE]
+                                  SHUFFLE [RS_16]
+                                    PartitionCols:_col0
+                                    Merge Join Operator [MERGEJOIN_96] (rows=466374405 width=167)
+                                      Conds:RS_118._col2, _col3=RS_120._col0, _col1(Left Outer),Output:["_col0","_col1","_col2","_col4","_col7"]
+                                    <-Map 1 [SIMPLE_EDGE] vectorized
+                                      SHUFFLE [RS_118]
+                                        PartitionCols:_col2, _col3
+                                        Select Operator [SEL_117] (rows=285115816 width=127)
+                                          Output:["_col0","_col1","_col2","_col3","_col4"]
+                                          Filter Operator [FIL_116] (rows=285115816 width=127)
+                                            predicate:((cs_item_sk BETWEEN DynamicValue(RS_20_item_i_item_sk_min) AND DynamicValue(RS_20_item_i_item_sk_max) and in_bloom_filter(cs_item_sk, DynamicValue(RS_20_item_i_item_sk_bloom_filter))) and (cs_sold_date_sk BETWEEN DynamicValue(RS_17_date_dim_d_date_sk_min) AND DynamicValue(RS_17_date_dim_d_date_sk_max) and in_bloom_filter(cs_sold_date_sk, DynamicValue(RS_17_date_dim_d_date_sk_bloom_filter))) and cs_sold_date_sk is not null and cs_warehouse_sk is not null)
+                                            TableScan [TS_0] (rows=287989836 width=127)
+                                              default@catalog_sales,catalog_sales,Tbl:COMPLETE,Col:COMPLETE,Output:["cs_sold_date_sk","cs_warehouse_sk","cs_item_sk","cs_order_number","cs_sales_price"]
+                                            <-Reducer 10 [BROADCAST_EDGE] vectorized
+                                              BROADCAST [RS_107]
+                                                Group By Operator [GBY_106] (rows=1 width=12)
+                                                  Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
+                                                <-Map 9 [CUSTOM_SIMPLE_EDGE] vectorized
+                                                  SHUFFLE [RS_105]
+                                                    Group By Operator [GBY_104] (rows=1 width=12)
+                                                      Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                                      Select Operator [SEL_103] (rows=8116 width=4)
+                                                        Output:["_col0"]
+                                                         Please refer to the previous Select Operator [SEL_101]
+                                            <-Reducer 12 [BROADCAST_EDGE] vectorized
+                                              BROADCAST [RS_115]
+                                                Group By Operator [GBY_114] (rows=1 width=12)
+                                                  Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
+                                                <-Map 11 [CUSTOM_SIMPLE_EDGE] vectorized
+                                                  SHUFFLE [RS_113]
+                                                    Group By Operator [GBY_112] (rows=1 width=12)
+                                                      Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                                      Select Operator [SEL_111] (rows=51333 width=4)
+                                                        Output:["_col0"]
+                                                         Please refer to the previous Select Operator [SEL_109]
+                                    <-Map 8 [SIMPLE_EDGE] vectorized
+                                      SHUFFLE [RS_120]
+                                        PartitionCols:_col0, _col1
+                                        Select Operator [SEL_119] (rows=28798881 width=117)
+                                          Output:["_col0","_col1","_col2"]
+                                          TableScan [TS_3] (rows=28798881 width=117)
+                                            default@catalog_returns,catalog_returns,Tbl:COMPLETE,Col:COMPLETE,Output:["cr_item_sk","cr_order_number","cr_refunded_cash"]
+

http://git-wip-us.apache.org/repos/asf/hive/blob/b8299551/ql/src/test/results/clientpositive/perf/tez/constraints/query42.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query42.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query42.q.out
new file mode 100644
index 0000000..02b9f7c
--- /dev/null
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query42.q.out
@@ -0,0 +1,139 @@
+PREHOOK: query: explain
+select  dt.d_year
+ 	,item.i_category_id
+ 	,item.i_category
+ 	,sum(ss_ext_sales_price)
+ from 	date_dim dt
+ 	,store_sales
+ 	,item
+ where dt.d_date_sk = store_sales.ss_sold_date_sk
+ 	and store_sales.ss_item_sk = item.i_item_sk
+ 	and item.i_manager_id = 1  	
+ 	and dt.d_moy=12
+ 	and dt.d_year=1998
+ group by 	dt.d_year
+ 		,item.i_category_id
+ 		,item.i_category
+ order by       sum(ss_ext_sales_price) desc,dt.d_year
+ 		,item.i_category_id
+ 		,item.i_category
+limit 100
+PREHOOK: type: QUERY
+PREHOOK: Input: default@date_dim
+PREHOOK: Input: default@item
+PREHOOK: Input: default@store_sales
+PREHOOK: Output: hdfs://### HDFS PATH ###
+POSTHOOK: query: explain
+select  dt.d_year
+ 	,item.i_category_id
+ 	,item.i_category
+ 	,sum(ss_ext_sales_price)
+ from 	date_dim dt
+ 	,store_sales
+ 	,item
+ where dt.d_date_sk = store_sales.ss_sold_date_sk
+ 	and store_sales.ss_item_sk = item.i_item_sk
+ 	and item.i_manager_id = 1  	
+ 	and dt.d_moy=12
+ 	and dt.d_year=1998
+ group by 	dt.d_year
+ 		,item.i_category_id
+ 		,item.i_category
+ order by       sum(ss_ext_sales_price) desc,dt.d_year
+ 		,item.i_category_id
+ 		,item.i_category
+limit 100
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@date_dim
+POSTHOOK: Input: default@item
+POSTHOOK: Input: default@store_sales
+POSTHOOK: Output: hdfs://### HDFS PATH ###
+Plan optimized by CBO.
+
+Vertex dependency in root stage
+Map 1 <- Reducer 7 (BROADCAST_EDGE), Reducer 9 (BROADCAST_EDGE)
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 6 (SIMPLE_EDGE)
+Reducer 3 <- Map 8 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
+Reducer 4 <- Reducer 3 (SIMPLE_EDGE)
+Reducer 5 <- Reducer 4 (SIMPLE_EDGE)
+Reducer 7 <- Map 6 (CUSTOM_SIMPLE_EDGE)
+Reducer 9 <- Map 8 (CUSTOM_SIMPLE_EDGE)
+
+Stage-0
+  Fetch Operator
+    limit:100
+    Stage-1
+      Reducer 5 vectorized
+      File Output Operator [FS_79]
+        Limit [LIM_78] (rows=100 width=210)
+          Number of rows:100
+          Select Operator [SEL_77] (rows=110 width=210)
+            Output:["_col0","_col1","_col2","_col3"]
+          <-Reducer 4 [SIMPLE_EDGE] vectorized
+            SHUFFLE [RS_76]
+              Select Operator [SEL_75] (rows=110 width=318)
+                Output:["_col0","_col1","_col3"]
+                Group By Operator [GBY_74] (rows=110 width=206)
+                  Output:["_col0","_col1","_col2"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1
+                <-Reducer 3 [SIMPLE_EDGE]
+                  SHUFFLE [RS_17]
+                    PartitionCols:_col0, _col1
+                    Group By Operator [GBY_16] (rows=120 width=206)
+                      Output:["_col0","_col1","_col2"],aggregations:["sum(_col2)"],keys:_col5, _col6
+                      Merge Join Operator [MERGEJOIN_54] (rows=2301098 width=94)
+                        Conds:RS_12._col1=RS_65._col0(Inner),Output:["_col2","_col5","_col6"]
+                      <-Map 8 [SIMPLE_EDGE] vectorized
+                        PARTITION_ONLY_SHUFFLE [RS_65]
+                          PartitionCols:_col0
+                          Select Operator [SEL_64] (rows=7333 width=97)
+                            Output:["_col0","_col1","_col2"]
+                            Filter Operator [FIL_63] (rows=7333 width=101)
+                              predicate:(i_manager_id = 1)
+                              TableScan [TS_6] (rows=462000 width=101)
+                                default@item,item,Tbl:COMPLETE,Col:COMPLETE,Output:["i_item_sk","i_category_id","i_category","i_manager_id"]
+                      <-Reducer 2 [SIMPLE_EDGE]
+                        SHUFFLE [RS_12]
+                          PartitionCols:_col1
+                          Merge Join Operator [MERGEJOIN_53] (rows=15062131 width=4)
+                            Conds:RS_73._col0=RS_57._col0(Inner),Output:["_col1","_col2"]
+                          <-Map 6 [SIMPLE_EDGE] vectorized
+                            PARTITION_ONLY_SHUFFLE [RS_57]
+                              PartitionCols:_col0
+                              Select Operator [SEL_56] (rows=50 width=4)
+                                Output:["_col0"]
+                                Filter Operator [FIL_55] (rows=50 width=12)
+                                  predicate:((d_moy = 12) and (d_year = 1998))
+                                  TableScan [TS_3] (rows=73049 width=12)
+                                    default@date_dim,dt,Tbl:COMPLETE,Col:COMPLETE,Output:["d_date_sk","d_year","d_moy"]
+                          <-Map 1 [SIMPLE_EDGE] vectorized
+                            SHUFFLE [RS_73]
+                              PartitionCols:_col0
+                              Select Operator [SEL_72] (rows=550076554 width=114)
+                                Output:["_col0","_col1","_col2"]
+                                Filter Operator [FIL_71] (rows=550076554 width=114)
+                                  predicate:((ss_item_sk BETWEEN DynamicValue(RS_13_item_i_item_sk_min) AND DynamicValue(RS_13_item_i_item_sk_max) and in_bloom_filter(ss_item_sk, DynamicValue(RS_13_item_i_item_sk_bloom_filter))) and (ss_sold_date_sk BETWEEN DynamicValue(RS_10_dt_d_date_sk_min) AND DynamicValue(RS_10_dt_d_date_sk_max) and in_bloom_filter(ss_sold_date_sk, DynamicValue(RS_10_dt_d_date_sk_bloom_filter))) and ss_sold_date_sk is not null)
+                                  TableScan [TS_0] (rows=575995635 width=114)
+                                    default@store_sales,store_sales,Tbl:COMPLETE,Col:COMPLETE,Output:["ss_sold_date_sk","ss_item_sk","ss_ext_sales_price"]
+                                  <-Reducer 7 [BROADCAST_EDGE] vectorized
+                                    BROADCAST [RS_62]
+                                      Group By Operator [GBY_61] (rows=1 width=12)
+                                        Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
+                                      <-Map 6 [CUSTOM_SIMPLE_EDGE] vectorized
+                                        PARTITION_ONLY_SHUFFLE [RS_60]
+                                          Group By Operator [GBY_59] (rows=1 width=12)
+                                            Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                            Select Operator [SEL_58] (rows=50 width=4)
+                                              Output:["_col0"]
+                                               Please refer to the previous Select Operator [SEL_56]
+                                  <-Reducer 9 [BROADCAST_EDGE] vectorized
+                                    BROADCAST [RS_70]
+                                      Group By Operator [GBY_69] (rows=1 width=12)
+                                        Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
+                                      <-Map 8 [CUSTOM_SIMPLE_EDGE] vectorized
+                                        PARTITION_ONLY_SHUFFLE [RS_68]
+                                          Group By Operator [GBY_67] (rows=1 width=12)
+                                            Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                            Select Operator [SEL_66] (rows=7333 width=4)
+                                              Output:["_col0"]
+                                               Please refer to the previous Select Operator [SEL_64]
+