hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ser...@apache.org
Subject [18/50] [abbrv] hive git commit: HIVE-17543: Enable PerfCliDriver for HoS (Sahil Takiar, reviewed by Peter Vary) (addendum)
Date Tue, 03 Oct 2017 22:55:24 GMT
http://git-wip-us.apache.org/repos/asf/hive/blob/9244fdc7/ql/src/test/results/clientpositive/perf/tez/query15.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/query15.q.out b/ql/src/test/results/clientpositive/perf/tez/query15.q.out
new file mode 100644
index 0000000..cf6cf16
--- /dev/null
+++ b/ql/src/test/results/clientpositive/perf/tez/query15.q.out
@@ -0,0 +1,119 @@
+PREHOOK: query: explain
+select  ca_zip
+       ,sum(cs_sales_price)
+ from catalog_sales
+     ,customer
+     ,customer_address
+     ,date_dim
+ where cs_bill_customer_sk = c_customer_sk
+ 	and c_current_addr_sk = ca_address_sk 
+ 	and ( substr(ca_zip,1,5) in ('85669', '86197','88274','83405','86475',
+                                   '85392', '85460', '80348', '81792')
+ 	      or ca_state in ('CA','WA','GA')
+ 	      or cs_sales_price > 500)
+ 	and cs_sold_date_sk = d_date_sk
+ 	and d_qoy = 2 and d_year = 2000
+ group by ca_zip
+ order by ca_zip
+ limit 100
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select  ca_zip
+       ,sum(cs_sales_price)
+ from catalog_sales
+     ,customer
+     ,customer_address
+     ,date_dim
+ where cs_bill_customer_sk = c_customer_sk
+ 	and c_current_addr_sk = ca_address_sk 
+ 	and ( substr(ca_zip,1,5) in ('85669', '86197','88274','83405','86475',
+                                   '85392', '85460', '80348', '81792')
+ 	      or ca_state in ('CA','WA','GA')
+ 	      or cs_sales_price > 500)
+ 	and cs_sold_date_sk = d_date_sk
+ 	and d_qoy = 2 and d_year = 2000
+ group by ca_zip
+ order by ca_zip
+ limit 100
+POSTHOOK: type: QUERY
+Plan optimized by CBO.
+
+Vertex dependency in root stage
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 6 (SIMPLE_EDGE)
+Reducer 3 <- Reducer 2 (SIMPLE_EDGE), Reducer 8 (SIMPLE_EDGE)
+Reducer 4 <- Reducer 3 (SIMPLE_EDGE)
+Reducer 5 <- Reducer 4 (SIMPLE_EDGE)
+Reducer 8 <- Map 7 (SIMPLE_EDGE), Map 9 (SIMPLE_EDGE)
+
+Stage-0
+  Fetch Operator
+    limit:100
+    Stage-1
+      Reducer 5
+      File Output Operator [FS_31]
+        Limit [LIM_30] (rows=100 width=135)
+          Number of rows:100
+          Select Operator [SEL_29] (rows=174233858 width=135)
+            Output:["_col0","_col1"]
+          <-Reducer 4 [SIMPLE_EDGE]
+            SHUFFLE [RS_28]
+              Group By Operator [GBY_26] (rows=174233858 width=135)
+                Output:["_col0","_col1"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0
+              <-Reducer 3 [SIMPLE_EDGE]
+                SHUFFLE [RS_25]
+                  PartitionCols:_col0
+                  Group By Operator [GBY_24] (rows=348467716 width=135)
+                    Output:["_col0","_col1"],aggregations:["sum(_col7)"],keys:_col4
+                    Select Operator [SEL_23] (rows=348467716 width=135)
+                      Output:["_col4","_col7"]
+                      Filter Operator [FIL_22] (rows=348467716 width=135)
+                        predicate:((_col3) IN ('CA', 'WA', 'GA') or (_col7 > 500) or (substr(_col4, 1, 5)) IN ('85669', '86197', '88274', '83405', '86475', '85392', '85460', '80348', '81792'))
+                        Merge Join Operator [MERGEJOIN_46] (rows=348467716 width=135)
+                          Conds:RS_19._col0=RS_20._col1(Inner),Output:["_col3","_col4","_col7"]
+                        <-Reducer 2 [SIMPLE_EDGE]
+                          SHUFFLE [RS_19]
+                            PartitionCols:_col0
+                            Merge Join Operator [MERGEJOIN_44] (rows=88000001 width=860)
+                              Conds:RS_16._col1=RS_17._col0(Inner),Output:["_col0","_col3","_col4"]
+                            <-Map 1 [SIMPLE_EDGE]
+                              SHUFFLE [RS_16]
+                                PartitionCols:_col1
+                                Select Operator [SEL_2] (rows=80000000 width=860)
+                                  Output:["_col0","_col1"]
+                                  Filter Operator [FIL_40] (rows=80000000 width=860)
+                                    predicate:(c_current_addr_sk is not null and c_customer_sk is not null)
+                                    TableScan [TS_0] (rows=80000000 width=860)
+                                      default@customer,customer,Tbl:COMPLETE,Col:NONE,Output:["c_customer_sk","c_current_addr_sk"]
+                            <-Map 6 [SIMPLE_EDGE]
+                              SHUFFLE [RS_17]
+                                PartitionCols:_col0
+                                Select Operator [SEL_5] (rows=40000000 width=1014)
+                                  Output:["_col0","_col1","_col2"]
+                                  Filter Operator [FIL_41] (rows=40000000 width=1014)
+                                    predicate:ca_address_sk is not null
+                                    TableScan [TS_3] (rows=40000000 width=1014)
+                                      default@customer_address,customer_address,Tbl:COMPLETE,Col:NONE,Output:["ca_address_sk","ca_state","ca_zip"]
+                        <-Reducer 8 [SIMPLE_EDGE]
+                          SHUFFLE [RS_20]
+                            PartitionCols:_col1
+                            Merge Join Operator [MERGEJOIN_45] (rows=316788826 width=135)
+                              Conds:RS_12._col0=RS_13._col0(Inner),Output:["_col1","_col2"]
+                            <-Map 7 [SIMPLE_EDGE]
+                              SHUFFLE [RS_12]
+                                PartitionCols:_col0
+                                Select Operator [SEL_8] (rows=287989836 width=135)
+                                  Output:["_col0","_col1","_col2"]
+                                  Filter Operator [FIL_42] (rows=287989836 width=135)
+                                    predicate:(cs_bill_customer_sk is not null and cs_sold_date_sk is not null)
+                                    TableScan [TS_6] (rows=287989836 width=135)
+                                      default@catalog_sales,catalog_sales,Tbl:COMPLETE,Col:NONE,Output:["cs_sold_date_sk","cs_bill_customer_sk","cs_sales_price"]
+                            <-Map 9 [SIMPLE_EDGE]
+                              SHUFFLE [RS_13]
+                                PartitionCols:_col0
+                                Select Operator [SEL_11] (rows=18262 width=1119)
+                                  Output:["_col0"]
+                                  Filter Operator [FIL_43] (rows=18262 width=1119)
+                                    predicate:((d_qoy = 2) and (d_year = 2000) and d_date_sk is not null)
+                                    TableScan [TS_9] (rows=73049 width=1119)
+                                      default@date_dim,date_dim,Tbl:COMPLETE,Col:NONE,Output:["d_date_sk","d_year","d_qoy"]
+

http://git-wip-us.apache.org/repos/asf/hive/blob/9244fdc7/ql/src/test/results/clientpositive/perf/tez/query16.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/query16.q.out b/ql/src/test/results/clientpositive/perf/tez/query16.q.out
new file mode 100644
index 0000000..b2b990e
--- /dev/null
+++ b/ql/src/test/results/clientpositive/perf/tez/query16.q.out
@@ -0,0 +1,192 @@
+PREHOOK: query: explain
+select  
+   count(distinct cs_order_number) as `order count`
+  ,sum(cs_ext_ship_cost) as `total shipping cost`
+  ,sum(cs_net_profit) as `total net profit`
+from
+   catalog_sales cs1
+  ,date_dim
+  ,customer_address
+  ,call_center
+where
+    d_date between '2001-4-01' and 
+           (cast('2001-4-01' as date) + 60 days)
+and cs1.cs_ship_date_sk = d_date_sk
+and cs1.cs_ship_addr_sk = ca_address_sk
+and ca_state = 'NY'
+and cs1.cs_call_center_sk = cc_call_center_sk
+and cc_county in ('Ziebach County','Levy County','Huron County','Franklin Parish',
+                  'Daviess County'
+)
+and exists (select *
+            from catalog_sales cs2
+            where cs1.cs_order_number = cs2.cs_order_number
+              and cs1.cs_warehouse_sk <> cs2.cs_warehouse_sk)
+and not exists(select *
+               from catalog_returns cr1
+               where cs1.cs_order_number = cr1.cr_order_number)
+order by count(distinct cs_order_number)
+limit 100
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select  
+   count(distinct cs_order_number) as `order count`
+  ,sum(cs_ext_ship_cost) as `total shipping cost`
+  ,sum(cs_net_profit) as `total net profit`
+from
+   catalog_sales cs1
+  ,date_dim
+  ,customer_address
+  ,call_center
+where
+    d_date between '2001-4-01' and 
+           (cast('2001-4-01' as date) + 60 days)
+and cs1.cs_ship_date_sk = d_date_sk
+and cs1.cs_ship_addr_sk = ca_address_sk
+and ca_state = 'NY'
+and cs1.cs_call_center_sk = cc_call_center_sk
+and cc_county in ('Ziebach County','Levy County','Huron County','Franklin Parish',
+                  'Daviess County'
+)
+and exists (select *
+            from catalog_sales cs2
+            where cs1.cs_order_number = cs2.cs_order_number
+              and cs1.cs_warehouse_sk <> cs2.cs_warehouse_sk)
+and not exists(select *
+               from catalog_returns cr1
+               where cs1.cs_order_number = cr1.cr_order_number)
+order by count(distinct cs_order_number)
+limit 100
+POSTHOOK: type: QUERY
+Plan optimized by CBO.
+
+Vertex dependency in root stage
+Reducer 13 <- Map 12 (SIMPLE_EDGE)
+Reducer 15 <- Map 14 (SIMPLE_EDGE)
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 9 (SIMPLE_EDGE)
+Reducer 3 <- Map 10 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
+Reducer 4 <- Map 11 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
+Reducer 5 <- Reducer 13 (ONE_TO_ONE_EDGE), Reducer 15 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE)
+Reducer 6 <- Reducer 5 (SIMPLE_EDGE)
+Reducer 7 <- Reducer 6 (CUSTOM_SIMPLE_EDGE)
+Reducer 8 <- Reducer 7 (SIMPLE_EDGE)
+
+Stage-0
+  Fetch Operator
+    limit:-1
+    Stage-1
+      Reducer 8
+      File Output Operator [FS_50]
+        Limit [LIM_48] (rows=1 width=344)
+          Number of rows:100
+          Select Operator [SEL_47] (rows=1 width=344)
+            Output:["_col0","_col1","_col2"]
+          <-Reducer 7 [SIMPLE_EDGE]
+            SHUFFLE [RS_46]
+              Select Operator [SEL_45] (rows=1 width=344)
+                Output:["_col1","_col2","_col3"]
+                Group By Operator [GBY_78] (rows=1 width=344)
+                  Output:["_col0","_col1","_col2"],aggregations:["count(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)"]
+                <-Reducer 6 [CUSTOM_SIMPLE_EDGE]
+                  PARTITION_ONLY_SHUFFLE [RS_77]
+                    Group By Operator [GBY_76] (rows=1 width=344)
+                      Output:["_col0","_col1","_col2"],aggregations:["count(_col0)","sum(_col1)","sum(_col2)"]
+                      Group By Operator [GBY_75] (rows=421645953 width=135)
+                        Output:["_col0","_col1","_col2"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)"],keys:KEY._col0
+                      <-Reducer 5 [SIMPLE_EDGE]
+                        SHUFFLE [RS_74]
+                          PartitionCols:_col0
+                          Group By Operator [GBY_73] (rows=421645953 width=135)
+                            Output:["_col0","_col2","_col3"],aggregations:["sum(_col5)","sum(_col6)"],keys:_col4
+                            Select Operator [SEL_41] (rows=421645953 width=135)
+                              Output:["_col4","_col5","_col6"]
+                              Filter Operator [FIL_40] (rows=421645953 width=135)
+                                predicate:_col16 is null
+                                Select Operator [SEL_39] (rows=843291907 width=135)
+                                  Output:["_col4","_col5","_col6","_col16"]
+                                  Merge Join Operator [MERGEJOIN_82] (rows=843291907 width=135)
+                                    Conds:RS_35._col4=RS_36._col0(Left Outer),RS_35._col4=RS_37._col1(Inner),Output:["_col3","_col4","_col5","_col6","_col14","_col15"],residual filter predicates:{(_col3 <> _col15)}
+                                  <-Reducer 13 [ONE_TO_ONE_EDGE]
+                                    FORWARD [RS_36]
+                                      PartitionCols:_col0
+                                      Select Operator [SEL_18] (rows=14399440 width=106)
+                                        Output:["_col0","_col1"]
+                                        Group By Operator [GBY_17] (rows=14399440 width=106)
+                                          Output:["_col0"],keys:KEY._col0
+                                        <-Map 12 [SIMPLE_EDGE]
+                                          SHUFFLE [RS_16]
+                                            PartitionCols:_col0
+                                            Group By Operator [GBY_15] (rows=28798881 width=106)
+                                              Output:["_col0"],keys:cr_order_number
+                                              Filter Operator [FIL_71] (rows=28798881 width=106)
+                                                predicate:cr_order_number is not null
+                                                TableScan [TS_12] (rows=28798881 width=106)
+                                                  default@catalog_returns,cr1,Tbl:COMPLETE,Col:NONE,Output:["cr_order_number"]
+                                  <-Reducer 15 [SIMPLE_EDGE]
+                                    SHUFFLE [RS_37]
+                                      PartitionCols:_col1
+                                      Select Operator [SEL_25] (rows=143994918 width=135)
+                                        Output:["_col0","_col1"]
+                                        Group By Operator [GBY_24] (rows=143994918 width=135)
+                                          Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
+                                        <-Map 14 [SIMPLE_EDGE]
+                                          SHUFFLE [RS_23]
+                                            PartitionCols:_col0, _col1
+                                            Group By Operator [GBY_22] (rows=287989836 width=135)
+                                              Output:["_col0","_col1"],keys:cs_order_number, cs_warehouse_sk
+                                              Filter Operator [FIL_72] (rows=287989836 width=135)
+                                                predicate:(cs_order_number is not null and cs_warehouse_sk is not null)
+                                                TableScan [TS_19] (rows=287989836 width=135)
+                                                  default@catalog_sales,cs2,Tbl:COMPLETE,Col:NONE,Output:["cs_warehouse_sk","cs_order_number"]
+                                  <-Reducer 4 [SIMPLE_EDGE]
+                                    SHUFFLE [RS_35]
+                                      PartitionCols:_col4
+                                      Merge Join Operator [MERGEJOIN_81] (rows=383314495 width=135)
+                                        Conds:RS_32._col2=RS_33._col0(Inner),Output:["_col3","_col4","_col5","_col6"]
+                                      <-Map 11 [SIMPLE_EDGE]
+                                        SHUFFLE [RS_33]
+                                          PartitionCols:_col0
+                                          Select Operator [SEL_11] (rows=30 width=2045)
+                                            Output:["_col0"]
+                                            Filter Operator [FIL_70] (rows=30 width=2045)
+                                              predicate:((cc_county) IN ('Ziebach County', 'Levy County', 'Huron County', 'Franklin Parish', 'Daviess County') and cc_call_center_sk is not null)
+                                              TableScan [TS_9] (rows=60 width=2045)
+                                                default@call_center,call_center,Tbl:COMPLETE,Col:NONE,Output:["cc_call_center_sk","cc_county"]
+                                      <-Reducer 3 [SIMPLE_EDGE]
+                                        SHUFFLE [RS_32]
+                                          PartitionCols:_col2
+                                          Merge Join Operator [MERGEJOIN_80] (rows=348467716 width=135)
+                                            Conds:RS_29._col1=RS_30._col0(Inner),Output:["_col2","_col3","_col4","_col5","_col6"]
+                                          <-Map 10 [SIMPLE_EDGE]
+                                            SHUFFLE [RS_30]
+                                              PartitionCols:_col0
+                                              Select Operator [SEL_8] (rows=20000000 width=1014)
+                                                Output:["_col0"]
+                                                Filter Operator [FIL_69] (rows=20000000 width=1014)
+                                                  predicate:((ca_state = 'NY') and ca_address_sk is not null)
+                                                  TableScan [TS_6] (rows=40000000 width=1014)
+                                                    default@customer_address,customer_address,Tbl:COMPLETE,Col:NONE,Output:["ca_address_sk","ca_state"]
+                                          <-Reducer 2 [SIMPLE_EDGE]
+                                            SHUFFLE [RS_29]
+                                              PartitionCols:_col1
+                                              Merge Join Operator [MERGEJOIN_79] (rows=316788826 width=135)
+                                                Conds:RS_26._col0=RS_27._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col5","_col6"]
+                                              <-Map 1 [SIMPLE_EDGE]
+                                                SHUFFLE [RS_26]
+                                                  PartitionCols:_col0
+                                                  Select Operator [SEL_2] (rows=287989836 width=135)
+                                                    Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
+                                                    Filter Operator [FIL_67] (rows=287989836 width=135)
+                                                      predicate:(cs_call_center_sk is not null and cs_ship_addr_sk is not null and cs_ship_date_sk is not null)
+                                                      TableScan [TS_0] (rows=287989836 width=135)
+                                                        default@catalog_sales,cs1,Tbl:COMPLETE,Col:NONE,Output:["cs_ship_date_sk","cs_ship_addr_sk","cs_call_center_sk","cs_warehouse_sk","cs_order_number","cs_ext_ship_cost","cs_net_profit"]
+                                              <-Map 9 [SIMPLE_EDGE]
+                                                SHUFFLE [RS_27]
+                                                  PartitionCols:_col0
+                                                  Select Operator [SEL_5] (rows=8116 width=1119)
+                                                    Output:["_col0"]
+                                                    Filter Operator [FIL_68] (rows=8116 width=1119)
+                                                      predicate:(CAST( d_date AS TIMESTAMP) BETWEEN 2001-04-01 00:00:00.0 AND 2001-05-31 01:00:00.0 and d_date_sk is not null)
+                                                      TableScan [TS_3] (rows=73049 width=1119)
+                                                        default@date_dim,date_dim,Tbl:COMPLETE,Col:NONE,Output:["d_date_sk","d_date"]
+

