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:27 UTC

[17/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/query43.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query43.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query43.q.out
new file mode 100644
index 0000000..495b6bd
--- /dev/null
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query43.q.out
@@ -0,0 +1,135 @@
+PREHOOK: query: explain
+select  s_store_name, s_store_id,
+        sum(case when (d_day_name='Sunday') then ss_sales_price else null end) sun_sales,
+        sum(case when (d_day_name='Monday') then ss_sales_price else null end) mon_sales,
+        sum(case when (d_day_name='Tuesday') then ss_sales_price else  null end) tue_sales,
+        sum(case when (d_day_name='Wednesday') then ss_sales_price else null end) wed_sales,
+        sum(case when (d_day_name='Thursday') then ss_sales_price else null end) thu_sales,
+        sum(case when (d_day_name='Friday') then ss_sales_price else null end) fri_sales,
+        sum(case when (d_day_name='Saturday') then ss_sales_price else null end) sat_sales
+ from date_dim, store_sales, store
+ where d_date_sk = ss_sold_date_sk and
+       s_store_sk = ss_store_sk and
+       s_gmt_offset = -6 and
+       d_year = 1998 
+ group by s_store_name, s_store_id
+ order by s_store_name, s_store_id,sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales
+ limit 100
+PREHOOK: type: QUERY
+PREHOOK: Input: default@date_dim
+PREHOOK: Input: default@store
+PREHOOK: Input: default@store_sales
+PREHOOK: Output: hdfs://### HDFS PATH ###
+POSTHOOK: query: explain
+select  s_store_name, s_store_id,
+        sum(case when (d_day_name='Sunday') then ss_sales_price else null end) sun_sales,
+        sum(case when (d_day_name='Monday') then ss_sales_price else null end) mon_sales,
+        sum(case when (d_day_name='Tuesday') then ss_sales_price else  null end) tue_sales,
+        sum(case when (d_day_name='Wednesday') then ss_sales_price else null end) wed_sales,
+        sum(case when (d_day_name='Thursday') then ss_sales_price else null end) thu_sales,
+        sum(case when (d_day_name='Friday') then ss_sales_price else null end) fri_sales,
+        sum(case when (d_day_name='Saturday') then ss_sales_price else null end) sat_sales
+ from date_dim, store_sales, store
+ where d_date_sk = ss_sold_date_sk and
+       s_store_sk = ss_store_sk and
+       s_gmt_offset = -6 and
+       d_year = 1998 
+ group by s_store_name, s_store_id
+ order by s_store_name, s_store_id,sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales
+ limit 100
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@date_dim
+POSTHOOK: Input: default@store
+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=972)
+          Number of rows:100
+          Select Operator [SEL_77] (rows=3751 width=972)
+            Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8"]
+          <-Reducer 4 [SIMPLE_EDGE] vectorized
+            SHUFFLE [RS_76]
+              Group By Operator [GBY_75] (rows=3751 width=972)
+                Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)","sum(VALUE._col3)","sum(VALUE._col4)","sum(VALUE._col5)","sum(VALUE._col6)"],keys:KEY._col0, KEY._col1
+              <-Reducer 3 [SIMPLE_EDGE]
+                SHUFFLE [RS_18]
+                  PartitionCols:_col0, _col1
+                  Group By Operator [GBY_17] (rows=142538 width=972)
+                    Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8"],aggregations:["sum(_col2)","sum(_col3)","sum(_col4)","sum(_col5)","sum(_col6)","sum(_col7)","sum(_col8)"],keys:_col0, _col1
+                    Top N Key Operator [TNK_33] (rows=37536846 width=257)
+                      keys:_col0, _col1,sort order:++,top n:100
+                      Select Operator [SEL_15] (rows=37536846 width=257)
+                        Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8"]
+                        Merge Join Operator [MERGEJOIN_55] (rows=37536846 width=257)
+                          Conds:RS_12._col1=RS_66._col0(Inner),Output:["_col2","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col12","_col13"]
+                        <-Map 8 [SIMPLE_EDGE] vectorized
+                          PARTITION_ONLY_SHUFFLE [RS_66]
+                            PartitionCols:_col0
+                            Select Operator [SEL_65] (rows=341 width=192)
+                              Output:["_col0","_col1","_col2"]
+                              Filter Operator [FIL_64] (rows=341 width=303)
+                                predicate:(s_gmt_offset = -6)
+                                TableScan [TS_6] (rows=1704 width=303)
+                                  default@store,store,Tbl:COMPLETE,Col:COMPLETE,Output:["s_store_sk","s_store_id","s_store_name","s_gmt_offset"]
+                        <-Reducer 2 [SIMPLE_EDGE]
+                          SHUFFLE [RS_12]
+                            PartitionCols:_col1
+                            Merge Join Operator [MERGEJOIN_54] (rows=187574154 width=129)
+                              Conds:RS_74._col0=RS_58._col0(Inner),Output:["_col1","_col2","_col4","_col5","_col6","_col7","_col8","_col9","_col10"]
+                            <-Map 6 [SIMPLE_EDGE] vectorized
+                              PARTITION_ONLY_SHUFFLE [RS_58]
+                                PartitionCols:_col0
+                                Select Operator [SEL_57] (rows=652 width=32)
+                                  Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
+                                  Filter Operator [FIL_56] (rows=652 width=99)
+                                    predicate:(d_year = 1998)
+                                    TableScan [TS_3] (rows=73049 width=99)
+                                      default@date_dim,date_dim,Tbl:COMPLETE,Col:COMPLETE,Output:["d_date_sk","d_year","d_day_name"]
+                            <-Map 1 [SIMPLE_EDGE] vectorized
+                              SHUFFLE [RS_74]
+                                PartitionCols:_col0
+                                Select Operator [SEL_73] (rows=525329897 width=114)
+                                  Output:["_col0","_col1","_col2"]
+                                  Filter Operator [FIL_72] (rows=525329897 width=114)
+                                    predicate:((ss_sold_date_sk BETWEEN DynamicValue(RS_10_date_dim_d_date_sk_min) AND DynamicValue(RS_10_date_dim_d_date_sk_max) and in_bloom_filter(ss_sold_date_sk, DynamicValue(RS_10_date_dim_d_date_sk_bloom_filter))) and (ss_store_sk BETWEEN DynamicValue(RS_13_store_s_store_sk_min) AND DynamicValue(RS_13_store_s_store_sk_max) and in_bloom_filter(ss_store_sk, DynamicValue(RS_13_store_s_store_sk_bloom_filter))) and ss_sold_date_sk is not null and ss_store_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_store_sk","ss_sales_price"]
+                                    <-Reducer 7 [BROADCAST_EDGE] vectorized
+                                      BROADCAST [RS_63]
+                                        Group By Operator [GBY_62] (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_61]
+                                            Group By Operator [GBY_60] (rows=1 width=12)
+                                              Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                              Select Operator [SEL_59] (rows=652 width=4)
+                                                Output:["_col0"]
+                                                 Please refer to the previous Select Operator [SEL_57]
+                                    <-Reducer 9 [BROADCAST_EDGE] vectorized
+                                      BROADCAST [RS_71]
+                                        Group By Operator [GBY_70] (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_69]
+                                            Group By Operator [GBY_68] (rows=1 width=12)
+                                              Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                              Select Operator [SEL_67] (rows=341 width=4)
+                                                Output:["_col0"]
+                                                 Please refer to the previous Select Operator [SEL_65]
+

http://git-wip-us.apache.org/repos/asf/hive/blob/b8299551/ql/src/test/results/clientpositive/perf/tez/constraints/query44.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query44.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query44.q.out
new file mode 100644
index 0000000..13b0936
--- /dev/null
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query44.q.out
@@ -0,0 +1,193 @@
+Warning: Shuffle Join MERGEJOIN[101][tables = [$hdt$_1, $hdt$_2]] in Stage 'Reducer 8' is a cross product
+PREHOOK: query: explain
+select  asceding.rnk, i1.i_product_name best_performing, i2.i_product_name worst_performing
+from(select *
+     from (select item_sk,rank() over (order by rank_col asc) rnk
+           from (select ss_item_sk item_sk,avg(ss_net_profit) rank_col 
+                 from store_sales ss1
+                 where ss_store_sk = 410
+                 group by ss_item_sk
+                 having avg(ss_net_profit) > 0.9*(select avg(ss_net_profit) rank_col
+                                                  from store_sales
+                                                  where ss_store_sk = 410
+                                                    and ss_hdemo_sk is null
+                                                  group by ss_store_sk))V1)V11
+     where rnk  < 11) asceding,
+    (select *
+     from (select item_sk,rank() over (order by rank_col desc) rnk
+           from (select ss_item_sk item_sk,avg(ss_net_profit) rank_col
+                 from store_sales ss1
+                 where ss_store_sk = 410
+                 group by ss_item_sk
+                 having avg(ss_net_profit) > 0.9*(select avg(ss_net_profit) rank_col
+                                                  from store_sales
+                                                  where ss_store_sk = 410
+                                                    and ss_hdemo_sk is null
+                                                  group by ss_store_sk))V2)V21
+     where rnk  < 11) descending,
+item i1,
+item i2
+where asceding.rnk = descending.rnk 
+  and i1.i_item_sk=asceding.item_sk
+  and i2.i_item_sk=descending.item_sk
+order by asceding.rnk
+limit 100
+PREHOOK: type: QUERY
+PREHOOK: Input: default@item
+PREHOOK: Input: default@store_sales
+PREHOOK: Output: hdfs://### HDFS PATH ###
+POSTHOOK: query: explain
+select  asceding.rnk, i1.i_product_name best_performing, i2.i_product_name worst_performing
+from(select *
+     from (select item_sk,rank() over (order by rank_col asc) rnk
+           from (select ss_item_sk item_sk,avg(ss_net_profit) rank_col 
+                 from store_sales ss1
+                 where ss_store_sk = 410
+                 group by ss_item_sk
+                 having avg(ss_net_profit) > 0.9*(select avg(ss_net_profit) rank_col
+                                                  from store_sales
+                                                  where ss_store_sk = 410
+                                                    and ss_hdemo_sk is null
+                                                  group by ss_store_sk))V1)V11
+     where rnk  < 11) asceding,
+    (select *
+     from (select item_sk,rank() over (order by rank_col desc) rnk
+           from (select ss_item_sk item_sk,avg(ss_net_profit) rank_col
+                 from store_sales ss1
+                 where ss_store_sk = 410
+                 group by ss_item_sk
+                 having avg(ss_net_profit) > 0.9*(select avg(ss_net_profit) rank_col
+                                                  from store_sales
+                                                  where ss_store_sk = 410
+                                                    and ss_hdemo_sk is null
+                                                  group by ss_store_sk))V2)V21
+     where rnk  < 11) descending,
+item i1,
+item i2
+where asceding.rnk = descending.rnk 
+  and i1.i_item_sk=asceding.item_sk
+  and i2.i_item_sk=descending.item_sk
+order by asceding.rnk
+limit 100
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@item
+POSTHOOK: Input: default@store_sales
+POSTHOOK: Output: hdfs://### HDFS PATH ###
+Plan optimized by CBO.
+
+Vertex dependency in root stage
+Reducer 10 <- Reducer 8 (SIMPLE_EDGE)
+Reducer 12 <- Map 11 (SIMPLE_EDGE)
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Reducer 9 (SIMPLE_EDGE)
+Reducer 3 <- Reducer 2 (SIMPLE_EDGE), Reducer 5 (SIMPLE_EDGE)
+Reducer 4 <- Reducer 3 (SIMPLE_EDGE)
+Reducer 5 <- Map 1 (SIMPLE_EDGE), Reducer 10 (SIMPLE_EDGE)
+Reducer 7 <- Map 6 (SIMPLE_EDGE)
+Reducer 8 <- Reducer 12 (CUSTOM_SIMPLE_EDGE), Reducer 7 (CUSTOM_SIMPLE_EDGE)
+Reducer 9 <- Reducer 8 (SIMPLE_EDGE)
+
+Stage-0
+  Fetch Operator
+    limit:100
+    Stage-1
+      Reducer 4 vectorized
+      File Output Operator [FS_135]
+        Limit [LIM_134] (rows=100 width=218)
+          Number of rows:100
+          Select Operator [SEL_133] (rows=6951 width=218)
+            Output:["_col0","_col1","_col2"]
+          <-Reducer 3 [SIMPLE_EDGE]
+            SHUFFLE [RS_67]
+              Select Operator [SEL_66] (rows=6951 width=218)
+                Output:["_col0","_col1","_col2"]
+                Merge Join Operator [MERGEJOIN_105] (rows=6951 width=218)
+                  Conds:RS_63._col3=RS_64._col3(Inner),Output:["_col1","_col3","_col5"]
+                <-Reducer 2 [SIMPLE_EDGE]
+                  SHUFFLE [RS_63]
+                    PartitionCols:_col3
+                    Merge Join Operator [MERGEJOIN_102] (rows=6951 width=111)
+                      Conds:RS_107._col0=RS_127._col0(Inner),Output:["_col1","_col3"]
+                    <-Map 1 [SIMPLE_EDGE] vectorized
+                      SHUFFLE [RS_107]
+                        PartitionCols:_col0
+                        Select Operator [SEL_106] (rows=462000 width=111)
+                          Output:["_col0","_col1"]
+                          TableScan [TS_0] (rows=462000 width=111)
+                            default@item,i1,Tbl:COMPLETE,Col:COMPLETE,Output:["i_item_sk","i_product_name"]
+                    <-Reducer 9 [SIMPLE_EDGE] vectorized
+                      SHUFFLE [RS_127]
+                        PartitionCols:_col0
+                        Select Operator [SEL_126] (rows=6951 width=8)
+                          Output:["_col0","_col1"]
+                          Filter Operator [FIL_125] (rows=6951 width=116)
+                            predicate:(rank_window_0 < 11)
+                            PTF Operator [PTF_124] (rows=20854 width=116)
+                              Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1 ASC NULLS FIRST","partition by:":"0"}]
+                              Select Operator [SEL_123] (rows=20854 width=116)
+                                Output:["_col0","_col1"]
+                              <-Reducer 8 [SIMPLE_EDGE]
+                                SHUFFLE [RS_21]
+                                  PartitionCols:0
+                                  Filter Operator [FIL_20] (rows=20854 width=228)
+                                    predicate:(_col1 > _col2)
+                                    Merge Join Operator [MERGEJOIN_101] (rows=62562 width=228)
+                                      Conds:(Inner),Output:["_col0","_col1","_col2"]
+                                    <-Reducer 12 [CUSTOM_SIMPLE_EDGE] vectorized
+                                      PARTITION_ONLY_SHUFFLE [RS_122]
+                                        Select Operator [SEL_121] (rows=1 width=112)
+                                          Output:["_col0"]
+                                          Group By Operator [GBY_120] (rows=1 width=124)
+                                            Output:["_col0","_col1","_col2"],aggregations:["sum(VALUE._col0)","count(VALUE._col1)"],keys:KEY._col0
+                                          <-Map 11 [SIMPLE_EDGE] vectorized
+                                            SHUFFLE [RS_119]
+                                              PartitionCols:_col0
+                                              Group By Operator [GBY_118] (rows=258 width=124)
+                                                Output:["_col0","_col1","_col2"],aggregations:["sum(_col1)","count(_col1)"],keys:true
+                                                Select Operator [SEL_117] (rows=287946 width=114)
+                                                  Output:["_col1"]
+                                                  Filter Operator [FIL_116] (rows=287946 width=114)
+                                                    predicate:((ss_store_sk = 410) and ss_hdemo_sk is null)
+                                                    TableScan [TS_9] (rows=575995635 width=114)
+                                                      default@store_sales,store_sales,Tbl:COMPLETE,Col:COMPLETE,Output:["ss_hdemo_sk","ss_store_sk","ss_net_profit"]
+                                    <-Reducer 7 [CUSTOM_SIMPLE_EDGE] vectorized
+                                      PARTITION_ONLY_SHUFFLE [RS_115]
+                                        Select Operator [SEL_114] (rows=62562 width=116)
+                                          Output:["_col0","_col1"]
+                                          Group By Operator [GBY_113] (rows=62562 width=124)
+                                            Output:["_col0","_col1","_col2"],aggregations:["sum(VALUE._col0)","count(VALUE._col1)"],keys:KEY._col0
+                                          <-Map 6 [SIMPLE_EDGE] vectorized
+                                            SHUFFLE [RS_112]
+                                              PartitionCols:_col0
+                                              Group By Operator [GBY_111] (rows=3199976 width=124)
+                                                Output:["_col0","_col1","_col2"],aggregations:["sum(ss_net_profit)","count(ss_net_profit)"],keys:ss_item_sk
+                                                Select Operator [SEL_110] (rows=6399952 width=114)
+                                                  Output:["ss_item_sk","ss_net_profit"]
+                                                  Filter Operator [FIL_109] (rows=6399952 width=114)
+                                                    predicate:(ss_store_sk = 410)
+                                                    TableScan [TS_2] (rows=575995635 width=114)
+                                                      default@store_sales,ss1,Tbl:COMPLETE,Col:COMPLETE,Output:["ss_item_sk","ss_store_sk","ss_net_profit"]
+                <-Reducer 5 [SIMPLE_EDGE]
+                  SHUFFLE [RS_64]
+                    PartitionCols:_col3
+                    Merge Join Operator [MERGEJOIN_104] (rows=6951 width=111)
+                      Conds:RS_108._col0=RS_132._col0(Inner),Output:["_col1","_col3"]
+                    <-Map 1 [SIMPLE_EDGE] vectorized
+                      SHUFFLE [RS_108]
+                        PartitionCols:_col0
+                         Please refer to the previous Select Operator [SEL_106]
+                    <-Reducer 10 [SIMPLE_EDGE] vectorized
+                      SHUFFLE [RS_132]
+                        PartitionCols:_col0
+                        Select Operator [SEL_131] (rows=6951 width=8)
+                          Output:["_col0","_col1"]
+                          Filter Operator [FIL_130] (rows=6951 width=116)
+                            predicate:(rank_window_0 < 11)
+                            PTF Operator [PTF_129] (rows=20854 width=116)
+                              Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1 DESC NULLS LAST","partition by:":"0"}]
+                              Select Operator [SEL_128] (rows=20854 width=116)
+                                Output:["_col0","_col1"]
+                              <-Reducer 8 [SIMPLE_EDGE]
+                                SHUFFLE [RS_49]
+                                  PartitionCols:0
+                                   Please refer to the previous Filter Operator [FIL_20]
+

http://git-wip-us.apache.org/repos/asf/hive/blob/b8299551/ql/src/test/results/clientpositive/perf/tez/constraints/query45.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query45.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query45.q.out
new file mode 100644
index 0000000..bf620c8
--- /dev/null
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query45.q.out
@@ -0,0 +1,183 @@
+PREHOOK: query: explain
+select  ca_zip, ca_county, sum(ws_sales_price)
+ from web_sales, customer, customer_address, date_dim, item
+ where ws_bill_customer_sk = c_customer_sk
+ 	and c_current_addr_sk = ca_address_sk 
+ 	and ws_item_sk = i_item_sk 
+ 	and ( substr(ca_zip,1,5) in ('85669', '86197','88274','83405','86475', '85392', '85460', '80348', '81792')
+ 	      or 
+ 	      i_item_id in (select i_item_id
+                             from item
+                             where i_item_sk in (2, 3, 5, 7, 11, 13, 17, 19, 23, 29)
+                             )
+ 	    )
+ 	and ws_sold_date_sk = d_date_sk
+ 	and d_qoy = 2 and d_year = 2000
+ group by ca_zip, ca_county
+ order by ca_zip, ca_county
+ limit 100
+PREHOOK: type: QUERY
+PREHOOK: Input: default@customer
+PREHOOK: Input: default@customer_address
+PREHOOK: Input: default@date_dim
+PREHOOK: Input: default@item
+PREHOOK: Input: default@web_sales
+PREHOOK: Output: hdfs://### HDFS PATH ###
+POSTHOOK: query: explain
+select  ca_zip, ca_county, sum(ws_sales_price)
+ from web_sales, customer, customer_address, date_dim, item
+ where ws_bill_customer_sk = c_customer_sk
+ 	and c_current_addr_sk = ca_address_sk 
+ 	and ws_item_sk = i_item_sk 
+ 	and ( substr(ca_zip,1,5) in ('85669', '86197','88274','83405','86475', '85392', '85460', '80348', '81792')
+ 	      or 
+ 	      i_item_id in (select i_item_id
+                             from item
+                             where i_item_sk in (2, 3, 5, 7, 11, 13, 17, 19, 23, 29)
+                             )
+ 	    )
+ 	and ws_sold_date_sk = d_date_sk
+ 	and d_qoy = 2 and d_year = 2000
+ group by ca_zip, ca_county
+ order by ca_zip, ca_county
+ limit 100
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@customer
+POSTHOOK: Input: default@customer_address
+POSTHOOK: Input: default@date_dim
+POSTHOOK: Input: default@item
+POSTHOOK: Input: default@web_sales
+POSTHOOK: Output: hdfs://### HDFS PATH ###
+Plan optimized by CBO.
+
+Vertex dependency in root stage
+Map 11 <- Reducer 14 (BROADCAST_EDGE)
+Reducer 10 <- Map 7 (SIMPLE_EDGE)
+Reducer 12 <- Map 11 (SIMPLE_EDGE), Map 13 (SIMPLE_EDGE)
+Reducer 14 <- Map 13 (CUSTOM_SIMPLE_EDGE)
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 6 (SIMPLE_EDGE)
+Reducer 3 <- Reducer 2 (SIMPLE_EDGE), Reducer 9 (SIMPLE_EDGE)
+Reducer 4 <- Reducer 3 (SIMPLE_EDGE)
+Reducer 5 <- Reducer 4 (SIMPLE_EDGE)
+Reducer 8 <- Map 7 (SIMPLE_EDGE), Reducer 10 (ONE_TO_ONE_EDGE)
+Reducer 9 <- Reducer 12 (SIMPLE_EDGE), Reducer 8 (SIMPLE_EDGE)
+
+Stage-0
+  Fetch Operator
+    limit:100
+    Stage-1
+      Reducer 5 vectorized
+      File Output Operator [FS_149]
+        Limit [LIM_148] (rows=100 width=299)
+          Number of rows:100
+          Select Operator [SEL_147] (rows=285780 width=299)
+            Output:["_col0","_col1","_col2"]
+          <-Reducer 4 [SIMPLE_EDGE] vectorized
+            SHUFFLE [RS_146]
+              Group By Operator [GBY_145] (rows=285780 width=299)
+                Output:["_col0","_col1","_col2"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1
+              <-Reducer 3 [SIMPLE_EDGE]
+                SHUFFLE [RS_41]
+                  PartitionCols:_col0, _col1
+                  Group By Operator [GBY_40] (rows=3715140 width=299)
+                    Output:["_col0","_col1","_col2"],aggregations:["sum(_col3)"],keys:_col8, _col7
+                    Top N Key Operator [TNK_69] (rows=10246864 width=302)
+                      keys:_col8, _col7,sort order:++,top n:100
+                      Select Operator [SEL_39] (rows=10246864 width=302)
+                        Output:["_col3","_col7","_col8"]
+                        Filter Operator [FIL_38] (rows=10246864 width=302)
+                          predicate:((substr(_col8, 1, 5)) IN ('85669', '86197', '88274', '83405', '86475', '85392', '85460', '80348', '81792') or _col15 is not null)
+                          Select Operator [SEL_37] (rows=10246864 width=302)
+                            Output:["_col3","_col7","_col8","_col15"]
+                            Merge Join Operator [MERGEJOIN_119] (rows=10246864 width=302)
+                              Conds:RS_34._col0=RS_35._col6(Inner),Output:["_col3","_col4","_col8","_col12"]
+                            <-Reducer 2 [SIMPLE_EDGE]
+                              SHUFFLE [RS_34]
+                                PartitionCols:_col0
+                                Merge Join Operator [MERGEJOIN_115] (rows=80000000 width=191)
+                                  Conds:RS_122._col1=RS_124._col0(Inner),Output:["_col0","_col3","_col4"]
+                                <-Map 1 [SIMPLE_EDGE] vectorized
+                                  SHUFFLE [RS_122]
+                                    PartitionCols:_col1
+                                    Select Operator [SEL_121] (rows=80000000 width=8)
+                                      Output:["_col0","_col1"]
+                                      Filter Operator [FIL_120] (rows=80000000 width=8)
+                                        predicate:c_current_addr_sk is not null
+                                        TableScan [TS_0] (rows=80000000 width=8)
+                                          default@customer,customer,Tbl:COMPLETE,Col:COMPLETE,Output:["c_customer_sk","c_current_addr_sk"]
+                                <-Map 6 [SIMPLE_EDGE] vectorized
+                                  SHUFFLE [RS_124]
+                                    PartitionCols:_col0
+                                    Select Operator [SEL_123] (rows=40000000 width=191)
+                                      Output:["_col0","_col1","_col2"]
+                                      TableScan [TS_3] (rows=40000000 width=191)
+                                        default@customer_address,customer_address,Tbl:COMPLETE,Col:COMPLETE,Output:["ca_address_sk","ca_county","ca_zip"]
+                            <-Reducer 9 [SIMPLE_EDGE]
+                              SHUFFLE [RS_35]
+                                PartitionCols:_col6
+                                Merge Join Operator [MERGEJOIN_118] (rows=10246864 width=119)
+                                  Conds:RS_27._col0=RS_28._col1(Inner),Output:["_col3","_col6","_col7"]
+                                <-Reducer 12 [SIMPLE_EDGE]
+                                  SHUFFLE [RS_28]
+                                    PartitionCols:_col1
+                                    Merge Join Operator [MERGEJOIN_117] (rows=10246864 width=119)
+                                      Conds:RS_144._col0=RS_136._col0(Inner),Output:["_col1","_col2","_col3"]
+                                    <-Map 13 [SIMPLE_EDGE] vectorized
+                                      PARTITION_ONLY_SHUFFLE [RS_136]
+                                        PartitionCols:_col0
+                                        Select Operator [SEL_135] (rows=130 width=12)
+                                          Output:["_col0"]
+                                          Filter Operator [FIL_134] (rows=130 width=12)
+                                            predicate:((d_qoy = 2) and (d_year = 2000))
+                                            TableScan [TS_17] (rows=73049 width=12)
+                                              default@date_dim,date_dim,Tbl:COMPLETE,Col:COMPLETE,Output:["d_date_sk","d_year","d_qoy"]
+                                    <-Map 11 [SIMPLE_EDGE] vectorized
+                                      SHUFFLE [RS_144]
+                                        PartitionCols:_col0
+                                        Select Operator [SEL_143] (rows=143930993 width=123)
+                                          Output:["_col0","_col1","_col2","_col3"]
+                                          Filter Operator [FIL_142] (rows=143930993 width=123)
+                                            predicate:((ws_sold_date_sk BETWEEN DynamicValue(RS_21_date_dim_d_date_sk_min) AND DynamicValue(RS_21_date_dim_d_date_sk_max) and in_bloom_filter(ws_sold_date_sk, DynamicValue(RS_21_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_14] (rows=144002668 width=123)
+                                              default@web_sales,web_sales,Tbl:COMPLETE,Col:COMPLETE,Output:["ws_sold_date_sk","ws_item_sk","ws_bill_customer_sk","ws_sales_price"]
+                                            <-Reducer 14 [BROADCAST_EDGE] vectorized
+                                              BROADCAST [RS_141]
+                                                Group By Operator [GBY_140] (rows=1 width=12)
+                                                  Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
+                                                <-Map 13 [CUSTOM_SIMPLE_EDGE] vectorized
+                                                  PARTITION_ONLY_SHUFFLE [RS_139]
+                                                    Group By Operator [GBY_138] (rows=1 width=12)
+                                                      Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                                      Select Operator [SEL_137] (rows=130 width=4)
+                                                        Output:["_col0"]
+                                                         Please refer to the previous Select Operator [SEL_135]
+                                <-Reducer 8 [SIMPLE_EDGE]
+                                  SHUFFLE [RS_27]
+                                    PartitionCols:_col0
+                                    Merge Join Operator [MERGEJOIN_116] (rows=462007 width=4)
+                                      Conds:RS_127._col1=RS_133._col0(Left Outer),Output:["_col0","_col3"]
+                                    <-Map 7 [SIMPLE_EDGE] vectorized
+                                      SHUFFLE [RS_127]
+                                        PartitionCols:_col1
+                                        Select Operator [SEL_125] (rows=462000 width=104)
+                                          Output:["_col0","_col1"]
+                                          TableScan [TS_5] (rows=462000 width=104)
+                                            default@item,item,Tbl:COMPLETE,Col:COMPLETE,Output:["i_item_sk","i_item_id"]
+                                    <-Reducer 10 [ONE_TO_ONE_EDGE] vectorized
+                                      FORWARD [RS_133]
+                                        PartitionCols:_col0
+                                        Select Operator [SEL_132] (rows=5 width=104)
+                                          Output:["_col0","_col1"]
+                                          Group By Operator [GBY_131] (rows=5 width=100)
+                                            Output:["_col0"],keys:KEY._col0
+                                          <-Map 7 [SIMPLE_EDGE] vectorized
+                                            SHUFFLE [RS_130]
+                                              PartitionCols:_col0
+                                              Group By Operator [GBY_129] (rows=5 width=100)
+                                                Output:["_col0"],keys:i_item_id
+                                                Select Operator [SEL_128] (rows=11 width=104)
+                                                  Output:["i_item_id"]
+                                                  Filter Operator [FIL_126] (rows=11 width=104)
+                                                    predicate:(i_item_sk) IN (2, 3, 5, 7, 11, 13, 17, 19, 23, 29)
+                                                     Please refer to the previous TableScan [TS_5]
+

http://git-wip-us.apache.org/repos/asf/hive/blob/b8299551/ql/src/test/results/clientpositive/perf/tez/constraints/query46.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query46.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query46.q.out
new file mode 100644
index 0000000..b7a6bd6
--- /dev/null
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query46.q.out
@@ -0,0 +1,240 @@
+PREHOOK: query: explain
+select  c_last_name
+       ,c_first_name
+       ,ca_city
+       ,bought_city
+       ,ss_ticket_number
+       ,amt,profit 
+ from
+   (select ss_ticket_number
+          ,ss_customer_sk
+          ,ca_city bought_city
+          ,sum(ss_coupon_amt) amt
+          ,sum(ss_net_profit) profit
+    from store_sales,date_dim,store,household_demographics,customer_address 
+    where store_sales.ss_sold_date_sk = date_dim.d_date_sk
+    and store_sales.ss_store_sk = store.s_store_sk  
+    and store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+    and store_sales.ss_addr_sk = customer_address.ca_address_sk
+    and (household_demographics.hd_dep_count = 2 or
+         household_demographics.hd_vehicle_count= 1)
+    and date_dim.d_dow in (6,0)
+    and date_dim.d_year in (1998,1998+1,1998+2) 
+    and store.s_city in ('Cedar Grove','Wildwood','Union','Salem','Highland Park') 
+    group by ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city) dn,customer,customer_address current_addr
+    where ss_customer_sk = c_customer_sk
+      and customer.c_current_addr_sk = current_addr.ca_address_sk
+      and current_addr.ca_city <> bought_city
+  order by c_last_name
+          ,c_first_name
+          ,ca_city
+          ,bought_city
+          ,ss_ticket_number
+  limit 100
+PREHOOK: type: QUERY
+PREHOOK: Input: default@customer
+PREHOOK: Input: default@customer_address
+PREHOOK: Input: default@date_dim
+PREHOOK: Input: default@household_demographics
+PREHOOK: Input: default@store
+PREHOOK: Input: default@store_sales
+PREHOOK: Output: hdfs://### HDFS PATH ###
+POSTHOOK: query: explain
+select  c_last_name
+       ,c_first_name
+       ,ca_city
+       ,bought_city
+       ,ss_ticket_number
+       ,amt,profit 
+ from
+   (select ss_ticket_number
+          ,ss_customer_sk
+          ,ca_city bought_city
+          ,sum(ss_coupon_amt) amt
+          ,sum(ss_net_profit) profit
+    from store_sales,date_dim,store,household_demographics,customer_address 
+    where store_sales.ss_sold_date_sk = date_dim.d_date_sk
+    and store_sales.ss_store_sk = store.s_store_sk  
+    and store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+    and store_sales.ss_addr_sk = customer_address.ca_address_sk
+    and (household_demographics.hd_dep_count = 2 or
+         household_demographics.hd_vehicle_count= 1)
+    and date_dim.d_dow in (6,0)
+    and date_dim.d_year in (1998,1998+1,1998+2) 
+    and store.s_city in ('Cedar Grove','Wildwood','Union','Salem','Highland Park') 
+    group by ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city) dn,customer,customer_address current_addr
+    where ss_customer_sk = c_customer_sk
+      and customer.c_current_addr_sk = current_addr.ca_address_sk
+      and current_addr.ca_city <> bought_city
+  order by c_last_name
+          ,c_first_name
+          ,ca_city
+          ,bought_city
+          ,ss_ticket_number
+  limit 100
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@customer
+POSTHOOK: Input: default@customer_address
+POSTHOOK: Input: default@date_dim
+POSTHOOK: Input: default@household_demographics
+POSTHOOK: Input: default@store
+POSTHOOK: Input: default@store_sales
+POSTHOOK: Output: hdfs://### HDFS PATH ###
+Plan optimized by CBO.
+
+Vertex dependency in root stage
+Map 8 <- Reducer 13 (BROADCAST_EDGE), Reducer 15 (BROADCAST_EDGE), Reducer 17 (BROADCAST_EDGE)
+Reducer 10 <- Map 14 (SIMPLE_EDGE), Reducer 9 (SIMPLE_EDGE)
+Reducer 11 <- Map 16 (SIMPLE_EDGE), Reducer 10 (SIMPLE_EDGE)
+Reducer 13 <- Map 12 (CUSTOM_SIMPLE_EDGE)
+Reducer 15 <- Map 14 (CUSTOM_SIMPLE_EDGE)
+Reducer 17 <- Map 16 (CUSTOM_SIMPLE_EDGE)
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 5 (SIMPLE_EDGE)
+Reducer 3 <- Reducer 2 (SIMPLE_EDGE), Reducer 7 (SIMPLE_EDGE)
+Reducer 4 <- Reducer 3 (SIMPLE_EDGE)
+Reducer 6 <- Map 5 (SIMPLE_EDGE), Reducer 11 (SIMPLE_EDGE)
+Reducer 7 <- Reducer 6 (SIMPLE_EDGE)
+Reducer 9 <- Map 12 (SIMPLE_EDGE), Map 8 (SIMPLE_EDGE)
+
+Stage-0
+  Fetch Operator
+    limit:100
+    Stage-1
+      Reducer 4 vectorized
+      File Output Operator [FS_182]
+        Limit [LIM_181] (rows=100 width=594)
+          Number of rows:100
+          Select Operator [SEL_180] (rows=20351707 width=594)
+            Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
+          <-Reducer 3 [SIMPLE_EDGE]
+            SHUFFLE [RS_44]
+              Select Operator [SEL_43] (rows=20351707 width=594)
+                Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
+                Filter Operator [FIL_42] (rows=20351707 width=594)
+                  predicate:(_col5 <> _col8)
+                  Merge Join Operator [MERGEJOIN_143] (rows=20351707 width=594)
+                    Conds:RS_39._col0=RS_179._col1(Inner),Output:["_col2","_col3","_col5","_col6","_col8","_col9","_col10"]
+                  <-Reducer 2 [SIMPLE_EDGE]
+                    SHUFFLE [RS_39]
+                      PartitionCols:_col0
+                      Merge Join Operator [MERGEJOIN_138] (rows=80000000 width=277)
+                        Conds:RS_146._col1=RS_148._col0(Inner),Output:["_col0","_col2","_col3","_col5"]
+                      <-Map 5 [SIMPLE_EDGE] vectorized
+                        SHUFFLE [RS_148]
+                          PartitionCols:_col0
+                          Select Operator [SEL_147] (rows=40000000 width=97)
+                            Output:["_col0","_col1"]
+                            TableScan [TS_3] (rows=40000000 width=97)
+                              default@customer_address,current_addr,Tbl:COMPLETE,Col:COMPLETE,Output:["ca_address_sk","ca_city"]
+                      <-Map 1 [SIMPLE_EDGE] vectorized
+                        SHUFFLE [RS_146]
+                          PartitionCols:_col1
+                          Select Operator [SEL_145] (rows=80000000 width=188)
+                            Output:["_col0","_col1","_col2","_col3"]
+                            Filter Operator [FIL_144] (rows=80000000 width=188)
+                              predicate:c_current_addr_sk is not null
+                              TableScan [TS_0] (rows=80000000 width=188)
+                                default@customer,customer,Tbl:COMPLETE,Col:COMPLETE,Output:["c_customer_sk","c_current_addr_sk","c_first_name","c_last_name"]
+                  <-Reducer 7 [SIMPLE_EDGE] vectorized
+                    SHUFFLE [RS_179]
+                      PartitionCols:_col1
+                      Select Operator [SEL_178] (rows=20351707 width=321)
+                        Output:["_col0","_col1","_col2","_col3","_col4"]
+                        Group By Operator [GBY_177] (rows=20351707 width=321)
+                          Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3
+                        <-Reducer 6 [SIMPLE_EDGE]
+                          SHUFFLE [RS_33]
+                            PartitionCols:_col0, _col1, _col2, _col3
+                            Group By Operator [GBY_32] (rows=20351707 width=321)
+                              Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(_col6)","sum(_col7)"],keys:_col1, _col12, _col3, _col5
+                              Merge Join Operator [MERGEJOIN_142] (rows=20351707 width=97)
+                                Conds:RS_28._col3=RS_149._col0(Inner),Output:["_col1","_col3","_col5","_col6","_col7","_col12"]
+                              <-Map 5 [SIMPLE_EDGE] vectorized
+                                SHUFFLE [RS_149]
+                                  PartitionCols:_col0
+                                   Please refer to the previous Select Operator [SEL_147]
+                              <-Reducer 11 [SIMPLE_EDGE]
+                                SHUFFLE [RS_28]
+                                  PartitionCols:_col3
+                                  Merge Join Operator [MERGEJOIN_141] (rows=20351707 width=4)
+                                    Conds:RS_25._col2=RS_168._col0(Inner),Output:["_col1","_col3","_col5","_col6","_col7"]
+                                  <-Map 16 [SIMPLE_EDGE] vectorized
+                                    PARTITION_ONLY_SHUFFLE [RS_168]
+                                      PartitionCols:_col0
+                                      Select Operator [SEL_167] (rows=1855 width=4)
+                                        Output:["_col0"]
+                                        Filter Operator [FIL_166] (rows=1855 width=12)
+                                          predicate:((hd_dep_count = 2) or (hd_vehicle_count = 1))
+                                          TableScan [TS_14] (rows=7200 width=12)
+                                            default@household_demographics,household_demographics,Tbl:COMPLETE,Col:COMPLETE,Output:["hd_demo_sk","hd_dep_count","hd_vehicle_count"]
+                                  <-Reducer 10 [SIMPLE_EDGE]
+                                    SHUFFLE [RS_25]
+                                      PartitionCols:_col2
+                                      Merge Join Operator [MERGEJOIN_140] (rows=78993142 width=178)
+                                        Conds:RS_22._col4=RS_160._col0(Inner),Output:["_col1","_col2","_col3","_col5","_col6","_col7"]
+                                      <-Map 14 [SIMPLE_EDGE] vectorized
+                                        PARTITION_ONLY_SHUFFLE [RS_160]
+                                          PartitionCols:_col0
+                                          Select Operator [SEL_159] (rows=85 width=4)
+                                            Output:["_col0"]
+                                            Filter Operator [FIL_158] (rows=85 width=97)
+                                              predicate:(s_city) IN ('Cedar Grove', 'Wildwood', 'Union', 'Salem', 'Highland Park')
+                                              TableScan [TS_11] (rows=1704 width=97)
+                                                default@store,store,Tbl:COMPLETE,Col:COMPLETE,Output:["s_store_sk","s_city"]
+                                      <-Reducer 9 [SIMPLE_EDGE]
+                                        SHUFFLE [RS_22]
+                                          PartitionCols:_col4
+                                          Merge Join Operator [MERGEJOIN_139] (rows=196204013 width=218)
+                                            Conds:RS_176._col0=RS_152._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
+                                          <-Map 12 [SIMPLE_EDGE] vectorized
+                                            SHUFFLE [RS_152]
+                                              PartitionCols:_col0
+                                              Select Operator [SEL_151] (rows=783 width=4)
+                                                Output:["_col0"]
+                                                Filter Operator [FIL_150] (rows=783 width=12)
+                                                  predicate:((d_dow) IN (6, 0) and (d_year) IN (1998, 1999, 2000))
+                                                  TableScan [TS_8] (rows=73049 width=12)
+                                                    default@date_dim,date_dim,Tbl:COMPLETE,Col:COMPLETE,Output:["d_date_sk","d_year","d_dow"]
+                                          <-Map 8 [SIMPLE_EDGE] vectorized
+                                            SHUFFLE [RS_176]
+                                              PartitionCols:_col0
+                                              Select Operator [SEL_175] (rows=457565061 width=237)
+                                                Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
+                                                Filter Operator [FIL_174] (rows=457565061 width=237)
+                                                  predicate:((ss_hdemo_sk BETWEEN DynamicValue(RS_26_household_demographics_hd_demo_sk_min) AND DynamicValue(RS_26_household_demographics_hd_demo_sk_max) and in_bloom_filter(ss_hdemo_sk, DynamicValue(RS_26_household_demographics_hd_demo_sk_bloom_filter))) and (ss_sold_date_sk BETWEEN DynamicValue(RS_20_date_dim_d_date_sk_min) AND DynamicValue(RS_20_date_dim_d_date_sk_max) and in_bloom_filter(ss_sold_date_sk, DynamicValue(RS_20_date_dim_d_date_sk_bloom_filter))) and (ss_store_sk BETWEEN DynamicValue(RS_23_store_s_store_sk_min) AND DynamicValue(RS_23_store_s_store_sk_max) and in_bloom_filter(ss_store_sk, DynamicValue(RS_23_store_s_store_sk_bloom_filter))) and ss_addr_sk is not null and ss_customer_sk is not null and ss_hdemo_sk is not null and ss_sold_date_sk is not null and ss_store_sk is not null)
+                                                  TableScan [TS_5] (rows=575995635 width=237)
+                                                    default@store_sales,store_sales,Tbl:COMPLETE,Col:COMPLETE,Output:["ss_sold_date_sk","ss_customer_sk","ss_hdemo_sk","ss_addr_sk","ss_store_sk","ss_ticket_number","ss_coupon_amt","ss_net_profit"]
+                                                  <-Reducer 13 [BROADCAST_EDGE] vectorized
+                                                    BROADCAST [RS_157]
+                                                      Group By Operator [GBY_156] (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_155]
+                                                          Group By Operator [GBY_154] (rows=1 width=12)
+                                                            Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                                            Select Operator [SEL_153] (rows=783 width=4)
+                                                              Output:["_col0"]
+                                                               Please refer to the previous Select Operator [SEL_151]
+                                                  <-Reducer 15 [BROADCAST_EDGE] vectorized
+                                                    BROADCAST [RS_165]
+                                                      Group By Operator [GBY_164] (rows=1 width=12)
+                                                        Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
+                                                      <-Map 14 [CUSTOM_SIMPLE_EDGE] vectorized
+                                                        PARTITION_ONLY_SHUFFLE [RS_163]
+                                                          Group By Operator [GBY_162] (rows=1 width=12)
+                                                            Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                                            Select Operator [SEL_161] (rows=85 width=4)
+                                                              Output:["_col0"]
+                                                               Please refer to the previous Select Operator [SEL_159]
+                                                  <-Reducer 17 [BROADCAST_EDGE] vectorized
+                                                    BROADCAST [RS_173]
+                                                      Group By Operator [GBY_172] (rows=1 width=12)
+                                                        Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
+                                                      <-Map 16 [CUSTOM_SIMPLE_EDGE] vectorized
+                                                        PARTITION_ONLY_SHUFFLE [RS_171]
+                                                          Group By Operator [GBY_170] (rows=1 width=12)
+                                                            Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                                            Select Operator [SEL_169] (rows=1855 width=4)
+                                                              Output:["_col0"]
+                                                               Please refer to the previous Select Operator [SEL_167]
+

http://git-wip-us.apache.org/repos/asf/hive/blob/b8299551/ql/src/test/results/clientpositive/perf/tez/constraints/query47.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query47.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query47.q.out
new file mode 100644
index 0000000..e905b1178
--- /dev/null
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query47.q.out
@@ -0,0 +1,266 @@
+PREHOOK: query: explain
+with v1 as(
+ select i_category, i_brand,
+        s_store_name, s_company_name,
+        d_year, d_moy,
+        sum(ss_sales_price) sum_sales,
+        avg(sum(ss_sales_price)) over
+          (partition by i_category, i_brand,
+                     s_store_name, s_company_name, d_year)
+          avg_monthly_sales,
+        rank() over
+          (partition by i_category, i_brand,
+                     s_store_name, s_company_name
+           order by d_year, d_moy) rn
+ from item, store_sales, date_dim, store
+ where ss_item_sk = i_item_sk and
+       ss_sold_date_sk = d_date_sk and
+       ss_store_sk = s_store_sk and
+       (
+         d_year = 2000 or
+         ( d_year = 2000-1 and d_moy =12) or
+         ( d_year = 2000+1 and d_moy =1)
+       )
+ group by i_category, i_brand,
+          s_store_name, s_company_name,
+          d_year, d_moy),
+ v2 as(
+ select v1.i_category
+        ,v1.d_year, v1.d_moy
+        ,v1.avg_monthly_sales
+        ,v1.sum_sales, v1_lag.sum_sales psum, v1_lead.sum_sales nsum
+ from v1, v1 v1_lag, v1 v1_lead
+ where v1.i_category = v1_lag.i_category and
+       v1.i_category = v1_lead.i_category and
+       v1.i_brand = v1_lag.i_brand and
+       v1.i_brand = v1_lead.i_brand and
+       v1.s_store_name = v1_lag.s_store_name and
+       v1.s_store_name = v1_lead.s_store_name and
+       v1.s_company_name = v1_lag.s_company_name and
+       v1.s_company_name = v1_lead.s_company_name and
+       v1.rn = v1_lag.rn + 1 and
+       v1.rn = v1_lead.rn - 1)
+  select  *
+ from v2
+ where  d_year = 2000 and    
+        avg_monthly_sales > 0 and
+        case when avg_monthly_sales > 0 then abs(sum_sales - avg_monthly_sales) / avg_monthly_sales else null end > 0.1
+ order by sum_sales - avg_monthly_sales, 3
+ limit 100
+PREHOOK: type: QUERY
+PREHOOK: Input: default@date_dim
+PREHOOK: Input: default@item
+PREHOOK: Input: default@store
+PREHOOK: Input: default@store_sales
+PREHOOK: Output: hdfs://### HDFS PATH ###
+POSTHOOK: query: explain
+with v1 as(
+ select i_category, i_brand,
+        s_store_name, s_company_name,
+        d_year, d_moy,
+        sum(ss_sales_price) sum_sales,
+        avg(sum(ss_sales_price)) over
+          (partition by i_category, i_brand,
+                     s_store_name, s_company_name, d_year)
+          avg_monthly_sales,
+        rank() over
+          (partition by i_category, i_brand,
+                     s_store_name, s_company_name
+           order by d_year, d_moy) rn
+ from item, store_sales, date_dim, store
+ where ss_item_sk = i_item_sk and
+       ss_sold_date_sk = d_date_sk and
+       ss_store_sk = s_store_sk and
+       (
+         d_year = 2000 or
+         ( d_year = 2000-1 and d_moy =12) or
+         ( d_year = 2000+1 and d_moy =1)
+       )
+ group by i_category, i_brand,
+          s_store_name, s_company_name,
+          d_year, d_moy),
+ v2 as(
+ select v1.i_category
+        ,v1.d_year, v1.d_moy
+        ,v1.avg_monthly_sales
+        ,v1.sum_sales, v1_lag.sum_sales psum, v1_lead.sum_sales nsum
+ from v1, v1 v1_lag, v1 v1_lead
+ where v1.i_category = v1_lag.i_category and
+       v1.i_category = v1_lead.i_category and
+       v1.i_brand = v1_lag.i_brand and
+       v1.i_brand = v1_lead.i_brand and
+       v1.s_store_name = v1_lag.s_store_name and
+       v1.s_store_name = v1_lead.s_store_name and
+       v1.s_company_name = v1_lag.s_company_name and
+       v1.s_company_name = v1_lead.s_company_name and
+       v1.rn = v1_lag.rn + 1 and
+       v1.rn = v1_lead.rn - 1)
+  select  *
+ from v2
+ where  d_year = 2000 and    
+        avg_monthly_sales > 0 and
+        case when avg_monthly_sales > 0 then abs(sum_sales - avg_monthly_sales) / avg_monthly_sales else null end > 0.1
+ order by sum_sales - avg_monthly_sales, 3
+ limit 100
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@date_dim
+POSTHOOK: Input: default@item
+POSTHOOK: Input: default@store
+POSTHOOK: Input: default@store_sales
+POSTHOOK: Output: hdfs://### HDFS PATH ###
+Plan optimized by CBO.
+
+Vertex dependency in root stage
+Map 1 <- Reducer 13 (BROADCAST_EDGE)
+Reducer 10 <- Reducer 5 (SIMPLE_EDGE)
+Reducer 11 <- Reducer 10 (SIMPLE_EDGE)
+Reducer 13 <- Map 12 (CUSTOM_SIMPLE_EDGE)
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 12 (SIMPLE_EDGE)
+Reducer 3 <- Map 14 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
+Reducer 4 <- Map 15 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
+Reducer 5 <- Reducer 4 (SIMPLE_EDGE)
+Reducer 6 <- Reducer 5 (SIMPLE_EDGE)
+Reducer 7 <- Reducer 6 (SIMPLE_EDGE), Reducer 9 (ONE_TO_ONE_EDGE)
+Reducer 8 <- Reducer 7 (SIMPLE_EDGE)
+Reducer 9 <- Reducer 11 (SIMPLE_EDGE), Reducer 6 (SIMPLE_EDGE)
+
+Stage-0
+  Fetch Operator
+    limit:-1
+    Stage-1
+      Reducer 8 vectorized
+      File Output Operator [FS_321]
+        Limit [LIM_320] (rows=100 width=658)
+          Number of rows:100
+          Select Operator [SEL_319] (rows=241454 width=658)
+            Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
+          <-Reducer 7 [SIMPLE_EDGE]
+            SHUFFLE [RS_110]
+              Select Operator [SEL_109] (rows=241454 width=658)
+                Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
+                Merge Join Operator [MERGEJOIN_278] (rows=241454 width=546)
+                  Conds:RS_106._col6, _col7, _col8, _col9, _col14=RS_306._col0, _col1, _col2, _col3, _col5(Inner),Output:["_col4","_col6","_col10","_col11","_col12","_col13","_col19"]
+                <-Reducer 6 [SIMPLE_EDGE] vectorized
+                  SHUFFLE [RS_306]
+                    PartitionCols:_col0, _col1, _col2, _col3, _col5
+                    Select Operator [SEL_304] (rows=162257387 width=485)
+                      Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
+                      Filter Operator [FIL_302] (rows=162257387 width=489)
+                        predicate:rank_window_0 is not null
+                        PTF Operator [PTF_300] (rows=162257387 width=489)
+                          Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col2 ASC NULLS LAST, _col3 ASC NULLS LAST","partition by:":"_col1, _col0, _col4, _col5"}]
+                          Select Operator [SEL_299] (rows=162257387 width=489)
+                            Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
+                          <-Reducer 5 [SIMPLE_EDGE] vectorized
+                            SHUFFLE [RS_297]
+                              PartitionCols:_col1, _col0, _col4, _col5
+                              Group By Operator [GBY_296] (rows=162257387 width=489)
+                                Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4, KEY._col5
+                              <-Reducer 4 [SIMPLE_EDGE]
+                                SHUFFLE [RS_93]
+                                  PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5
+                                  Group By Operator [GBY_92] (rows=162257387 width=489)
+                                    Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"],aggregations:["sum(_col3)"],keys:_col8, _col9, _col5, _col6, _col11, _col12
+                                    Merge Join Operator [MERGEJOIN_276] (rows=162257387 width=472)
+                                      Conds:RS_88._col2=RS_295._col0(Inner),Output:["_col3","_col5","_col6","_col8","_col9","_col11","_col12"]
+                                    <-Map 15 [SIMPLE_EDGE] vectorized
+                                      SHUFFLE [RS_295]
+                                        PartitionCols:_col0
+                                        Select Operator [SEL_294] (rows=1704 width=183)
+                                          Output:["_col0","_col1","_col2"]
+                                          Filter Operator [FIL_293] (rows=1704 width=183)
+                                            predicate:(s_company_name is not null and s_store_name is not null)
+                                            TableScan [TS_79] (rows=1704 width=183)
+                                              default@store,store,Tbl:COMPLETE,Col:COMPLETE,Output:["s_store_sk","s_store_name","s_company_name"]
+                                    <-Reducer 3 [SIMPLE_EDGE]
+                                      SHUFFLE [RS_88]
+                                        PartitionCols:_col2
+                                        Merge Join Operator [MERGEJOIN_275] (rows=162257387 width=297)
+                                          Conds:RS_85._col1=RS_292._col0(Inner),Output:["_col2","_col3","_col5","_col6","_col8","_col9"]
+                                        <-Map 14 [SIMPLE_EDGE] vectorized
+                                          SHUFFLE [RS_292]
+                                            PartitionCols:_col0
+                                            Select Operator [SEL_291] (rows=462000 width=194)
+                                              Output:["_col0","_col1","_col2"]
+                                              Filter Operator [FIL_290] (rows=462000 width=194)
+                                                predicate:(i_brand is not null and i_category is not null)
+                                                TableScan [TS_76] (rows=462000 width=194)
+                                                  default@item,item,Tbl:COMPLETE,Col:COMPLETE,Output:["i_item_sk","i_brand","i_category"]
+                                        <-Reducer 2 [SIMPLE_EDGE]
+                                          SHUFFLE [RS_85]
+                                            PartitionCols:_col1
+                                            Merge Join Operator [MERGEJOIN_274] (rows=162257387 width=111)
+                                              Conds:RS_289._col0=RS_281._col0(Inner),Output:["_col1","_col2","_col3","_col5","_col6"]
+                                            <-Map 12 [SIMPLE_EDGE] vectorized
+                                              SHUFFLE [RS_281]
+                                                PartitionCols:_col0
+                                                Select Operator [SEL_280] (rows=564 width=12)
+                                                  Output:["_col0","_col1","_col2"]
+                                                  Filter Operator [FIL_279] (rows=564 width=12)
+                                                    predicate:(((d_year = 2000) or (struct(d_year,d_moy)) IN (const struct(1999,12), const struct(2001,1))) and (d_year) IN (2000, 1999, 2001))
+                                                    TableScan [TS_73] (rows=73049 width=12)
+                                                      default@date_dim,date_dim,Tbl:COMPLETE,Col:COMPLETE,Output:["d_date_sk","d_year","d_moy"]
+                                            <-Map 1 [SIMPLE_EDGE] vectorized
+                                              SHUFFLE [RS_289]
+                                                PartitionCols:_col0
+                                                Select Operator [SEL_288] (rows=525329897 width=118)
+                                                  Output:["_col0","_col1","_col2","_col3"]
+                                                  Filter Operator [FIL_287] (rows=525329897 width=118)
+                                                    predicate:((ss_sold_date_sk BETWEEN DynamicValue(RS_83_date_dim_d_date_sk_min) AND DynamicValue(RS_83_date_dim_d_date_sk_max) and in_bloom_filter(ss_sold_date_sk, DynamicValue(RS_83_date_dim_d_date_sk_bloom_filter))) and ss_sold_date_sk is not null and ss_store_sk is not null)
+                                                    TableScan [TS_70] (rows=575995635 width=118)
+                                                      default@store_sales,store_sales,Tbl:COMPLETE,Col:COMPLETE,Output:["ss_sold_date_sk","ss_item_sk","ss_store_sk","ss_sales_price"]
+                                                    <-Reducer 13 [BROADCAST_EDGE] vectorized
+                                                      BROADCAST [RS_286]
+                                                        Group By Operator [GBY_285] (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_284]
+                                                            Group By Operator [GBY_283] (rows=1 width=12)
+                                                              Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                                              Select Operator [SEL_282] (rows=564 width=4)
+                                                                Output:["_col0"]
+                                                                 Please refer to the previous Select Operator [SEL_280]
+                <-Reducer 9 [ONE_TO_ONE_EDGE]
+                  FORWARD [RS_106]
+                    PartitionCols:_col6, _col7, _col8, _col9, _col14
+                    Merge Join Operator [MERGEJOIN_277] (rows=241454 width=717)
+                      Conds:RS_307._col0, _col1, _col2, _col3, _col5=RS_318._col0, _col1, _col2, _col3, _col8(Inner),Output:["_col4","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14"]
+                    <-Reducer 6 [SIMPLE_EDGE] vectorized
+                      SHUFFLE [RS_307]
+                        PartitionCols:_col0, _col1, _col2, _col3, _col5
+                        Select Operator [SEL_305] (rows=162257387 width=485)
+                          Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
+                          Filter Operator [FIL_303] (rows=162257387 width=489)
+                            predicate:rank_window_0 is not null
+                            PTF Operator [PTF_301] (rows=162257387 width=489)
+                              Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col2 ASC NULLS LAST, _col3 ASC NULLS LAST","partition by:":"_col1, _col0, _col4, _col5"}]
+                               Please refer to the previous Select Operator [SEL_299]
+                    <-Reducer 11 [SIMPLE_EDGE] vectorized
+                      SHUFFLE [RS_318]
+                        PartitionCols:_col0, _col1, _col2, _col3, _col8
+                        Select Operator [SEL_317] (rows=241454 width=605)
+                          Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8"]
+                          Filter Operator [FIL_316] (rows=241454 width=605)
+                            predicate:CASE WHEN ((_col0 > 0)) THEN (((abs((_col7 - _col0)) / _col0) > 0.1)) ELSE (null) END
+                            Select Operator [SEL_315] (rows=482909 width=601)
+                              Output:["rank_window_1","_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
+                              Filter Operator [FIL_314] (rows=482909 width=601)
+                                predicate:((_col0 > 0) and (_col3 = 2000) and rank_window_1 is not null)
+                                PTF Operator [PTF_313] (rows=162257387 width=601)
+                                  Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col3 ASC NULLS LAST, _col4 ASC NULLS LAST","partition by:":"_col2, _col1, _col5, _col6"}]
+                                  Select Operator [SEL_312] (rows=162257387 width=601)
+                                    Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
+                                  <-Reducer 10 [SIMPLE_EDGE] vectorized
+                                    SHUFFLE [RS_311]
+                                      PartitionCols:_col1, _col0, _col4, _col5
+                                      Select Operator [SEL_310] (rows=162257387 width=489)
+                                        Output:["avg_window_0","_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
+                                        PTF Operator [PTF_309] (rows=162257387 width=489)
+                                          Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1 ASC NULLS FIRST, _col0 ASC NULLS FIRST, _col4 ASC NULLS FIRST, _col5 ASC NULLS FIRST, _col2 ASC NULLS FIRST","partition by:":"_col1, _col0, _col4, _col5, _col2"}]
+                                          Select Operator [SEL_308] (rows=162257387 width=489)
+                                            Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
+                                          <-Reducer 5 [SIMPLE_EDGE] vectorized
+                                            SHUFFLE [RS_298]
+                                              PartitionCols:_col1, _col0, _col4, _col5, _col2
+                                               Please refer to the previous Group By Operator [GBY_296]
+

http://git-wip-us.apache.org/repos/asf/hive/blob/b8299551/ql/src/test/results/clientpositive/perf/tez/constraints/query48.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query48.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query48.q.out
new file mode 100644
index 0000000..b84dfce
--- /dev/null
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query48.q.out
@@ -0,0 +1,252 @@
+PREHOOK: query: explain
+select sum (ss_quantity)
+ from store_sales, store, customer_demographics, customer_address, date_dim
+ where s_store_sk = ss_store_sk
+ and  ss_sold_date_sk = d_date_sk and d_year = 1998
+ and  
+ (
+  (
+   cd_demo_sk = ss_cdemo_sk
+   and 
+   cd_marital_status = 'M'
+   and 
+   cd_education_status = '4 yr Degree'
+   and 
+   ss_sales_price between 100.00 and 150.00  
+   )
+ or
+  (
+  cd_demo_sk = ss_cdemo_sk
+   and 
+   cd_marital_status = 'M'
+   and 
+   cd_education_status = '4 yr Degree'
+   and 
+   ss_sales_price between 50.00 and 100.00   
+  )
+ or 
+ (
+  cd_demo_sk = ss_cdemo_sk
+  and 
+   cd_marital_status = 'M'
+   and 
+   cd_education_status = '4 yr Degree'
+   and 
+   ss_sales_price between 150.00 and 200.00  
+ )
+ )
+ and
+ (
+  (
+  ss_addr_sk = ca_address_sk
+  and
+  ca_country = 'United States'
+  and
+  ca_state in ('KY', 'GA', 'NM')
+  and ss_net_profit between 0 and 2000  
+  )
+ or
+  (ss_addr_sk = ca_address_sk
+  and
+  ca_country = 'United States'
+  and
+  ca_state in ('MT', 'OR', 'IN')
+  and ss_net_profit between 150 and 3000 
+  )
+ or
+  (ss_addr_sk = ca_address_sk
+  and
+  ca_country = 'United States'
+  and
+  ca_state in ('WI', 'MO', 'WV')
+  and ss_net_profit between 50 and 25000 
+  )
+ )
+PREHOOK: type: QUERY
+PREHOOK: Input: default@customer_address
+PREHOOK: Input: default@customer_demographics
+PREHOOK: Input: default@date_dim
+PREHOOK: Input: default@store
+PREHOOK: Input: default@store_sales
+PREHOOK: Output: hdfs://### HDFS PATH ###
+POSTHOOK: query: explain
+select sum (ss_quantity)
+ from store_sales, store, customer_demographics, customer_address, date_dim
+ where s_store_sk = ss_store_sk
+ and  ss_sold_date_sk = d_date_sk and d_year = 1998
+ and  
+ (
+  (
+   cd_demo_sk = ss_cdemo_sk
+   and 
+   cd_marital_status = 'M'
+   and 
+   cd_education_status = '4 yr Degree'
+   and 
+   ss_sales_price between 100.00 and 150.00  
+   )
+ or
+  (
+  cd_demo_sk = ss_cdemo_sk
+   and 
+   cd_marital_status = 'M'
+   and 
+   cd_education_status = '4 yr Degree'
+   and 
+   ss_sales_price between 50.00 and 100.00   
+  )
+ or 
+ (
+  cd_demo_sk = ss_cdemo_sk
+  and 
+   cd_marital_status = 'M'
+   and 
+   cd_education_status = '4 yr Degree'
+   and 
+   ss_sales_price between 150.00 and 200.00  
+ )
+ )
+ and
+ (
+  (
+  ss_addr_sk = ca_address_sk
+  and
+  ca_country = 'United States'
+  and
+  ca_state in ('KY', 'GA', 'NM')
+  and ss_net_profit between 0 and 2000  
+  )
+ or
+  (ss_addr_sk = ca_address_sk
+  and
+  ca_country = 'United States'
+  and
+  ca_state in ('MT', 'OR', 'IN')
+  and ss_net_profit between 150 and 3000 
+  )
+ or
+  (ss_addr_sk = ca_address_sk
+  and
+  ca_country = 'United States'
+  and
+  ca_state in ('WI', 'MO', 'WV')
+  and ss_net_profit between 50 and 25000 
+  )
+ )
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@customer_address
+POSTHOOK: Input: default@customer_demographics
+POSTHOOK: Input: default@date_dim
+POSTHOOK: Input: default@store
+POSTHOOK: Input: default@store_sales
+POSTHOOK: Output: hdfs://### HDFS PATH ###
+Plan optimized by CBO.
+
+Vertex dependency in root stage
+Map 7 <- Reducer 11 (BROADCAST_EDGE), Reducer 6 (BROADCAST_EDGE), Reducer 9 (BROADCAST_EDGE)
+Reducer 11 <- Map 10 (CUSTOM_SIMPLE_EDGE)
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 7 (SIMPLE_EDGE)
+Reducer 3 <- Map 8 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
+Reducer 4 <- Map 10 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
+Reducer 5 <- Reducer 4 (CUSTOM_SIMPLE_EDGE)
+Reducer 6 <- Map 1 (CUSTOM_SIMPLE_EDGE)
+Reducer 9 <- Map 8 (CUSTOM_SIMPLE_EDGE)
+
+Stage-0
+  Fetch Operator
+    limit:-1
+    Stage-1
+      Reducer 5 vectorized
+      File Output Operator [FS_102]
+        Group By Operator [GBY_101] (rows=1 width=8)
+          Output:["_col0"],aggregations:["sum(VALUE._col0)"]
+        <-Reducer 4 [CUSTOM_SIMPLE_EDGE]
+          PARTITION_ONLY_SHUFFLE [RS_24]
+            Group By Operator [GBY_23] (rows=1 width=8)
+              Output:["_col0"],aggregations:["sum(_col4)"]
+              Select Operator [SEL_22] (rows=20247 width=24)
+                Output:["_col4"]
+                Filter Operator [FIL_21] (rows=20247 width=24)
+                  predicate:((_col10 and _col5) or (_col11 and _col6) or (_col12 and _col7))
+                  Merge Join Operator [MERGEJOIN_73] (rows=26999 width=24)
+                    Conds:RS_18._col3=RS_92._col0(Inner),Output:["_col4","_col5","_col6","_col7","_col10","_col11","_col12"]
+                  <-Map 10 [SIMPLE_EDGE] vectorized
+                    SHUFFLE [RS_92]
+                      PartitionCols:_col0
+                      Select Operator [SEL_91] (rows=3529412 width=16)
+                        Output:["_col0","_col1","_col2","_col3"]
+                        Filter Operator [FIL_90] (rows=3529412 width=187)
+                          predicate:((ca_country = 'United States') and (ca_state) IN ('KY', 'GA', 'NM', 'MT', 'OR', 'IN', 'WI', 'MO', 'WV'))
+                          TableScan [TS_9] (rows=40000000 width=187)
+                            default@customer_address,customer_address,Tbl:COMPLETE,Col:COMPLETE,Output:["ca_address_sk","ca_state","ca_country"]
+                  <-Reducer 3 [SIMPLE_EDGE]
+                    SHUFFLE [RS_18]
+                      PartitionCols:_col3
+                      Merge Join Operator [MERGEJOIN_72] (rows=305980 width=12)
+                        Conds:RS_15._col1=RS_84._col0(Inner),Output:["_col3","_col4","_col5","_col6","_col7"]
+                      <-Map 8 [SIMPLE_EDGE] vectorized
+                        PARTITION_ONLY_SHUFFLE [RS_84]
+                          PartitionCols:_col0
+                          Select Operator [SEL_83] (rows=652 width=4)
+                            Output:["_col0"]
+                            Filter Operator [FIL_82] (rows=652 width=8)
+                              predicate:(d_year = 1998)
+                              TableScan [TS_6] (rows=73049 width=8)
+                                default@date_dim,date_dim,Tbl:COMPLETE,Col:COMPLETE,Output:["d_date_sk","d_year"]
+                      <-Reducer 2 [SIMPLE_EDGE]
+                        SHUFFLE [RS_15]
+                          PartitionCols:_col1
+                          Merge Join Operator [MERGEJOIN_71] (rows=856943 width=12)
+                            Conds:RS_76._col0=RS_100._col1(Inner),Output:["_col1","_col3","_col4","_col5","_col6","_col7"]
+                          <-Map 1 [SIMPLE_EDGE] vectorized
+                            PARTITION_ONLY_SHUFFLE [RS_76]
+                              PartitionCols:_col0
+                              Select Operator [SEL_75] (rows=29552 width=4)
+                                Output:["_col0"]
+                                Filter Operator [FIL_74] (rows=29552 width=183)
+                                  predicate:((cd_education_status = '4 yr Degree') and (cd_marital_status = 'M'))
+                                  TableScan [TS_0] (rows=1861800 width=183)
+                                    default@customer_demographics,customer_demographics,Tbl:COMPLETE,Col:COMPLETE,Output:["cd_demo_sk","cd_marital_status","cd_education_status"]
+                          <-Map 7 [SIMPLE_EDGE] vectorized
+                            SHUFFLE [RS_100]
+                              PartitionCols:_col1
+                              Select Operator [SEL_99] (rows=53235296 width=27)
+                                Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
+                                Filter Operator [FIL_98] (rows=53235296 width=233)
+                                  predicate:((ss_addr_sk BETWEEN DynamicValue(RS_19_customer_address_ca_address_sk_min) AND DynamicValue(RS_19_customer_address_ca_address_sk_max) and in_bloom_filter(ss_addr_sk, DynamicValue(RS_19_customer_address_ca_address_sk_bloom_filter))) and (ss_cdemo_sk BETWEEN DynamicValue(RS_12_customer_demographics_cd_demo_sk_min) AND DynamicValue(RS_12_customer_demographics_cd_demo_sk_max) and in_bloom_filter(ss_cdemo_sk, DynamicValue(RS_12_customer_demographics_cd_demo_sk_bloom_filter))) and (ss_net_profit BETWEEN 0 AND 2000 or ss_net_profit BETWEEN 150 AND 3000 or ss_net_profit BETWEEN 50 AND 25000) and (ss_sales_price BETWEEN 100 AND 150 or ss_sales_price BETWEEN 50 AND 100 or ss_sales_price BETWEEN 150 AND 200) and (ss_sold_date_sk BETWEEN DynamicValue(RS_16_date_dim_d_date_sk_min) AND DynamicValue(RS_16_date_dim_d_date_sk_max) and in_bloom_filter(ss_sold_date_sk, DynamicValue(RS_16_date_dim_d_date_sk_bloom_filter))) and ss_addr_sk is not null and ss_c
 demo_sk is not null and ss_sold_date_sk is not null and ss_store_sk is not null)
+                                  TableScan [TS_3] (rows=575995635 width=233)
+                                    default@store_sales,store_sales,Tbl:COMPLETE,Col:COMPLETE,Output:["ss_sold_date_sk","ss_cdemo_sk","ss_addr_sk","ss_store_sk","ss_quantity","ss_sales_price","ss_net_profit"]
+                                  <-Reducer 11 [BROADCAST_EDGE] vectorized
+                                    BROADCAST [RS_97]
+                                      Group By Operator [GBY_96] (rows=1 width=12)
+                                        Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=3529412)"]
+                                      <-Map 10 [CUSTOM_SIMPLE_EDGE] vectorized
+                                        SHUFFLE [RS_95]
+                                          Group By Operator [GBY_94] (rows=1 width=12)
+                                            Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=3529412)"]
+                                            Select Operator [SEL_93] (rows=3529412 width=4)
+                                              Output:["_col0"]
+                                               Please refer to the previous Select Operator [SEL_91]
+                                  <-Reducer 6 [BROADCAST_EDGE] vectorized
+                                    BROADCAST [RS_81]
+                                      Group By Operator [GBY_80] (rows=1 width=12)
+                                        Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
+                                      <-Map 1 [CUSTOM_SIMPLE_EDGE] vectorized
+                                        PARTITION_ONLY_SHUFFLE [RS_79]
+                                          Group By Operator [GBY_78] (rows=1 width=12)
+                                            Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                            Select Operator [SEL_77] (rows=29552 width=4)
+                                              Output:["_col0"]
+                                               Please refer to the previous Select Operator [SEL_75]
+                                  <-Reducer 9 [BROADCAST_EDGE] vectorized
+                                    BROADCAST [RS_89]
+                                      Group By Operator [GBY_88] (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_87]
+                                          Group By Operator [GBY_86] (rows=1 width=12)
+                                            Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                            Select Operator [SEL_85] (rows=652 width=4)
+                                              Output:["_col0"]
+                                               Please refer to the previous Select Operator [SEL_83]
+