http://git-wip-us.apache.org/repos/asf/hive/blob/9244fdc7/ql/src/test/results/clientpositive/perf/tez/query17.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/query17.q.out b/ql/src/test/results/clientpositive/perf/tez/query17.q.out
new file mode 100644
index 0000000..7c195c2
--- /dev/null
+++ b/ql/src/test/results/clientpositive/perf/tez/query17.q.out
@@ -0,0 +1,225 @@
+PREHOOK: query: explain
+select  i_item_id
+       ,i_item_desc
+       ,s_state
+       ,count(ss_quantity) as store_sales_quantitycount
+       ,avg(ss_quantity) as store_sales_quantityave
+       ,stddev_samp(ss_quantity) as store_sales_quantitystdev
+       ,stddev_samp(ss_quantity)/avg(ss_quantity) as store_sales_quantitycov
+       ,count(sr_return_quantity) as_store_returns_quantitycount
+       ,avg(sr_return_quantity) as_store_returns_quantityave
+       ,stddev_samp(sr_return_quantity) as_store_returns_quantitystdev
+       ,stddev_samp(sr_return_quantity)/avg(sr_return_quantity) as store_returns_quantitycov
+       ,count(cs_quantity) as catalog_sales_quantitycount ,avg(cs_quantity) as catalog_sales_quantityave
+       ,stddev_samp(cs_quantity)/avg(cs_quantity) as catalog_sales_quantitystdev
+       ,stddev_samp(cs_quantity)/avg(cs_quantity) as catalog_sales_quantitycov
+ from store_sales
+     ,store_returns
+     ,catalog_sales
+     ,date_dim d1
+     ,date_dim d2
+     ,date_dim d3
+     ,store
+     ,item
+ where d1.d_quarter_name = '2000Q1'
+   and d1.d_date_sk = ss_sold_date_sk
+   and i_item_sk = ss_item_sk
+   and s_store_sk = ss_store_sk
+   and ss_customer_sk = sr_customer_sk
+   and ss_item_sk = sr_item_sk
+   and ss_ticket_number = sr_ticket_number
+   and sr_returned_date_sk = d2.d_date_sk
+   and d2.d_quarter_name in ('2000Q1','2000Q2','2000Q3')
+   and sr_customer_sk = cs_bill_customer_sk
+   and sr_item_sk = cs_item_sk
+   and cs_sold_date_sk = d3.d_date_sk
+   and d3.d_quarter_name in ('2000Q1','2000Q2','2000Q3')
+ group by i_item_id
+         ,i_item_desc
+         ,s_state
+ order by i_item_id
+         ,i_item_desc
+         ,s_state
+limit 100
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select  i_item_id
+       ,i_item_desc
+       ,s_state
+       ,count(ss_quantity) as store_sales_quantitycount
+       ,avg(ss_quantity) as store_sales_quantityave
+       ,stddev_samp(ss_quantity) as store_sales_quantitystdev
+       ,stddev_samp(ss_quantity)/avg(ss_quantity) as store_sales_quantitycov
+       ,count(sr_return_quantity) as_store_returns_quantitycount
+       ,avg(sr_return_quantity) as_store_returns_quantityave
+       ,stddev_samp(sr_return_quantity) as_store_returns_quantitystdev
+       ,stddev_samp(sr_return_quantity)/avg(sr_return_quantity) as store_returns_quantitycov
+       ,count(cs_quantity) as catalog_sales_quantitycount ,avg(cs_quantity) as catalog_sales_quantityave
+       ,stddev_samp(cs_quantity)/avg(cs_quantity) as catalog_sales_quantitystdev
+       ,stddev_samp(cs_quantity)/avg(cs_quantity) as catalog_sales_quantitycov
+ from store_sales
+     ,store_returns
+     ,catalog_sales
+     ,date_dim d1
+     ,date_dim d2
+     ,date_dim d3
+     ,store
+     ,item
+ where d1.d_quarter_name = '2000Q1'
+   and d1.d_date_sk = ss_sold_date_sk
+   and i_item_sk = ss_item_sk
+   and s_store_sk = ss_store_sk
+   and ss_customer_sk = sr_customer_sk
+   and ss_item_sk = sr_item_sk
+   and ss_ticket_number = sr_ticket_number
+   and sr_returned_date_sk = d2.d_date_sk
+   and d2.d_quarter_name in ('2000Q1','2000Q2','2000Q3')
+   and sr_customer_sk = cs_bill_customer_sk
+   and sr_item_sk = cs_item_sk
+   and cs_sold_date_sk = d3.d_date_sk
+   and d3.d_quarter_name in ('2000Q1','2000Q2','2000Q3')
+ group by i_item_id
+         ,i_item_desc
+         ,s_state
+ order by i_item_id
+         ,i_item_desc
+         ,s_state
+limit 100
+POSTHOOK: type: QUERY
+Plan optimized by CBO.
+
+Vertex dependency in root stage
+Reducer 10 <- Reducer 11 (SIMPLE_EDGE), Reducer 9 (SIMPLE_EDGE)
+Reducer 11 <- Map 14 (SIMPLE_EDGE), Map 8 (SIMPLE_EDGE)
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 8 (SIMPLE_EDGE)
+Reducer 3 <- Map 12 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
+Reducer 4 <- Reducer 10 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
+Reducer 5 <- Map 15 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE)
+Reducer 6 <- Reducer 5 (SIMPLE_EDGE)
+Reducer 7 <- Reducer 6 (SIMPLE_EDGE)
+Reducer 9 <- Map 13 (SIMPLE_EDGE), Map 8 (SIMPLE_EDGE)
+
+Stage-0
+  Fetch Operator
+    limit:100
+    Stage-1
+      Reducer 7
+      File Output Operator [FS_55]
+        Limit [LIM_54] (rows=100 width=88)
+          Number of rows:100
+          Select Operator [SEL_53] (rows=421657640 width=88)
+            Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14"]
+          <-Reducer 6 [SIMPLE_EDGE]
+            SHUFFLE [RS_52]
+              Select Operator [SEL_51] (rows=421657640 width=88)
+                Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13"]
+                Group By Operator [GBY_50] (rows=421657640 width=88)
+                  Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11"],aggregations:["count(VALUE._col0)","avg(VALUE._col1)","stddev_samp(VALUE._col2)","count(VALUE._col3)","avg(VALUE._col4)","stddev_samp(VALUE._col5)","count(VALUE._col6)","avg(VALUE._col7)","stddev_samp(VALUE._col8)"],keys:KEY._col0, KEY._col1, KEY._col2
+                <-Reducer 5 [SIMPLE_EDGE]
+                  SHUFFLE [RS_49]
+                    PartitionCols:_col0, _col1, _col2
+                    Group By Operator [GBY_48] (rows=843315281 width=88)
+                      Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11"],aggregations:["count(_col5)","avg(_col5)","stddev_samp(_col5)","count(_col21)","avg(_col21)","stddev_samp(_col21)","count(_col14)","avg(_col14)","stddev_samp(_col14)"],keys:_col9, _col10, _col25
+                      Merge Join Operator [MERGEJOIN_98] (rows=843315281 width=88)
+                        Conds:RS_44._col3=RS_45._col0(Inner),Output:["_col5","_col9","_col10","_col14","_col21","_col25"]
+                      <-Map 15 [SIMPLE_EDGE]
+                        SHUFFLE [RS_45]
+                          PartitionCols:_col0
+                          Select Operator [SEL_34] (rows=1704 width=1910)
+                            Output:["_col0","_col1"]
+                            Filter Operator [FIL_91] (rows=1704 width=1910)
+                              predicate:s_store_sk is not null
+                              TableScan [TS_32] (rows=1704 width=1910)
+                                default@store,store,Tbl:COMPLETE,Col:NONE,Output:["s_store_sk","s_state"]
+                      <-Reducer 4 [SIMPLE_EDGE]
+                        SHUFFLE [RS_44]
+                          PartitionCols:_col3
+                          Merge Join Operator [MERGEJOIN_97] (rows=766650239 width=88)
+                            Conds:RS_41._col1, _col2, _col4=RS_42._col7, _col8, _col9(Inner),Output:["_col3","_col5","_col9","_col10","_col14","_col21"]
+                          <-Reducer 10 [SIMPLE_EDGE]
+                            SHUFFLE [RS_42]
+                              PartitionCols:_col7, _col8, _col9
+                              Merge Join Operator [MERGEJOIN_96] (rows=348467716 width=135)
+                                Conds:RS_28._col2, _col1=RS_29._col1, _col2(Inner),Output:["_col3","_col7","_col8","_col9","_col10"]
+                              <-Reducer 11 [SIMPLE_EDGE]
+                                SHUFFLE [RS_29]
+                                  PartitionCols:_col1, _col2
+                                  Merge Join Operator [MERGEJOIN_95] (rows=63350266 width=77)
+                                    Conds:RS_21._col0=RS_22._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
+                                  <-Map 8 [SIMPLE_EDGE]
+                                    SHUFFLE [RS_22]
+                                      PartitionCols:_col0
+                                      Select Operator [SEL_20] (rows=36525 width=1119)
+                                        Output:["_col0"]
+                                        Filter Operator [FIL_90] (rows=36525 width=1119)
+                                          predicate:((d_quarter_name) IN ('2000Q1', '2000Q2', '2000Q3') and d_date_sk is not null)
+                                          TableScan [TS_3] (rows=73049 width=1119)
+                                            default@date_dim,d1,Tbl:COMPLETE,Col:NONE,Output:["d_date_sk","d_quarter_name"]
+                                  <-Map 14 [SIMPLE_EDGE]
+                                    SHUFFLE [RS_21]
+                                      PartitionCols:_col0
+                                      Select Operator [SEL_17] (rows=57591150 width=77)
+                                        Output:["_col0","_col1","_col2","_col3","_col4"]
+                                        Filter Operator [FIL_89] (rows=57591150 width=77)
+                                          predicate:(sr_customer_sk is not null and sr_item_sk is not null and sr_returned_date_sk is not null and sr_ticket_number is not null)
+                                          TableScan [TS_15] (rows=57591150 width=77)
+                                            default@store_returns,store_returns,Tbl:COMPLETE,Col:NONE,Output:["sr_returned_date_sk","sr_item_sk","sr_customer_sk","sr_ticket_number","sr_return_quantity"]
+                              <-Reducer 9 [SIMPLE_EDGE]
+                                SHUFFLE [RS_28]
+                                  PartitionCols:_col2, _col1
+                                  Merge Join Operator [MERGEJOIN_94] (rows=316788826 width=135)
+                                    Conds:RS_25._col0=RS_26._col0(Inner),Output:["_col1","_col2","_col3"]
+                                  <-Map 8 [SIMPLE_EDGE]
+                                    SHUFFLE [RS_26]
+                                      PartitionCols:_col0
+                                      Select Operator [SEL_14] (rows=36525 width=1119)
+                                        Output:["_col0"]
+                                        Filter Operator [FIL_88] (rows=36525 width=1119)
+                                          predicate:((d_quarter_name) IN ('2000Q1', '2000Q2', '2000Q3') and d_date_sk is not null)
+                                           Please refer to the previous TableScan [TS_3]
+                                  <-Map 13 [SIMPLE_EDGE]
+                                    SHUFFLE [RS_25]
+                                      PartitionCols:_col0
+                                      Select Operator [SEL_11] (rows=287989836 width=135)
+                                        Output:["_col0","_col1","_col2","_col3"]
+                                        Filter Operator [FIL_87] (rows=287989836 width=135)
+                                          predicate:(cs_bill_customer_sk is not null and cs_item_sk is not null and cs_sold_date_sk is not null)
+                                          TableScan [TS_9] (rows=287989836 width=135)
+                                            default@catalog_sales,catalog_sales,Tbl:COMPLETE,Col:NONE,Output:["cs_sold_date_sk","cs_bill_customer_sk","cs_item_sk","cs_quantity"]
+                          <-Reducer 3 [SIMPLE_EDGE]
+                            SHUFFLE [RS_41]
+                              PartitionCols:_col1, _col2, _col4
+                              Merge Join Operator [MERGEJOIN_93] (rows=696954748 width=88)
+                                Conds:RS_38._col1=RS_39._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col5","_col9","_col10"]
+                              <-Map 12 [SIMPLE_EDGE]
+                                SHUFFLE [RS_39]
+                                  PartitionCols:_col0
+                                  Select Operator [SEL_8] (rows=462000 width=1436)
+                                    Output:["_col0","_col1","_col2"]
+                                    Filter Operator [FIL_86] (rows=462000 width=1436)
+                                      predicate:i_item_sk is not null
+                                      TableScan [TS_6] (rows=462000 width=1436)
+                                        default@item,item,Tbl:COMPLETE,Col:NONE,Output:["i_item_sk","i_item_id","i_item_desc"]
+                              <-Reducer 2 [SIMPLE_EDGE]
+                                SHUFFLE [RS_38]
+                                  PartitionCols:_col1
+                                  Merge Join Operator [MERGEJOIN_92] (rows=633595212 width=88)
+                                    Conds:RS_35._col0=RS_36._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col5"]
+                                  <-Map 8 [SIMPLE_EDGE]
+                                    SHUFFLE [RS_36]
+                                      PartitionCols:_col0
+                                      Select Operator [SEL_5] (rows=36524 width=1119)
+                                        Output:["_col0"]
+                                        Filter Operator [FIL_85] (rows=36524 width=1119)
+                                          predicate:((d_quarter_name = '2000Q1') and d_date_sk is not null)
+                                           Please refer to the previous TableScan [TS_3]
+                                  <-Map 1 [SIMPLE_EDGE]
+                                    SHUFFLE [RS_35]
+                                      PartitionCols:_col0
+                                      Select Operator [SEL_2] (rows=575995635 width=88)
+                                        Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
+                                        Filter Operator [FIL_84] (rows=575995635 width=88)
+                                          predicate:(ss_customer_sk is not null and ss_item_sk is not null and ss_sold_date_sk is not null and ss_store_sk is not null and ss_ticket_number is not null)
+                                          TableScan [TS_0] (rows=575995635 width=88)
+                                            default@store_sales,store_sales,Tbl:COMPLETE,Col:NONE,Output:["ss_sold_date_sk","ss_item_sk","ss_customer_sk","ss_store_sk","ss_ticket_number","ss_quantity"]
+

http://git-wip-us.apache.org/repos/asf/hive/blob/9244fdc7/ql/src/test/results/clientpositive/perf/tez/query18.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/query18.q.out b/ql/src/test/results/clientpositive/perf/tez/query18.q.out
new file mode 100644
index 0000000..1f0ec90
--- /dev/null
+++ b/ql/src/test/results/clientpositive/perf/tez/query18.q.out
@@ -0,0 +1,194 @@
+PREHOOK: query: explain
+select  i_item_id,
+        ca_country,
+        ca_state, 
+        ca_county,
+        avg( cast(cs_quantity as numeric(12,2))) agg1,
+        avg( cast(cs_list_price as numeric(12,2))) agg2,
+        avg( cast(cs_coupon_amt as numeric(12,2))) agg3,
+        avg( cast(cs_sales_price as numeric(12,2))) agg4,
+        avg( cast(cs_net_profit as numeric(12,2))) agg5,
+        avg( cast(c_birth_year as numeric(12,2))) agg6,
+        avg( cast(cd1.cd_dep_count as numeric(12,2))) agg7
+ from catalog_sales, customer_demographics cd1, 
+      customer_demographics cd2, customer, customer_address, date_dim, item
+ where cs_sold_date_sk = d_date_sk and
+       cs_item_sk = i_item_sk and
+       cs_bill_cdemo_sk = cd1.cd_demo_sk and
+       cs_bill_customer_sk = c_customer_sk and
+       cd1.cd_gender = 'M' and 
+       cd1.cd_education_status = 'College' and
+       c_current_cdemo_sk = cd2.cd_demo_sk and
+       c_current_addr_sk = ca_address_sk and
+       c_birth_month in (9,5,12,4,1,10) and
+       d_year = 2001 and
+       ca_state in ('ND','WI','AL'
+                   ,'NC','OK','MS','TN')
+ group by rollup (i_item_id, ca_country, ca_state, ca_county)
+ order by ca_country,
+        ca_state, 
+        ca_county,
+	i_item_id
+ limit 100
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select  i_item_id,
+        ca_country,
+        ca_state, 
+        ca_county,
+        avg( cast(cs_quantity as numeric(12,2))) agg1,
+        avg( cast(cs_list_price as numeric(12,2))) agg2,
+        avg( cast(cs_coupon_amt as numeric(12,2))) agg3,
+        avg( cast(cs_sales_price as numeric(12,2))) agg4,
+        avg( cast(cs_net_profit as numeric(12,2))) agg5,
+        avg( cast(c_birth_year as numeric(12,2))) agg6,
+        avg( cast(cd1.cd_dep_count as numeric(12,2))) agg7
+ from catalog_sales, customer_demographics cd1, 
+      customer_demographics cd2, customer, customer_address, date_dim, item
+ where cs_sold_date_sk = d_date_sk and
+       cs_item_sk = i_item_sk and
+       cs_bill_cdemo_sk = cd1.cd_demo_sk and
+       cs_bill_customer_sk = c_customer_sk and
+       cd1.cd_gender = 'M' and 
+       cd1.cd_education_status = 'College' and
+       c_current_cdemo_sk = cd2.cd_demo_sk and
+       c_current_addr_sk = ca_address_sk and
+       c_birth_month in (9,5,12,4,1,10) and
+       d_year = 2001 and
+       ca_state in ('ND','WI','AL'
+                   ,'NC','OK','MS','TN')
+ group by rollup (i_item_id, ca_country, ca_state, ca_county)
+ order by ca_country,
+        ca_state, 
+        ca_county,
+	i_item_id
+ limit 100
+POSTHOOK: type: QUERY
+Plan optimized by CBO.
+
+Vertex dependency in root stage
+Reducer 10 <- Map 13 (SIMPLE_EDGE), Map 9 (SIMPLE_EDGE)
+Reducer 11 <- Map 14 (SIMPLE_EDGE), Reducer 10 (SIMPLE_EDGE)
+Reducer 12 <- Map 15 (SIMPLE_EDGE), Reducer 11 (SIMPLE_EDGE)
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 7 (SIMPLE_EDGE)
+Reducer 3 <- Map 8 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
+Reducer 4 <- Reducer 12 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
+Reducer 5 <- Reducer 4 (SIMPLE_EDGE)
+Reducer 6 <- Reducer 5 (SIMPLE_EDGE)
+
+Stage-0
+  Fetch Operator
+    limit:100
+    Stage-1
+      Reducer 6
+      File Output Operator [FS_49]
+        Limit [LIM_48] (rows=100 width=135)
+          Number of rows:100
+          Select Operator [SEL_47] (rows=1054114882 width=135)
+            Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10"]
+          <-Reducer 5 [SIMPLE_EDGE]
+            SHUFFLE [RS_46]
+              Select Operator [SEL_45] (rows=1054114882 width=135)
+                Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10"]
+                Group By Operator [GBY_44] (rows=1054114882 width=135)
+                  Output:["_col0","_col1","_col2","_col3","_col5","_col6","_col7","_col8","_col9","_col10","_col11"],aggregations:["avg(VALUE._col0)","avg(VALUE._col1)","avg(VALUE._col2)","avg(VALUE._col3)","avg(VALUE._col4)","avg(VALUE._col5)","avg(VALUE._col6)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4
+                <-Reducer 4 [SIMPLE_EDGE]
+                  SHUFFLE [RS_43]
+                    PartitionCols:_col0, _col1, _col2, _col3, _col4
+                    Group By Operator [GBY_42] (rows=2108229765 width=135)
+                      Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11"],aggregations:["avg(_col4)","avg(_col5)","avg(_col6)","avg(_col7)","avg(_col8)","avg(_col9)","avg(_col10)"],keys:_col0, _col1, _col2, _col3, 0
+                      Select Operator [SEL_40] (rows=421645953 width=135)
+                        Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10"]
+                        Merge Join Operator [MERGEJOIN_83] (rows=421645953 width=135)
+                          Conds:RS_37._col0=RS_38._col3(Inner),Output:["_col4","_col6","_col7","_col8","_col11","_col16","_col17","_col18","_col19","_col20","_col26"]
+                        <-Reducer 12 [SIMPLE_EDGE]
+                          SHUFFLE [RS_38]
+                            PartitionCols:_col3
+                            Select Operator [SEL_30] (rows=383314495 width=135)
+                              Output:["_col1","_col3","_col6","_col7","_col8","_col9","_col10","_col16"]
+                              Merge Join Operator [MERGEJOIN_82] (rows=383314495 width=135)
+                                Conds:RS_27._col3=RS_28._col0(Inner),Output:["_col1","_col4","_col5","_col6","_col7","_col8","_col14","_col16"]
+                              <-Map 15 [SIMPLE_EDGE]
+                                SHUFFLE [RS_28]
+                                  PartitionCols:_col0
+                                  Select Operator [SEL_20] (rows=462000 width=1436)
+                                    Output:["_col0","_col1"]
+                                    Filter Operator [FIL_77] (rows=462000 width=1436)
+                                      predicate:i_item_sk is not null
+                                      TableScan [TS_18] (rows=462000 width=1436)
+                                        default@item,item,Tbl:COMPLETE,Col:NONE,Output:["i_item_sk","i_item_id"]
+                              <-Reducer 11 [SIMPLE_EDGE]
+                                SHUFFLE [RS_27]
+                                  PartitionCols:_col3
+                                  Merge Join Operator [MERGEJOIN_81] (rows=348467716 width=135)
+                                    Conds:RS_24._col2=RS_25._col0(Inner),Output:["_col1","_col3","_col4","_col5","_col6","_col7","_col8","_col14"]
+                                  <-Map 14 [SIMPLE_EDGE]
+                                    SHUFFLE [RS_25]
+                                      PartitionCols:_col0
+                                      Select Operator [SEL_17] (rows=465450 width=385)
+                                        Output:["_col0","_col3"]
+                                        Filter Operator [FIL_76] (rows=465450 width=385)
+                                          predicate:((cd_education_status = 'College') and (cd_gender = 'M') and cd_demo_sk is not null)
+                                          TableScan [TS_15] (rows=1861800 width=385)
+                                            default@customer_demographics,cd1,Tbl:COMPLETE,Col:NONE,Output:["cd_demo_sk","cd_gender","cd_education_status","cd_dep_count"]
+                                  <-Reducer 10 [SIMPLE_EDGE]
+                                    SHUFFLE [RS_24]
+                                      PartitionCols:_col2
+                                      Merge Join Operator [MERGEJOIN_80] (rows=316788826 width=135)
+                                        Conds:RS_21._col0=RS_22._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8"]
+                                      <-Map 13 [SIMPLE_EDGE]
+                                        SHUFFLE [RS_22]
+                                          PartitionCols:_col0
+                                          Select Operator [SEL_14] (rows=36524 width=1119)
+                                            Output:["_col0"]
+                                            Filter Operator [FIL_75] (rows=36524 width=1119)
+                                              predicate:((d_year = 2001) and d_date_sk is not null)
+                                              TableScan [TS_12] (rows=73049 width=1119)
+                                                default@date_dim,date_dim,Tbl:COMPLETE,Col:NONE,Output:["d_date_sk","d_year"]
+                                      <-Map 9 [SIMPLE_EDGE]
+                                        SHUFFLE [RS_21]
+                                          PartitionCols:_col0
+                                          Select Operator [SEL_11] (rows=287989836 width=135)
+                                            Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8"]
+                                            Filter Operator [FIL_74] (rows=287989836 width=135)
+                                              predicate:(cs_bill_cdemo_sk is not null and cs_bill_customer_sk is not null and cs_item_sk is not null and cs_sold_date_sk is not null)
+                                              TableScan [TS_9] (rows=287989836 width=135)
+                                                default@catalog_sales,catalog_sales,Tbl:COMPLETE,Col:NONE,Output:["cs_sold_date_sk","cs_bill_customer_sk","cs_bill_cdemo_sk","cs_item_sk","cs_quantity","cs_list_price","cs_sales_price","cs_coupon_amt","cs_net_profit"]
+                        <-Reducer 3 [SIMPLE_EDGE]
+                          SHUFFLE [RS_37]
+                            PartitionCols:_col0
+                            Merge Join Operator [MERGEJOIN_79] (rows=48400001 width=860)
+                              Conds:RS_34._col1=RS_35._col0(Inner),Output:["_col0","_col4","_col6","_col7","_col8"]
+                            <-Map 8 [SIMPLE_EDGE]
+                              SHUFFLE [RS_35]
+                                PartitionCols:_col0
+                                Select Operator [SEL_8] (rows=1861800 width=385)
+                                  Output:["_col0"]
+                                  Filter Operator [FIL_73] (rows=1861800 width=385)
+                                    predicate:cd_demo_sk is not null
+                                    TableScan [TS_6] (rows=1861800 width=385)
+                                      default@customer_demographics,cd2,Tbl:COMPLETE,Col:NONE,Output:["cd_demo_sk"]
+                            <-Reducer 2 [SIMPLE_EDGE]
+                              SHUFFLE [RS_34]
+                                PartitionCols:_col1
+                                Merge Join Operator [MERGEJOIN_78] (rows=44000000 width=860)
+                                  Conds:RS_31._col2=RS_32._col0(Inner),Output:["_col0","_col1","_col4","_col6","_col7","_col8"]
+                                <-Map 1 [SIMPLE_EDGE]
+                                  SHUFFLE [RS_31]
+                                    PartitionCols:_col2
+                                    Select Operator [SEL_2] (rows=40000000 width=860)
+                                      Output:["_col0","_col1","_col2","_col4"]
+                                      Filter Operator [FIL_71] (rows=40000000 width=860)
+                                        predicate:((c_birth_month) IN (9, 5, 12, 4, 1, 10) and c_current_addr_sk is not null and c_current_cdemo_sk is not null and c_customer_sk is not null)
+                                        TableScan [TS_0] (rows=80000000 width=860)
+                                          default@customer,customer,Tbl:COMPLETE,Col:NONE,Output:["c_customer_sk","c_current_cdemo_sk","c_current_addr_sk","c_birth_month","c_birth_year"]
+                                <-Map 7 [SIMPLE_EDGE]
+                                  SHUFFLE [RS_32]
+                                    PartitionCols:_col0
+                                    Select Operator [SEL_5] (rows=20000000 width=1014)
+                                      Output:["_col0","_col1","_col2","_col3"]
+                                      Filter Operator [FIL_72] (rows=20000000 width=1014)
+                                        predicate:((ca_state) IN ('ND', 'WI', 'AL', 'NC', 'OK', 'MS', 'TN') and ca_address_sk is not null)
+                                        TableScan [TS_3] (rows=40000000 width=1014)
+                                          default@customer_address,customer_address,Tbl:COMPLETE,Col:NONE,Output:["ca_address_sk","ca_county","ca_state","ca_country"]
+

http://git-wip-us.apache.org/repos/asf/hive/blob/9244fdc7/ql/src/test/results/clientpositive/perf/tez/query19.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/query19.q.out b/ql/src/test/results/clientpositive/perf/tez/query19.q.out
new file mode 100644
index 0000000..363425f
--- /dev/null
+++ b/ql/src/test/results/clientpositive/perf/tez/query19.q.out
@@ -0,0 +1,161 @@
+PREHOOK: query: explain
+select  i_brand_id brand_id, i_brand brand, i_manufact_id, i_manufact,
+ 	sum(ss_ext_sales_price) ext_price
+ from date_dim, store_sales, item,customer,customer_address,store
+ where d_date_sk = ss_sold_date_sk
+   and ss_item_sk = i_item_sk
+   and i_manager_id=7
+   and d_moy=11
+   and d_year=1999
+   and ss_customer_sk = c_customer_sk 
+   and c_current_addr_sk = ca_address_sk
+   and substr(ca_zip,1,5) <> substr(s_zip,1,5) 
+   and ss_store_sk = s_store_sk 
+ group by i_brand
+      ,i_brand_id
+      ,i_manufact_id
+      ,i_manufact
+ order by ext_price desc
+         ,i_brand
+         ,i_brand_id
+         ,i_manufact_id
+         ,i_manufact
+limit 100
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select  i_brand_id brand_id, i_brand brand, i_manufact_id, i_manufact,
+ 	sum(ss_ext_sales_price) ext_price
+ from date_dim, store_sales, item,customer,customer_address,store
+ where d_date_sk = ss_sold_date_sk
+   and ss_item_sk = i_item_sk
+   and i_manager_id=7
+   and d_moy=11
+   and d_year=1999
+   and ss_customer_sk = c_customer_sk 
+   and c_current_addr_sk = ca_address_sk
+   and substr(ca_zip,1,5) <> substr(s_zip,1,5) 
+   and ss_store_sk = s_store_sk 
+ group by i_brand
+      ,i_brand_id
+      ,i_manufact_id
+      ,i_manufact
+ order by ext_price desc
+         ,i_brand
+         ,i_brand_id
+         ,i_manufact_id
+         ,i_manufact
+limit 100
+POSTHOOK: type: QUERY
+Plan optimized by CBO.
+
+Vertex dependency in root stage
+Reducer 10 <- Map 12 (SIMPLE_EDGE), Reducer 9 (SIMPLE_EDGE)
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 7 (SIMPLE_EDGE)
+Reducer 3 <- Reducer 10 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
+Reducer 4 <- Map 13 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
+Reducer 5 <- Reducer 4 (SIMPLE_EDGE)
+Reducer 6 <- Reducer 5 (SIMPLE_EDGE)
+Reducer 9 <- Map 11 (SIMPLE_EDGE), Map 8 (SIMPLE_EDGE)
+
+Stage-0
+  Fetch Operator
+    limit:100
+    Stage-1
+      Reducer 6
+      File Output Operator [FS_44]
+        Limit [LIM_43] (rows=100 width=88)
+          Number of rows:100
+          Select Operator [SEL_42] (rows=421657640 width=88)
+            Output:["_col0","_col1","_col2","_col3","_col4"]
+          <-Reducer 5 [SIMPLE_EDGE]
+            SHUFFLE [RS_41]
+              Select Operator [SEL_39] (rows=421657640 width=88)
+                Output:["_col0","_col1","_col2","_col3","_col4"]
+                Group By Operator [GBY_38] (rows=421657640 width=88)
+                  Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3
+                <-Reducer 4 [SIMPLE_EDGE]
+                  SHUFFLE [RS_37]
+                    PartitionCols:_col0, _col1, _col2, _col3
+                    Group By Operator [GBY_36] (rows=843315281 width=88)
+                      Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(_col8)"],keys:_col14, _col13, _col15, _col16
+                      Select Operator [SEL_35] (rows=843315281 width=88)
+                        Output:["_col8","_col13","_col14","_col15","_col16"]
+                        Filter Operator [FIL_34] (rows=843315281 width=88)
+                          predicate:(substr(_col3, 1, 5) <> substr(_col19, 1, 5))
+                          Merge Join Operator [MERGEJOIN_73] (rows=843315281 width=88)
+                            Conds:RS_31._col7=RS_32._col0(Inner),Output:["_col3","_col8","_col13","_col14","_col15","_col16","_col19"]
+                          <-Map 13 [SIMPLE_EDGE]
+                            SHUFFLE [RS_32]
+                              PartitionCols:_col0
+                              Select Operator [SEL_24] (rows=1704 width=1910)
+                                Output:["_col0","_col1"]
+                                Filter Operator [FIL_68] (rows=1704 width=1910)
+                                  predicate:s_store_sk is not null
+                                  TableScan [TS_22] (rows=1704 width=1910)
+                                    default@store,store,Tbl:COMPLETE,Col:NONE,Output:["s_store_sk","s_zip"]
+                          <-Reducer 3 [SIMPLE_EDGE]
+                            SHUFFLE [RS_31]
+                              PartitionCols:_col7
+                              Merge Join Operator [MERGEJOIN_72] (rows=766650239 width=88)
+                                Conds:RS_28._col0=RS_29._col2(Inner),Output:["_col3","_col7","_col8","_col13","_col14","_col15","_col16"]
+                              <-Reducer 10 [SIMPLE_EDGE]
+                                SHUFFLE [RS_29]
+                                  PartitionCols:_col2
+                                  Merge Join Operator [MERGEJOIN_71] (rows=696954748 width=88)
+                                    Conds:RS_18._col1=RS_19._col0(Inner),Output:["_col2","_col3","_col4","_col9","_col10","_col11","_col12"]
+                                  <-Map 12 [SIMPLE_EDGE]
+                                    SHUFFLE [RS_19]
+                                      PartitionCols:_col0
+                                      Select Operator [SEL_14] (rows=231000 width=1436)
+                                        Output:["_col0","_col1","_col2","_col3","_col4"]
+                                        Filter Operator [FIL_67] (rows=231000 width=1436)
+                                          predicate:((i_manager_id = 7) and i_item_sk is not null)
+                                          TableScan [TS_12] (rows=462000 width=1436)
+                                            default@item,item,Tbl:COMPLETE,Col:NONE,Output:["i_item_sk","i_brand_id","i_brand","i_manufact_id","i_manufact","i_manager_id"]
+                                  <-Reducer 9 [SIMPLE_EDGE]
+                                    SHUFFLE [RS_18]
+                                      PartitionCols:_col1
+                                      Merge Join Operator [MERGEJOIN_70] (rows=633595212 width=88)
+                                        Conds:RS_15._col0=RS_16._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
+                                      <-Map 11 [SIMPLE_EDGE]
+                                        SHUFFLE [RS_16]
+                                          PartitionCols:_col0
+                                          Select Operator [SEL_11] (rows=18262 width=1119)
+                                            Output:["_col0"]
+                                            Filter Operator [FIL_66] (rows=18262 width=1119)
+                                              predicate:((d_moy = 11) and (d_year = 1999) and d_date_sk is not null)
+                                              TableScan [TS_9] (rows=73049 width=1119)
+                                                default@date_dim,date_dim,Tbl:COMPLETE,Col:NONE,Output:["d_date_sk","d_year","d_moy"]
+                                      <-Map 8 [SIMPLE_EDGE]
+                                        SHUFFLE [RS_15]
+                                          PartitionCols:_col0
+                                          Select Operator [SEL_8] (rows=575995635 width=88)
+                                            Output:["_col0","_col1","_col2","_col3","_col4"]
+                                            Filter Operator [FIL_65] (rows=575995635 width=88)
+                                              predicate:(ss_customer_sk is not null and ss_item_sk is not null and ss_sold_date_sk is not null and ss_store_sk is not null)
+                                              TableScan [TS_6] (rows=575995635 width=88)
+                                                default@store_sales,store_sales,Tbl:COMPLETE,Col:NONE,Output:["ss_sold_date_sk","ss_item_sk","ss_customer_sk","ss_store_sk","ss_ext_sales_price"]
+                              <-Reducer 2 [SIMPLE_EDGE]
+                                SHUFFLE [RS_28]
+                                  PartitionCols:_col0
+                                  Merge Join Operator [MERGEJOIN_69] (rows=88000001 width=860)
+                                    Conds:RS_25._col1=RS_26._col0(Inner),Output:["_col0","_col3"]
+                                  <-Map 1 [SIMPLE_EDGE]
+                                    SHUFFLE [RS_25]
+                                      PartitionCols:_col1
+                                      Select Operator [SEL_2] (rows=80000000 width=860)
+                                        Output:["_col0","_col1"]
+                                        Filter Operator [FIL_63] (rows=80000000 width=860)
+                                          predicate:(c_current_addr_sk is not null and c_customer_sk is not null)
+                                          TableScan [TS_0] (rows=80000000 width=860)
+                                            default@customer,customer,Tbl:COMPLETE,Col:NONE,Output:["c_customer_sk","c_current_addr_sk"]
+                                  <-Map 7 [SIMPLE_EDGE]
+                                    SHUFFLE [RS_26]
+                                      PartitionCols:_col0
+                                      Select Operator [SEL_5] (rows=40000000 width=1014)
+                                        Output:["_col0","_col1"]
+                                        Filter Operator [FIL_64] (rows=40000000 width=1014)
+                                          predicate:ca_address_sk is not null
+                                          TableScan [TS_3] (rows=40000000 width=1014)
+                                            default@customer_address,customer_address,Tbl:COMPLETE,Col:NONE,Output:["ca_address_sk","ca_zip"]
+

http://git-wip-us.apache.org/repos/asf/hive/blob/9244fdc7/ql/src/test/results/clientpositive/perf/tez/query2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/query2.q.out b/ql/src/test/results/clientpositive/perf/tez/query2.q.out
new file mode 100644
index 0000000..0ba703a
--- /dev/null
+++ b/ql/src/test/results/clientpositive/perf/tez/query2.q.out
@@ -0,0 +1,255 @@
+PREHOOK: query: explain
+with wscs as
+ (select sold_date_sk
+        ,sales_price
+  from (select ws_sold_date_sk sold_date_sk
+              ,ws_ext_sales_price sales_price
+        from web_sales) x
+        union all
+       (select cs_sold_date_sk sold_date_sk
+              ,cs_ext_sales_price sales_price
+        from catalog_sales)),
+ wswscs as 
+ (select d_week_seq,
+        sum(case when (d_day_name='Sunday') then sales_price else null end) sun_sales,
+        sum(case when (d_day_name='Monday') then sales_price else null end) mon_sales,
+        sum(case when (d_day_name='Tuesday') then sales_price else  null end) tue_sales,
+        sum(case when (d_day_name='Wednesday') then sales_price else null end) wed_sales,
+        sum(case when (d_day_name='Thursday') then sales_price else null end) thu_sales,
+        sum(case when (d_day_name='Friday') then sales_price else null end) fri_sales,
+        sum(case when (d_day_name='Saturday') then sales_price else null end) sat_sales
+ from wscs
+     ,date_dim
+ where d_date_sk = sold_date_sk
+ group by d_week_seq)
+ select d_week_seq1
+       ,round(sun_sales1/sun_sales2,2)
+       ,round(mon_sales1/mon_sales2,2)
+       ,round(tue_sales1/tue_sales2,2)
+       ,round(wed_sales1/wed_sales2,2)
+       ,round(thu_sales1/thu_sales2,2)
+       ,round(fri_sales1/fri_sales2,2)
+       ,round(sat_sales1/sat_sales2,2)
+ from
+ (select wswscs.d_week_seq d_week_seq1
+        ,sun_sales sun_sales1
+        ,mon_sales mon_sales1
+        ,tue_sales tue_sales1
+        ,wed_sales wed_sales1
+        ,thu_sales thu_sales1
+        ,fri_sales fri_sales1
+        ,sat_sales sat_sales1
+  from wswscs,date_dim 
+  where date_dim.d_week_seq = wswscs.d_week_seq and
+        d_year = 2001) y,
+ (select wswscs.d_week_seq d_week_seq2
+        ,sun_sales sun_sales2
+        ,mon_sales mon_sales2
+        ,tue_sales tue_sales2
+        ,wed_sales wed_sales2
+        ,thu_sales thu_sales2
+        ,fri_sales fri_sales2
+        ,sat_sales sat_sales2
+  from wswscs
+      ,date_dim 
+  where date_dim.d_week_seq = wswscs.d_week_seq and
+        d_year = 2001+1) z
+ where d_week_seq1=d_week_seq2-53
+ order by d_week_seq1
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+with wscs as
+ (select sold_date_sk
+        ,sales_price
+  from (select ws_sold_date_sk sold_date_sk
+              ,ws_ext_sales_price sales_price
+        from web_sales) x
+        union all
+       (select cs_sold_date_sk sold_date_sk
+              ,cs_ext_sales_price sales_price
+        from catalog_sales)),
+ wswscs as 
+ (select d_week_seq,
+        sum(case when (d_day_name='Sunday') then sales_price else null end) sun_sales,
+        sum(case when (d_day_name='Monday') then sales_price else null end) mon_sales,
+        sum(case when (d_day_name='Tuesday') then sales_price else  null end) tue_sales,
+        sum(case when (d_day_name='Wednesday') then sales_price else null end) wed_sales,
+        sum(case when (d_day_name='Thursday') then sales_price else null end) thu_sales,
+        sum(case when (d_day_name='Friday') then sales_price else null end) fri_sales,
+        sum(case when (d_day_name='Saturday') then sales_price else null end) sat_sales
+ from wscs
+     ,date_dim
+ where d_date_sk = sold_date_sk
+ group by d_week_seq)
+ select d_week_seq1
+       ,round(sun_sales1/sun_sales2,2)
+       ,round(mon_sales1/mon_sales2,2)
+       ,round(tue_sales1/tue_sales2,2)
+       ,round(wed_sales1/wed_sales2,2)
+       ,round(thu_sales1/thu_sales2,2)
+       ,round(fri_sales1/fri_sales2,2)
+       ,round(sat_sales1/sat_sales2,2)
+ from
+ (select wswscs.d_week_seq d_week_seq1
+        ,sun_sales sun_sales1
+        ,mon_sales mon_sales1
+        ,tue_sales tue_sales1
+        ,wed_sales wed_sales1
+        ,thu_sales thu_sales1
+        ,fri_sales fri_sales1
+        ,sat_sales sat_sales1
+  from wswscs,date_dim 
+  where date_dim.d_week_seq = wswscs.d_week_seq and
+        d_year = 2001) y,
+ (select wswscs.d_week_seq d_week_seq2
+        ,sun_sales sun_sales2
+        ,mon_sales mon_sales2
+        ,tue_sales tue_sales2
+        ,wed_sales wed_sales2
+        ,thu_sales thu_sales2
+        ,fri_sales fri_sales2
+        ,sat_sales sat_sales2
+  from wswscs
+      ,date_dim 
+  where date_dim.d_week_seq = wswscs.d_week_seq and
+        d_year = 2001+1) z
+ where d_week_seq1=d_week_seq2-53
+ order by d_week_seq1
+POSTHOOK: type: QUERY
+Plan optimized by CBO.
+
+Vertex dependency in root stage
+Map 1 <- Union 2 (CONTAINS)
+Map 14 <- Union 15 (CONTAINS)
+Map 16 <- Union 15 (CONTAINS)
+Map 8 <- Union 2 (CONTAINS)
+Reducer 10 <- Map 9 (SIMPLE_EDGE), Union 15 (SIMPLE_EDGE)
+Reducer 11 <- Reducer 10 (SIMPLE_EDGE)
+Reducer 12 <- Map 13 (SIMPLE_EDGE), Reducer 11 (ONE_TO_ONE_EDGE)
+Reducer 3 <- Map 9 (SIMPLE_EDGE), Union 2 (SIMPLE_EDGE)
+Reducer 4 <- Reducer 3 (SIMPLE_EDGE)
+Reducer 5 <- Map 13 (SIMPLE_EDGE), Reducer 4 (ONE_TO_ONE_EDGE)
+Reducer 6 <- Reducer 12 (SIMPLE_EDGE), Reducer 5 (SIMPLE_EDGE)
+Reducer 7 <- Reducer 6 (SIMPLE_EDGE)
+
+Stage-0
+  Fetch Operator
+    limit:-1
+    Stage-1
+      Reducer 7
+      File Output Operator [FS_60]
+        Select Operator [SEL_59] (rows=287491028 width=135)
+          Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
+        <-Reducer 6 [SIMPLE_EDGE]
+          SHUFFLE [RS_58]
+            Select Operator [SEL_57] (rows=287491028 width=135)
+              Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
+              Merge Join Operator [MERGEJOIN_95] (rows=287491028 width=135)
+                Conds:RS_54._col0=RS_55.(_col0 - 53)(Inner),Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col9","_col10","_col11","_col12","_col13","_col14","_col15"]
+              <-Reducer 12 [SIMPLE_EDGE]
+                SHUFFLE [RS_55]
+                  PartitionCols:(_col0 - 53)
+                  Merge Join Operator [MERGEJOIN_94] (rows=261355475 width=135)
+                    Conds:RS_50._col0=RS_51._col0(Inner),Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
+                  <-Map 13 [SIMPLE_EDGE]
+                    SHUFFLE [RS_51]
+                      PartitionCols:_col0
+                      Select Operator [SEL_49] (rows=36524 width=1119)
+                        Output:["_col0"]
+                        Filter Operator [FIL_90] (rows=36524 width=1119)
+                          predicate:((d_year = 2002) and d_week_seq is not null)
+                          TableScan [TS_20] (rows=73049 width=1119)
+                            default@date_dim,date_dim,Tbl:COMPLETE,Col:NONE,Output:["d_week_seq","d_year"]
+                  <-Reducer 11 [ONE_TO_ONE_EDGE]
+                    FORWARD [RS_50]
+                      PartitionCols:_col0
+                      Group By Operator [GBY_45] (rows=237595882 width=135)
+                        Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],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
+                      <-Reducer 10 [SIMPLE_EDGE]
+                        SHUFFLE [RS_44]
+                          PartitionCols:_col0
+                          Group By Operator [GBY_43] (rows=475191764 width=135)
+                            Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(_col1)","sum(_col2)","sum(_col3)","sum(_col4)","sum(_col5)","sum(_col6)","sum(_col7)"],keys:_col0
+                            Select Operator [SEL_41] (rows=475191764 width=135)
+                              Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
+                              Merge Join Operator [MERGEJOIN_93] (rows=475191764 width=135)
+                                Conds:Union 15._col0=RS_39._col0(Inner),Output:["_col1","_col3","_col4"]
+                              <-Map 9 [SIMPLE_EDGE]
+                                SHUFFLE [RS_39]
+                                  PartitionCols:_col0
+                                  Select Operator [SEL_10] (rows=73049 width=1119)
+                                    Output:["_col0","_col1","_col2"]
+                                    Filter Operator [FIL_85] (rows=73049 width=1119)
+                                      predicate:(d_date_sk is not null and d_week_seq is not null)
+                                      TableScan [TS_8] (rows=73049 width=1119)
+                                        default@date_dim,date_dim,Tbl:COMPLETE,Col:NONE,Output:["d_date_sk","d_week_seq","d_day_name"]
+                              <-Union 15 [SIMPLE_EDGE]
+                                <-Map 14 [CONTAINS]
+                                  Reduce Output Operator [RS_38]
+                                    PartitionCols:_col0
+                                    Select Operator [SEL_29] (rows=144002668 width=135)
+                                      Output:["_col0","_col1"]
+                                      Filter Operator [FIL_87] (rows=144002668 width=135)
+                                        predicate:ws_sold_date_sk is not null
+                                        TableScan [TS_27] (rows=144002668 width=135)
+                                          Output:["ws_sold_date_sk","ws_ext_sales_price"]
+                                <-Map 16 [CONTAINS]
+                                  Reduce Output Operator [RS_38]
+                                    PartitionCols:_col0
+                                    Select Operator [SEL_32] (rows=287989836 width=135)
+                                      Output:["_col0","_col1"]
+                                      Filter Operator [FIL_88] (rows=287989836 width=135)
+                                        predicate:cs_sold_date_sk is not null
+                                        TableScan [TS_30] (rows=287989836 width=135)
+                                          Output:["cs_sold_date_sk","cs_ext_sales_price"]
+              <-Reducer 5 [SIMPLE_EDGE]
+                SHUFFLE [RS_54]
+                  PartitionCols:_col0
+                  Merge Join Operator [MERGEJOIN_92] (rows=261355475 width=135)
+                    Conds:RS_23._col0=RS_24._col0(Inner),Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
+                  <-Map 13 [SIMPLE_EDGE]
+                    SHUFFLE [RS_24]
+                      PartitionCols:_col0
+                      Select Operator [SEL_22] (rows=36524 width=1119)
+                        Output:["_col0"]
+                        Filter Operator [FIL_86] (rows=36524 width=1119)
+                          predicate:((d_year = 2001) and d_week_seq is not null)
+                           Please refer to the previous TableScan [TS_20]
+                  <-Reducer 4 [ONE_TO_ONE_EDGE]
+                    FORWARD [RS_23]
+                      PartitionCols:_col0
+                      Group By Operator [GBY_18] (rows=237595882 width=135)
+                        Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],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
+                      <-Reducer 3 [SIMPLE_EDGE]
+                        SHUFFLE [RS_17]
+                          PartitionCols:_col0
+                          Group By Operator [GBY_16] (rows=475191764 width=135)
+                            Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(_col1)","sum(_col2)","sum(_col3)","sum(_col4)","sum(_col5)","sum(_col6)","sum(_col7)"],keys:_col0
+                            Select Operator [SEL_14] (rows=475191764 width=135)
+                              Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
+                              Merge Join Operator [MERGEJOIN_91] (rows=475191764 width=135)
+                                Conds:Union 2._col0=RS_12._col0(Inner),Output:["_col1","_col3","_col4"]
+                              <-Map 9 [SIMPLE_EDGE]
+                                SHUFFLE [RS_12]
+                                  PartitionCols:_col0
+                                   Please refer to the previous Select Operator [SEL_10]
+                              <-Union 2 [SIMPLE_EDGE]
+                                <-Map 1 [CONTAINS]
+                                  Reduce Output Operator [RS_11]
+                                    PartitionCols:_col0
+                                    Select Operator [SEL_2] (rows=144002668 width=135)
+                                      Output:["_col0","_col1"]
+                                      Filter Operator [FIL_83] (rows=144002668 width=135)
+                                        predicate:ws_sold_date_sk is not null
+                                        TableScan [TS_0] (rows=144002668 width=135)
+                                          Output:["ws_sold_date_sk","ws_ext_sales_price"]
+                                <-Map 8 [CONTAINS]
+                                  Reduce Output Operator [RS_11]
+                                    PartitionCols:_col0
+                                    Select Operator [SEL_5] (rows=287989836 width=135)
+                                      Output:["_col0","_col1"]
+                                      Filter Operator [FIL_84] (rows=287989836 width=135)
+                                        predicate:cs_sold_date_sk is not null
+                                        TableScan [TS_3] (rows=287989836 width=135)
+                                          Output:["cs_sold_date_sk","cs_ext_sales_price"]
+

http://git-wip-us.apache.org/repos/asf/hive/blob/9244fdc7/ql/src/test/results/clientpositive/perf/tez/query20.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/query20.q.out b/ql/src/test/results/clientpositive/perf/tez/query20.q.out
new file mode 100644
index 0000000..c07141b
--- /dev/null
+++ b/ql/src/test/results/clientpositive/perf/tez/query20.q.out
@@ -0,0 +1,130 @@
+PREHOOK: query: explain
+select  i_item_desc 
+       ,i_category 
+       ,i_class 
+       ,i_current_price
+       ,sum(cs_ext_sales_price) as itemrevenue 
+       ,sum(cs_ext_sales_price)*100/sum(sum(cs_ext_sales_price)) over
+           (partition by i_class) as revenueratio
+ from	catalog_sales
+     ,item 
+     ,date_dim
+ where cs_item_sk = i_item_sk 
+   and i_category in ('Jewelry', 'Sports', 'Books')
+   and cs_sold_date_sk = d_date_sk
+ and d_date between cast('2001-01-12' as date) 
+ 				and (cast('2001-01-12' as date) + 30 days)
+ group by i_item_id
+         ,i_item_desc 
+         ,i_category
+         ,i_class
+         ,i_current_price
+ order by i_category
+         ,i_class
+         ,i_item_id
+         ,i_item_desc
+         ,revenueratio
+limit 100
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select  i_item_desc 
+       ,i_category 
+       ,i_class 
+       ,i_current_price
+       ,sum(cs_ext_sales_price) as itemrevenue 
+       ,sum(cs_ext_sales_price)*100/sum(sum(cs_ext_sales_price)) over
+           (partition by i_class) as revenueratio
+ from	catalog_sales
+     ,item 
+     ,date_dim
+ where cs_item_sk = i_item_sk 
+   and i_category in ('Jewelry', 'Sports', 'Books')
+   and cs_sold_date_sk = d_date_sk
+ and d_date between cast('2001-01-12' as date) 
+ 				and (cast('2001-01-12' as date) + 30 days)
+ group by i_item_id
+         ,i_item_desc 
+         ,i_category
+         ,i_class
+         ,i_current_price
+ order by i_category
+         ,i_class
+         ,i_item_id
+         ,i_item_desc
+         ,revenueratio
+limit 100
+POSTHOOK: type: QUERY
+Plan optimized by CBO.
+
+Vertex dependency in root stage
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 7 (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 6 <- Reducer 5 (SIMPLE_EDGE)
+
+Stage-0
+  Fetch Operator
+    limit:-1
+    Stage-1
+      Reducer 6
+      File Output Operator [FS_29]
+        Limit [LIM_27] (rows=100 width=135)
+          Number of rows:100
+          Select Operator [SEL_26] (rows=174233858 width=135)
+            Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
+          <-Reducer 5 [SIMPLE_EDGE]
+            SHUFFLE [RS_25]
+              Select Operator [SEL_23] (rows=174233858 width=135)
+                Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
+                PTF Operator [PTF_22] (rows=174233858 width=135)
+                  Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col3 ASC NULLS FIRST","partition by:":"_col3"}]
+                  Select Operator [SEL_21] (rows=174233858 width=135)
+                    Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
+                  <-Reducer 4 [SIMPLE_EDGE]
+                    SHUFFLE [RS_20]
+                      PartitionCols:_col3
+                      Select Operator [SEL_19] (rows=174233858 width=135)
+                        Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
+                        Group By Operator [GBY_18] (rows=174233858 width=135)
+                          Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4
+                        <-Reducer 3 [SIMPLE_EDGE]
+                          SHUFFLE [RS_17]
+                            PartitionCols:_col0, _col1, _col2, _col3, _col4
+                            Group By Operator [GBY_16] (rows=348467716 width=135)
+                              Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(_col2)"],keys:_col10, _col9, _col6, _col7, _col8
+                              Merge Join Operator [MERGEJOIN_39] (rows=348467716 width=135)
+                                Conds:RS_12._col1=RS_13._col0(Inner),Output:["_col2","_col6","_col7","_col8","_col9","_col10"]
+                              <-Map 8 [SIMPLE_EDGE]
+                                SHUFFLE [RS_13]
+                                  PartitionCols:_col0
+                                  Select Operator [SEL_8] (rows=231000 width=1436)
+                                    Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
+                                    Filter Operator [FIL_37] (rows=231000 width=1436)
+                                      predicate:((i_category) IN ('Jewelry', 'Sports', 'Books') and i_item_sk is not null)
+                                      TableScan [TS_6] (rows=462000 width=1436)
+                                        default@item,item,Tbl:COMPLETE,Col:NONE,Output:["i_item_sk","i_item_id","i_item_desc","i_current_price","i_class","i_category"]
+                              <-Reducer 2 [SIMPLE_EDGE]
+                                SHUFFLE [RS_12]
+                                  PartitionCols:_col1
+                                  Merge Join Operator [MERGEJOIN_38] (rows=316788826 width=135)
+                                    Conds:RS_9._col0=RS_10._col0(Inner),Output:["_col1","_col2"]
+                                  <-Map 1 [SIMPLE_EDGE]
+                                    SHUFFLE [RS_9]
+                                      PartitionCols:_col0
+                                      Select Operator [SEL_2] (rows=287989836 width=135)
+                                        Output:["_col0","_col1","_col2"]
+                                        Filter Operator [FIL_35] (rows=287989836 width=135)
+                                          predicate:(cs_item_sk is not null and cs_sold_date_sk is not null)
+                                          TableScan [TS_0] (rows=287989836 width=135)
+                                            default@catalog_sales,catalog_sales,Tbl:COMPLETE,Col:NONE,Output:["cs_sold_date_sk","cs_item_sk","cs_ext_sales_price"]
+                                  <-Map 7 [SIMPLE_EDGE]
+                                    SHUFFLE [RS_10]
+                                      PartitionCols:_col0
+                                      Select Operator [SEL_5] (rows=8116 width=1119)
+                                        Output:["_col0"]
+                                        Filter Operator [FIL_36] (rows=8116 width=1119)
+                                          predicate:(CAST( d_date AS TIMESTAMP) BETWEEN 2001-01-12 00:00:00.0 AND 2001-02-11 00:00:00.0 and d_date_sk is not null)
+                                          TableScan [TS_3] (rows=73049 width=1119)
+                                            default@date_dim,date_dim,Tbl:COMPLETE,Col:NONE,Output:["d_date_sk","d_date"]
+

http://git-wip-us.apache.org/repos/asf/hive/blob/9244fdc7/ql/src/test/results/clientpositive/perf/tez/query21.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/query21.q.out b/ql/src/test/results/clientpositive/perf/tez/query21.q.out
new file mode 100644
index 0000000..876e3c8
--- /dev/null
+++ b/ql/src/test/results/clientpositive/perf/tez/query21.q.out
@@ -0,0 +1,139 @@
+PREHOOK: query: explain
+select  *
+ from(select w_warehouse_name
+            ,i_item_id
+            ,sum(case when (cast(d_date as date) < cast ('1998-04-08' as date))
+	                then inv_quantity_on_hand 
+                      else 0 end) as inv_before
+            ,sum(case when (cast(d_date as date) >= cast ('1998-04-08' as date))
+                      then inv_quantity_on_hand 
+                      else 0 end) as inv_after
+   from inventory
+       ,warehouse
+       ,item
+       ,date_dim
+   where i_current_price between 0.99 and 1.49
+     and i_item_sk          = inv_item_sk
+     and inv_warehouse_sk   = w_warehouse_sk
+     and inv_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_warehouse_name, i_item_id) x
+ where (case when inv_before > 0 
+             then inv_after / inv_before 
+             else null
+             end) between 2.0/3.0 and 3.0/2.0
+ order by w_warehouse_name
+         ,i_item_id
+ limit 100
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select  *
+ from(select w_warehouse_name
+            ,i_item_id
+            ,sum(case when (cast(d_date as date) < cast ('1998-04-08' as date))
+	                then inv_quantity_on_hand 
+                      else 0 end) as inv_before
+            ,sum(case when (cast(d_date as date) >= cast ('1998-04-08' as date))
+                      then inv_quantity_on_hand 
+                      else 0 end) as inv_after
+   from inventory
+       ,warehouse
+       ,item
+       ,date_dim
+   where i_current_price between 0.99 and 1.49
+     and i_item_sk          = inv_item_sk
+     and inv_warehouse_sk   = w_warehouse_sk
+     and inv_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_warehouse_name, i_item_id) x
+ where (case when inv_before > 0 
+             then inv_after / inv_before 
+             else null
+             end) between 2.0/3.0 and 3.0/2.0
+ order by w_warehouse_name
+         ,i_item_id
+ limit 100
+POSTHOOK: type: QUERY
+Plan optimized by CBO.
+
+Vertex dependency in root stage
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 7 (SIMPLE_EDGE)
+Reducer 3 <- Map 8 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
+Reducer 4 <- Map 9 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
+Reducer 5 <- Reducer 4 (SIMPLE_EDGE)
+Reducer 6 <- Reducer 5 (SIMPLE_EDGE)
+
+Stage-0
+  Fetch Operator
+    limit:100
+    Stage-1
+      Reducer 6
+      File Output Operator [FS_31]
+        Limit [LIM_30] (rows=100 width=15)
+          Number of rows:100
+          Select Operator [SEL_29] (rows=12506076 width=15)
+            Output:["_col0","_col1","_col2","_col3"]
+          <-Reducer 5 [SIMPLE_EDGE]
+            SHUFFLE [RS_28]
+              Filter Operator [FIL_26] (rows=12506076 width=15)
+                predicate:CASE WHEN ((_col2 > 0)) THEN ((UDFToDouble(_col3) / UDFToDouble(_col2)) BETWEEN 0.6666666666666666 AND 1.5) ELSE (null) END
+                Group By Operator [GBY_25] (rows=25012152 width=15)
+                  Output:["_col0","_col1","_col2","_col3"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)"],keys:KEY._col0, KEY._col1
+                <-Reducer 4 [SIMPLE_EDGE]
+                  SHUFFLE [RS_24]
+                    PartitionCols:_col0, _col1
+                    Group By Operator [GBY_23] (rows=50024305 width=15)
+                      Output:["_col0","_col1","_col2","_col3"],aggregations:["sum(_col2)","sum(_col3)"],keys:_col0, _col1
+                      Select Operator [SEL_21] (rows=50024305 width=15)
+                        Output:["_col0","_col1","_col2","_col3"]
+                        Merge Join Operator [MERGEJOIN_47] (rows=50024305 width=15)
+                          Conds:RS_18._col2=RS_19._col0(Inner),Output:["_col3","_col5","_col7","_col10"]
+                        <-Map 9 [SIMPLE_EDGE]
+                          SHUFFLE [RS_19]
+                            PartitionCols:_col0
+                            Select Operator [SEL_11] (rows=27 width=1029)
+                              Output:["_col0","_col1"]
+                              Filter Operator [FIL_44] (rows=27 width=1029)
+                                predicate:w_warehouse_sk is not null
+                                TableScan [TS_9] (rows=27 width=1029)
+                                  default@warehouse,warehouse,Tbl:COMPLETE,Col:NONE,Output:["w_warehouse_sk","w_warehouse_name"]
+                        <-Reducer 3 [SIMPLE_EDGE]
+                          SHUFFLE [RS_18]
+                            PartitionCols:_col2
+                            Merge Join Operator [MERGEJOIN_46] (rows=45476640 width=15)
+                              Conds:RS_15._col1=RS_16._col0(Inner),Output:["_col2","_col3","_col5","_col7"]
+                            <-Map 8 [SIMPLE_EDGE]
+                              SHUFFLE [RS_16]
+                                PartitionCols:_col0
+                                Select Operator [SEL_8] (rows=51333 width=1436)
+                                  Output:["_col0","_col1"]
+                                  Filter Operator [FIL_43] (rows=51333 width=1436)
+                                    predicate:(i_current_price BETWEEN 0.99 AND 1.49 and i_item_sk is not null)
+                                    TableScan [TS_6] (rows=462000 width=1436)
+                                      default@item,item,Tbl:COMPLETE,Col:NONE,Output:["i_item_sk","i_item_id","i_current_price"]
+                            <-Reducer 2 [SIMPLE_EDGE]
+                              SHUFFLE [RS_15]
+                                PartitionCols:_col1
+                                Merge Join Operator [MERGEJOIN_45] (rows=41342400 width=15)
+                                  Conds:RS_12._col0=RS_13._col0(Inner),Output:["_col1","_col2","_col3","_col5"]
+                                <-Map 1 [SIMPLE_EDGE]
+                                  SHUFFLE [RS_12]
+                                    PartitionCols:_col0
+                                    Select Operator [SEL_2] (rows=37584000 width=15)
+                                      Output:["_col0","_col1","_col2","_col3"]
+                                      Filter Operator [FIL_41] (rows=37584000 width=15)
+                                        predicate:(inv_date_sk is not null and inv_item_sk is not null and inv_warehouse_sk is not null)
+                                        TableScan [TS_0] (rows=37584000 width=15)
+                                          default@inventory,inventory,Tbl:COMPLETE,Col:NONE,Output:["inv_date_sk","inv_item_sk","inv_warehouse_sk","inv_quantity_on_hand"]
+                                <-Map 7 [SIMPLE_EDGE]
+                                  SHUFFLE [RS_13]
+                                    PartitionCols:_col0
+                                    Select Operator [SEL_5] (rows=8116 width=1119)
+                                      Output:["_col0","_col1"]
+                                      Filter Operator [FIL_42] (rows=8116 width=1119)
+                                        predicate:(CAST( d_date AS TIMESTAMP) BETWEEN 1998-03-08 23:00:00.0 AND 1998-05-08 00:00:00.0 and d_date_sk is not null)
+                                        TableScan [TS_3] (rows=73049 width=1119)
+                                          default@date_dim,date_dim,Tbl:COMPLETE,Col:NONE,Output:["d_date_sk","d_date"]
+


Mime
View raw message