http://git-wip-us.apache.org/repos/asf/hive/blob/b8299551/ql/src/test/results/clientpositive/perf/tez/constraints/query49.q.out ---------------------------------------------------------------------- diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query49.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query49.q.out new file mode 100644 index 0000000..324eef2 --- /dev/null +++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query49.q.out @@ -0,0 +1,555 @@ +PREHOOK: query: explain +select + 'web' as channel + ,web.item + ,web.return_ratio + ,web.return_rank + ,web.currency_rank + from ( + select + item + ,return_ratio + ,currency_ratio + ,rank() over (order by return_ratio) as return_rank + ,rank() over (order by currency_ratio) as currency_rank + from + ( select ws.ws_item_sk as item + ,(cast(sum(coalesce(wr.wr_return_quantity,0)) as dec(15,4))/ + cast(sum(coalesce(ws.ws_quantity,0)) as dec(15,4) )) as return_ratio + ,(cast(sum(coalesce(wr.wr_return_amt,0)) as dec(15,4))/ + cast(sum(coalesce(ws.ws_net_paid,0)) as dec(15,4) )) as currency_ratio + from + web_sales ws left outer join web_returns wr + on (ws.ws_order_number = wr.wr_order_number and + ws.ws_item_sk = wr.wr_item_sk) + ,date_dim + where + wr.wr_return_amt > 10000 + and ws.ws_net_profit > 1 + and ws.ws_net_paid > 0 + and ws.ws_quantity > 0 + and ws_sold_date_sk = d_date_sk + and d_year = 2000 + and d_moy = 12 + group by ws.ws_item_sk + ) in_web + ) web + where + ( + web.return_rank <= 10 + or + web.currency_rank <= 10 + ) + union + select + 'catalog' as channel + ,catalog.item + ,catalog.return_ratio + ,catalog.return_rank + ,catalog.currency_rank + from ( + select + item + ,return_ratio + ,currency_ratio + ,rank() over (order by return_ratio) as return_rank + ,rank() over (order by currency_ratio) as currency_rank + from + ( select + cs.cs_item_sk as item + ,(cast(sum(coalesce(cr.cr_return_quantity,0)) as dec(15,4))/ + cast(sum(coalesce(cs.cs_quantity,0)) as dec(15,4) )) as return_ratio + ,(cast(sum(coalesce(cr.cr_return_amount,0)) as dec(15,4))/ + cast(sum(coalesce(cs.cs_net_paid,0)) as dec(15,4) )) as currency_ratio + from + catalog_sales cs left outer join catalog_returns cr + on (cs.cs_order_number = cr.cr_order_number and + cs.cs_item_sk = cr.cr_item_sk) + ,date_dim + where + cr.cr_return_amount > 10000 + and cs.cs_net_profit > 1 + and cs.cs_net_paid > 0 + and cs.cs_quantity > 0 + and cs_sold_date_sk = d_date_sk + and d_year = 2000 + and d_moy = 12 + group by cs.cs_item_sk + ) in_cat + ) catalog + where + ( + catalog.return_rank <= 10 + or + catalog.currency_rank <=10 + ) + union + select + 'store' as channel + ,store.item + ,store.return_ratio + ,store.return_rank + ,store.currency_rank + from ( + select + item + ,return_ratio + ,currency_ratio + ,rank() over (order by return_ratio) as return_rank + ,rank() over (order by currency_ratio) as currency_rank + from + ( select sts.ss_item_sk as item + ,(cast(sum(coalesce(sr.sr_return_quantity,0)) as dec(15,4))/cast(sum(coalesce(sts.ss_quantity,0)) as dec(15,4) )) as return_ratio + ,(cast(sum(coalesce(sr.sr_return_amt,0)) as dec(15,4))/cast(sum(coalesce(sts.ss_net_paid,0)) as dec(15,4) )) as currency_ratio + from + store_sales sts left outer join store_returns sr + on (sts.ss_ticket_number = sr.sr_ticket_number and sts.ss_item_sk = sr.sr_item_sk) + ,date_dim + where + sr.sr_return_amt > 10000 + and sts.ss_net_profit > 1 + and sts.ss_net_paid > 0 + and sts.ss_quantity > 0 + and ss_sold_date_sk = d_date_sk + and d_year = 2000 + and d_moy = 12 + group by sts.ss_item_sk + ) in_store + ) store + where ( + store.return_rank <= 10 + or + store.currency_rank <= 10 + ) + order by 1,4,5 + limit 100 +PREHOOK: type: QUERY +PREHOOK: Input: default@catalog_returns +PREHOOK: Input: default@catalog_sales +PREHOOK: Input: default@date_dim +PREHOOK: Input: default@store_returns +PREHOOK: Input: default@store_sales +PREHOOK: Input: default@web_returns +PREHOOK: Input: default@web_sales +PREHOOK: Output: hdfs://### HDFS PATH ### +POSTHOOK: query: explain +select + 'web' as channel + ,web.item + ,web.return_ratio + ,web.return_rank + ,web.currency_rank + from ( + select + item + ,return_ratio + ,currency_ratio + ,rank() over (order by return_ratio) as return_rank + ,rank() over (order by currency_ratio) as currency_rank + from + ( select ws.ws_item_sk as item + ,(cast(sum(coalesce(wr.wr_return_quantity,0)) as dec(15,4))/ + cast(sum(coalesce(ws.ws_quantity,0)) as dec(15,4) )) as return_ratio + ,(cast(sum(coalesce(wr.wr_return_amt,0)) as dec(15,4))/ + cast(sum(coalesce(ws.ws_net_paid,0)) as dec(15,4) )) as currency_ratio + from + web_sales ws left outer join web_returns wr + on (ws.ws_order_number = wr.wr_order_number and + ws.ws_item_sk = wr.wr_item_sk) + ,date_dim + where + wr.wr_return_amt > 10000 + and ws.ws_net_profit > 1 + and ws.ws_net_paid > 0 + and ws.ws_quantity > 0 + and ws_sold_date_sk = d_date_sk + and d_year = 2000 + and d_moy = 12 + group by ws.ws_item_sk + ) in_web + ) web + where + ( + web.return_rank <= 10 + or + web.currency_rank <= 10 + ) + union + select + 'catalog' as channel + ,catalog.item + ,catalog.return_ratio + ,catalog.return_rank + ,catalog.currency_rank + from ( + select + item + ,return_ratio + ,currency_ratio + ,rank() over (order by return_ratio) as return_rank + ,rank() over (order by currency_ratio) as currency_rank + from + ( select + cs.cs_item_sk as item + ,(cast(sum(coalesce(cr.cr_return_quantity,0)) as dec(15,4))/ + cast(sum(coalesce(cs.cs_quantity,0)) as dec(15,4) )) as return_ratio + ,(cast(sum(coalesce(cr.cr_return_amount,0)) as dec(15,4))/ + cast(sum(coalesce(cs.cs_net_paid,0)) as dec(15,4) )) as currency_ratio + from + catalog_sales cs left outer join catalog_returns cr + on (cs.cs_order_number = cr.cr_order_number and + cs.cs_item_sk = cr.cr_item_sk) + ,date_dim + where + cr.cr_return_amount > 10000 + and cs.cs_net_profit > 1 + and cs.cs_net_paid > 0 + and cs.cs_quantity > 0 + and cs_sold_date_sk = d_date_sk + and d_year = 2000 + and d_moy = 12 + group by cs.cs_item_sk + ) in_cat + ) catalog + where + ( + catalog.return_rank <= 10 + or + catalog.currency_rank <=10 + ) + union + select + 'store' as channel + ,store.item + ,store.return_ratio + ,store.return_rank + ,store.currency_rank + from ( + select + item + ,return_ratio + ,currency_ratio + ,rank() over (order by return_ratio) as return_rank + ,rank() over (order by currency_ratio) as currency_rank + from + ( select sts.ss_item_sk as item + ,(cast(sum(coalesce(sr.sr_return_quantity,0)) as dec(15,4))/cast(sum(coalesce(sts.ss_quantity,0)) as dec(15,4) )) as return_ratio + ,(cast(sum(coalesce(sr.sr_return_amt,0)) as dec(15,4))/cast(sum(coalesce(sts.ss_net_paid,0)) as dec(15,4) )) as currency_ratio + from + store_sales sts left outer join store_returns sr + on (sts.ss_ticket_number = sr.sr_ticket_number and sts.ss_item_sk = sr.sr_item_sk) + ,date_dim + where + sr.sr_return_amt > 10000 + and sts.ss_net_profit > 1 + and sts.ss_net_paid > 0 + and sts.ss_quantity > 0 + and ss_sold_date_sk = d_date_sk + and d_year = 2000 + and d_moy = 12 + group by sts.ss_item_sk + ) in_store + ) store + where ( + store.return_rank <= 10 + or + store.currency_rank <= 10 + ) + order by 1,4,5 + limit 100 +POSTHOOK: type: QUERY +POSTHOOK: Input: default@catalog_returns +POSTHOOK: Input: default@catalog_sales +POSTHOOK: Input: default@date_dim +POSTHOOK: Input: default@store_returns +POSTHOOK: Input: default@store_sales +POSTHOOK: Input: default@web_returns +POSTHOOK: Input: default@web_sales +POSTHOOK: Output: hdfs://### HDFS PATH ### +Plan optimized by CBO. + +Vertex dependency in root stage +Map 1 <- Reducer 13 (BROADCAST_EDGE) +Map 27 <- Reducer 19 (BROADCAST_EDGE) +Map 29 <- Reducer 25 (BROADCAST_EDGE) +Reducer 10 <- Union 9 (SIMPLE_EDGE) +Reducer 11 <- Reducer 10 (SIMPLE_EDGE) +Reducer 13 <- Map 12 (CUSTOM_SIMPLE_EDGE) +Reducer 14 <- Map 12 (SIMPLE_EDGE), Map 27 (SIMPLE_EDGE) +Reducer 15 <- Map 28 (SIMPLE_EDGE), Reducer 14 (SIMPLE_EDGE) +Reducer 16 <- Reducer 15 (SIMPLE_EDGE) +Reducer 17 <- Reducer 16 (SIMPLE_EDGE) +Reducer 18 <- Reducer 17 (SIMPLE_EDGE), Union 7 (CONTAINS) +Reducer 19 <- Map 12 (CUSTOM_SIMPLE_EDGE) +Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 12 (SIMPLE_EDGE) +Reducer 20 <- Map 12 (SIMPLE_EDGE), Map 29 (SIMPLE_EDGE) +Reducer 21 <- Map 30 (SIMPLE_EDGE), Reducer 20 (SIMPLE_EDGE) +Reducer 22 <- Reducer 21 (SIMPLE_EDGE) +Reducer 23 <- Reducer 22 (SIMPLE_EDGE) +Reducer 24 <- Reducer 23 (SIMPLE_EDGE), Union 9 (CONTAINS) +Reducer 25 <- Map 12 (CUSTOM_SIMPLE_EDGE) +Reducer 3 <- Map 26 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE) +Reducer 4 <- Reducer 3 (SIMPLE_EDGE) +Reducer 5 <- Reducer 4 (SIMPLE_EDGE) +Reducer 6 <- Reducer 5 (SIMPLE_EDGE), Union 7 (CONTAINS) +Reducer 8 <- Union 7 (SIMPLE_EDGE), Union 9 (CONTAINS) + +Stage-0 + Fetch Operator + limit:100 + Stage-1 + Reducer 11 vectorized + File Output Operator [FS_310] + Limit [LIM_309] (rows=100 width=215) + Number of rows:100 + Select Operator [SEL_308] (rows=3418 width=215) + Output:["_col0","_col1","_col2","_col3","_col4"] + <-Reducer 10 [SIMPLE_EDGE] vectorized + SHUFFLE [RS_307] + Select Operator [SEL_306] (rows=3418 width=215) + Output:["_col0","_col1","_col2","_col3","_col4"] + Group By Operator [GBY_305] (rows=3418 width=215) + Output:["_col0","_col1","_col2","_col3","_col4"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4 + <-Union 9 [SIMPLE_EDGE] + <-Reducer 24 [CONTAINS] vectorized + Reduce Output Operator [RS_351] + PartitionCols:_col0, _col1, _col2, _col3, _col4 + Group By Operator [GBY_350] (rows=3418 width=215) + Output:["_col0","_col1","_col2","_col3","_col4"],keys:_col0, _col3, _col4, _col1, _col2 + Top N Key Operator [TNK_349] (rows=3418 width=214) + keys:_col0, _col3, _col4, _col1, _col2,sort order:+++++,top n:100 + Select Operator [SEL_348] (rows=1142 width=213) + Output:["_col0","_col1","_col2","_col3","_col4"] + Filter Operator [FIL_347] (rows=1142 width=248) + predicate:((_col0 <= 10) or (rank_window_1 <= 10)) + PTF Operator [PTF_346] (rows=1714 width=248) + Function definitions:[{},{"name:":"windowingtablefunction","order by:":"(CAST( _col4 AS decimal(15,4)) / CAST( _col5 AS decimal(15,4))) ASC NULLS LAST","partition by:":"0"}] + Select Operator [SEL_345] (rows=1714 width=248) + Output:["_col0","_col1","_col2","_col3","_col4","_col5"] + <-Reducer 23 [SIMPLE_EDGE] vectorized + SHUFFLE [RS_344] + PartitionCols:0 + Select Operator [SEL_343] (rows=1714 width=244) + Output:["rank_window_0","_col0","_col1","_col2","_col3","_col4"] + PTF Operator [PTF_342] (rows=1714 width=244) + Function definitions:[{},{"name:":"windowingtablefunction","order by:":"(CAST( _col1 AS decimal(15,4)) / CAST( _col2 AS decimal(15,4))) ASC NULLS LAST","partition by:":"0"}] + Select Operator [SEL_341] (rows=1714 width=244) + Output:["_col0","_col1","_col2","_col3","_col4"] + <-Reducer 22 [SIMPLE_EDGE] vectorized + SHUFFLE [RS_340] + PartitionCols:0 + Group By Operator [GBY_339] (rows=1714 width=244) + Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)","sum(VALUE._col3)"],keys:KEY._col0 + <-Reducer 21 [SIMPLE_EDGE] + SHUFFLE [RS_89] + PartitionCols:_col0 + Group By Operator [GBY_88] (rows=1714 width=244) + Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(_col1)","sum(_col2)","sum(_col3)","sum(_col4)"],keys:_col0 + Select Operator [SEL_86] (rows=1673571 width=73) + Output:["_col0","_col1","_col2","_col3","_col4"] + Merge Join Operator [MERGEJOIN_237] (rows=1673571 width=73) + Conds:RS_83._col1, _col2=RS_338._col0, _col1(Inner),Output:["_col1","_col3","_col4","_col9","_col10"] + <-Map 30 [SIMPLE_EDGE] vectorized + SHUFFLE [RS_338] + PartitionCols:_col0, _col1 + Select Operator [SEL_337] (rows=19197050 width=119) + Output:["_col0","_col1","_col2","_col3"] + Filter Operator [FIL_336] (rows=19197050 width=119) + predicate:(sr_return_amt > 10000) + TableScan [TS_77] (rows=57591150 width=119) + default@store_returns,sr,Tbl:COMPLETE,Col:COMPLETE,Output:["sr_item_sk","sr_ticket_number","sr_return_quantity","sr_return_amt"] + <-Reducer 20 [SIMPLE_EDGE] + SHUFFLE [RS_83] + PartitionCols:_col1, _col2 + Merge Join Operator [MERGEJOIN_236] (rows=1673571 width=8) + Conds:RS_335._col0=RS_272._col0(Inner),Output:["_col1","_col2","_col3","_col4"] + <-Map 12 [SIMPLE_EDGE] vectorized + PARTITION_ONLY_SHUFFLE [RS_272] + PartitionCols:_col0 + Select Operator [SEL_267] (rows=50 width=4) + Output:["_col0"] + Filter Operator [FIL_266] (rows=50 width=12) + predicate:((d_moy = 12) and (d_year = 2000)) + TableScan [TS_3] (rows=73049 width=12) + default@date_dim,date_dim,Tbl:COMPLETE,Col:COMPLETE,Output:["d_date_sk","d_year","d_moy"] + <-Map 29 [SIMPLE_EDGE] vectorized + SHUFFLE [RS_335] + PartitionCols:_col0 + Select Operator [SEL_334] (rows=61119617 width=229) + Output:["_col0","_col1","_col2","_col3","_col4"] + Filter Operator [FIL_333] (rows=61119617 width=229) + predicate:((ss_net_paid > 0) and (ss_net_profit > 1) and (ss_quantity > 0) and (ss_sold_date_sk BETWEEN DynamicValue(RS_81_date_dim_d_date_sk_min) AND DynamicValue(RS_81_date_dim_d_date_sk_max) and in_bloom_filter(ss_sold_date_sk, DynamicValue(RS_81_date_dim_d_date_sk_bloom_filter))) and ss_sold_date_sk is not null) + TableScan [TS_71] (rows=575995635 width=229) + default@store_sales,sts,Tbl:COMPLETE,Col:COMPLETE,Output:["ss_sold_date_sk","ss_item_sk","ss_ticket_number","ss_quantity","ss_net_paid","ss_net_profit"] + <-Reducer 25 [BROADCAST_EDGE] vectorized + BROADCAST [RS_332] + Group By Operator [GBY_331] (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 + PARTITION_ONLY_SHUFFLE [RS_279] + Group By Operator [GBY_276] (rows=1 width=12) + Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"] + Select Operator [SEL_273] (rows=50 width=4) + Output:["_col0"] + Please refer to the previous Select Operator [SEL_267] + <-Reducer 8 [CONTAINS] vectorized + Reduce Output Operator [RS_304] + PartitionCols:_col0, _col1, _col2, _col3, _col4 + Group By Operator [GBY_303] (rows=3418 width=215) + Output:["_col0","_col1","_col2","_col3","_col4"],keys:_col0, _col3, _col4, _col1, _col2 + Top N Key Operator [TNK_302] (rows=3418 width=214) + keys:_col0, _col3, _col4, _col1, _col2,sort order:+++++,top n:100 + Select Operator [SEL_301] (rows=2276 width=215) + Output:["_col0","_col1","_col2","_col3","_col4"] + Group By Operator [GBY_300] (rows=2276 width=215) + Output:["_col0","_col1","_col2","_col3","_col4"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4 + <-Union 7 [SIMPLE_EDGE] + <-Reducer 18 [CONTAINS] vectorized + Reduce Output Operator [RS_330] + PartitionCols:_col0, _col1, _col2, _col3, _col4 + Group By Operator [GBY_329] (rows=2276 width=215) + Output:["_col0","_col1","_col2","_col3","_col4"],keys:_col0, _col3, _col4, _col1, _col2 + Select Operator [SEL_328] (rows=1134 width=215) + Output:["_col0","_col1","_col2","_col3","_col4"] + Filter Operator [FIL_327] (rows=1134 width=248) + predicate:((_col0 <= 10) or (rank_window_1 <= 10)) + PTF Operator [PTF_326] (rows=1701 width=248) + Function definitions:[{},{"name:":"windowingtablefunction","order by:":"(CAST( _col4 AS decimal(15,4)) / CAST( _col5 AS decimal(15,4))) ASC NULLS LAST","partition by:":"0"}] + Select Operator [SEL_325] (rows=1701 width=248) + Output:["_col0","_col1","_col2","_col3","_col4","_col5"] + <-Reducer 17 [SIMPLE_EDGE] vectorized + SHUFFLE [RS_324] + PartitionCols:0 + Select Operator [SEL_323] (rows=1701 width=244) + Output:["rank_window_0","_col0","_col1","_col2","_col3","_col4"] + PTF Operator [PTF_322] (rows=1701 width=244) + Function definitions:[{},{"name:":"windowingtablefunction","order by:":"(CAST( _col1 AS decimal(15,4)) / CAST( _col2 AS decimal(15,4))) ASC NULLS LAST","partition by:":"0"}] + Select Operator [SEL_321] (rows=1701 width=244) + Output:["_col0","_col1","_col2","_col3","_col4"] + <-Reducer 16 [SIMPLE_EDGE] vectorized + SHUFFLE [RS_320] + PartitionCols:0 + Group By Operator [GBY_319] (rows=1701 width=244) + Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)","sum(VALUE._col3)"],keys:KEY._col0 + <-Reducer 15 [SIMPLE_EDGE] + SHUFFLE [RS_50] + PartitionCols:_col0 + Group By Operator [GBY_49] (rows=1701 width=244) + Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(_col1)","sum(_col2)","sum(_col3)","sum(_col4)"],keys:_col0 + Select Operator [SEL_47] (rows=865646 width=188) + Output:["_col0","_col1","_col2","_col3","_col4"] + Merge Join Operator [MERGEJOIN_235] (rows=865646 width=188) + Conds:RS_44._col1, _col2=RS_318._col0, _col1(Inner),Output:["_col1","_col3","_col4","_col9","_col10"] + <-Map 28 [SIMPLE_EDGE] vectorized + SHUFFLE [RS_318] + PartitionCols:_col0, _col1 + Select Operator [SEL_317] (rows=9599627 width=121) + Output:["_col0","_col1","_col2","_col3"] + Filter Operator [FIL_316] (rows=9599627 width=121) + predicate:(cr_return_amount > 10000) + TableScan [TS_38] (rows=28798881 width=121) + default@catalog_returns,cr,Tbl:COMPLETE,Col:COMPLETE,Output:["cr_item_sk","cr_order_number","cr_return_quantity","cr_return_amount"] + <-Reducer 14 [SIMPLE_EDGE] + SHUFFLE [RS_44] + PartitionCols:_col1, _col2 + Merge Join Operator [MERGEJOIN_234] (rows=865646 width=102) + Conds:RS_315._col0=RS_270._col0(Inner),Output:["_col1","_col2","_col3","_col4"] + <-Map 12 [SIMPLE_EDGE] vectorized + PARTITION_ONLY_SHUFFLE [RS_270] + PartitionCols:_col0 + Please refer to the previous Select Operator [SEL_267] + <-Map 27 [SIMPLE_EDGE] vectorized + SHUFFLE [RS_315] + PartitionCols:_col0 + Select Operator [SEL_314] (rows=31838858 width=239) + Output:["_col0","_col1","_col2","_col3","_col4"] + Filter Operator [FIL_313] (rows=31838858 width=239) + predicate:((cs_net_paid > 0) and (cs_net_profit > 1) and (cs_quantity > 0) and (cs_sold_date_sk BETWEEN DynamicValue(RS_42_date_dim_d_date_sk_min) AND DynamicValue(RS_42_date_dim_d_date_sk_max) and in_bloom_filter(cs_sold_date_sk, DynamicValue(RS_42_date_dim_d_date_sk_bloom_filter))) and cs_sold_date_sk is not null) + TableScan [TS_32] (rows=287989836 width=239) + default@catalog_sales,cs,Tbl:COMPLETE,Col:COMPLETE,Output:["cs_sold_date_sk","cs_item_sk","cs_order_number","cs_quantity","cs_net_paid","cs_net_profit"] + <-Reducer 19 [BROADCAST_EDGE] vectorized + BROADCAST [RS_312] + Group By Operator [GBY_311] (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 + PARTITION_ONLY_SHUFFLE [RS_278] + Group By Operator [GBY_275] (rows=1 width=12) + Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"] + Select Operator [SEL_271] (rows=50 width=4) + Output:["_col0"] + Please refer to the previous Select Operator [SEL_267] + <-Reducer 6 [CONTAINS] vectorized + Reduce Output Operator [RS_299] + PartitionCols:_col0, _col1, _col2, _col3, _col4 + Group By Operator [GBY_298] (rows=2276 width=215) + Output:["_col0","_col1","_col2","_col3","_col4"],keys:_col0, _col3, _col4, _col1, _col2 + Select Operator [SEL_297] (rows=1142 width=211) + Output:["_col0","_col1","_col2","_col3","_col4"] + Filter Operator [FIL_296] (rows=1142 width=248) + predicate:((_col0 <= 10) or (rank_window_1 <= 10)) + PTF Operator [PTF_295] (rows=1714 width=248) + Function definitions:[{},{"name:":"windowingtablefunction","order by:":"(CAST( _col4 AS decimal(15,4)) / CAST( _col5 AS decimal(15,4))) ASC NULLS LAST","partition by:":"0"}] + Select Operator [SEL_294] (rows=1714 width=248) + Output:["_col0","_col1","_col2","_col3","_col4","_col5"] + <-Reducer 5 [SIMPLE_EDGE] vectorized + SHUFFLE [RS_293] + PartitionCols:0 + Select Operator [SEL_292] (rows=1714 width=244) + Output:["rank_window_0","_col0","_col1","_col2","_col3","_col4"] + PTF Operator [PTF_291] (rows=1714 width=244) + Function definitions:[{},{"name:":"windowingtablefunction","order by:":"(CAST( _col1 AS decimal(15,4)) / CAST( _col2 AS decimal(15,4))) ASC NULLS LAST","partition by:":"0"}] + Select Operator [SEL_290] (rows=1714 width=244) + Output:["_col0","_col1","_col2","_col3","_col4"] + <-Reducer 4 [SIMPLE_EDGE] vectorized + SHUFFLE [RS_289] + PartitionCols:0 + Group By Operator [GBY_288] (rows=1714 width=244) + Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)","sum(VALUE._col3)"],keys:KEY._col0 + <-Reducer 3 [SIMPLE_EDGE] + SHUFFLE [RS_18] + PartitionCols:_col0 + Group By Operator [GBY_17] (rows=1714 width=244) + Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(_col1)","sum(_col2)","sum(_col3)","sum(_col4)"],keys:_col0 + Select Operator [SEL_15] (rows=438010 width=177) + Output:["_col0","_col1","_col2","_col3","_col4"] + Merge Join Operator [MERGEJOIN_233] (rows=438010 width=177) + Conds:RS_12._col1, _col2=RS_287._col0, _col1(Inner),Output:["_col1","_col3","_col4","_col9","_col10"] + <-Map 26 [SIMPLE_EDGE] vectorized + SHUFFLE [RS_287] + PartitionCols:_col0, _col1 + Select Operator [SEL_286] (rows=4799489 width=118) + Output:["_col0","_col1","_col2","_col3"] + Filter Operator [FIL_285] (rows=4799489 width=118) + predicate:(wr_return_amt > 10000) + TableScan [TS_6] (rows=14398467 width=118) + default@web_returns,wr,Tbl:COMPLETE,Col:COMPLETE,Output:["wr_item_sk","wr_order_number","wr_return_quantity","wr_return_amt"] + <-Reducer 2 [SIMPLE_EDGE] + SHUFFLE [RS_12] + PartitionCols:_col1, _col2 + Merge Join Operator [MERGEJOIN_232] (rows=438010 width=122) + Conds:RS_284._col0=RS_268._col0(Inner),Output:["_col1","_col2","_col3","_col4"] + <-Map 12 [SIMPLE_EDGE] vectorized + PARTITION_ONLY_SHUFFLE [RS_268] + PartitionCols:_col0 + Please refer to the previous Select Operator [SEL_267] + <-Map 1 [SIMPLE_EDGE] vectorized + SHUFFLE [RS_284] + PartitionCols:_col0 + Select Operator [SEL_283] (rows=15996318 width=239) + Output:["_col0","_col1","_col2","_col3","_col4"] + Filter Operator [FIL_282] (rows=15996318 width=239) + predicate:((ws_net_paid > 0) and (ws_net_profit > 1) and (ws_quantity > 0) and (ws_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(ws_sold_date_sk, DynamicValue(RS_10_date_dim_d_date_sk_bloom_filter))) and ws_sold_date_sk is not null) + TableScan [TS_0] (rows=144002668 width=239) + default@web_sales,ws,Tbl:COMPLETE,Col:COMPLETE,Output:["ws_sold_date_sk","ws_item_sk","ws_order_number","ws_quantity","ws_net_paid","ws_net_profit"] + <-Reducer 13 [BROADCAST_EDGE] vectorized + BROADCAST [RS_281] + Group By Operator [GBY_280] (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 + PARTITION_ONLY_SHUFFLE [RS_277] + Group By Operator [GBY_274] (rows=1 width=12) + Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"] + Select Operator [SEL_269] (rows=50 width=4) + Output:["_col0"] + Please refer to the previous Select Operator [SEL_267] +
http://git-wip-us.apache.org/repos/asf/hive/blob/b8299551/ql/src/test/results/clientpositive/perf/tez/constraints/query5.q.out ---------------------------------------------------------------------- diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query5.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query5.q.out new file mode 100644 index 0000000..32b0e3e --- /dev/null +++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query5.q.out @@ -0,0 +1,531 @@ +PREHOOK: query: explain +with ssr as + (select s_store_id, + sum(sales_price) as sales, + sum(profit) as profit, + sum(return_amt) as returns, + sum(net_loss) as profit_loss + from + ( select ss_store_sk as store_sk, + ss_sold_date_sk as date_sk, + ss_ext_sales_price as sales_price, + ss_net_profit as profit, + cast(0 as decimal(7,2)) as return_amt, + cast(0 as decimal(7,2)) as net_loss + from store_sales + union all + select sr_store_sk as store_sk, + sr_returned_date_sk as date_sk, + cast(0 as decimal(7,2)) as sales_price, + cast(0 as decimal(7,2)) as profit, + sr_return_amt as return_amt, + sr_net_loss as net_loss + from store_returns + ) salesreturns, + date_dim, + store + where date_sk = d_date_sk + and d_date between cast('1998-08-04' as date) + and (cast('1998-08-04' as date) + 14 days) + and store_sk = s_store_sk + group by s_store_id) + , + csr as + (select cp_catalog_page_id, + sum(sales_price) as sales, + sum(profit) as profit, + sum(return_amt) as returns, + sum(net_loss) as profit_loss + from + ( select cs_catalog_page_sk as page_sk, + cs_sold_date_sk as date_sk, + cs_ext_sales_price as sales_price, + cs_net_profit as profit, + cast(0 as decimal(7,2)) as return_amt, + cast(0 as decimal(7,2)) as net_loss + from catalog_sales + union all + select cr_catalog_page_sk as page_sk, + cr_returned_date_sk as date_sk, + cast(0 as decimal(7,2)) as sales_price, + cast(0 as decimal(7,2)) as profit, + cr_return_amount as return_amt, + cr_net_loss as net_loss + from catalog_returns + ) salesreturns, + date_dim, + catalog_page + where date_sk = d_date_sk + and d_date between cast('1998-08-04' as date) + and (cast('1998-08-04' as date) + 14 days) + and page_sk = cp_catalog_page_sk + group by cp_catalog_page_id) + , + wsr as + (select web_site_id, + sum(sales_price) as sales, + sum(profit) as profit, + sum(return_amt) as returns, + sum(net_loss) as profit_loss + from + ( select ws_web_site_sk as wsr_web_site_sk, + ws_sold_date_sk as date_sk, + ws_ext_sales_price as sales_price, + ws_net_profit as profit, + cast(0 as decimal(7,2)) as return_amt, + cast(0 as decimal(7,2)) as net_loss + from web_sales + union all + select ws_web_site_sk as wsr_web_site_sk, + wr_returned_date_sk as date_sk, + cast(0 as decimal(7,2)) as sales_price, + cast(0 as decimal(7,2)) as profit, + wr_return_amt as return_amt, + wr_net_loss as net_loss + from web_returns left outer join web_sales on + ( wr_item_sk = ws_item_sk + and wr_order_number = ws_order_number) + ) salesreturns, + date_dim, + web_site + where date_sk = d_date_sk + and d_date between cast('1998-08-04' as date) + and (cast('1998-08-04' as date) + 14 days) + and wsr_web_site_sk = web_site_sk + group by web_site_id) + select channel + , id + , sum(sales) as sales + , sum(returns) as returns + , sum(profit) as profit + from + (select 'store channel' as channel + , 'store' || s_store_id as id + , sales + , returns + , (profit - profit_loss) as profit + from ssr + union all + select 'catalog channel' as channel + , 'catalog_page' || cp_catalog_page_id as id + , sales + , returns + , (profit - profit_loss) as profit + from csr + union all + select 'web channel' as channel + , 'web_site' || web_site_id as id + , sales + , returns + , (profit - profit_loss) as profit + from wsr + ) x + group by rollup (channel, id) + order by channel + ,id + limit 100 +PREHOOK: type: QUERY +PREHOOK: Input: default@catalog_page +PREHOOK: Input: default@catalog_returns +PREHOOK: Input: default@catalog_sales +PREHOOK: Input: default@date_dim +PREHOOK: Input: default@store +PREHOOK: Input: default@store_returns +PREHOOK: Input: default@store_sales +PREHOOK: Input: default@web_returns +PREHOOK: Input: default@web_sales +PREHOOK: Input: default@web_site +PREHOOK: Output: hdfs://### HDFS PATH ### +POSTHOOK: query: explain +with ssr as + (select s_store_id, + sum(sales_price) as sales, + sum(profit) as profit, + sum(return_amt) as returns, + sum(net_loss) as profit_loss + from + ( select ss_store_sk as store_sk, + ss_sold_date_sk as date_sk, + ss_ext_sales_price as sales_price, + ss_net_profit as profit, + cast(0 as decimal(7,2)) as return_amt, + cast(0 as decimal(7,2)) as net_loss + from store_sales + union all + select sr_store_sk as store_sk, + sr_returned_date_sk as date_sk, + cast(0 as decimal(7,2)) as sales_price, + cast(0 as decimal(7,2)) as profit, + sr_return_amt as return_amt, + sr_net_loss as net_loss + from store_returns + ) salesreturns, + date_dim, + store + where date_sk = d_date_sk + and d_date between cast('1998-08-04' as date) + and (cast('1998-08-04' as date) + 14 days) + and store_sk = s_store_sk + group by s_store_id) + , + csr as + (select cp_catalog_page_id, + sum(sales_price) as sales, + sum(profit) as profit, + sum(return_amt) as returns, + sum(net_loss) as profit_loss + from + ( select cs_catalog_page_sk as page_sk, + cs_sold_date_sk as date_sk, + cs_ext_sales_price as sales_price, + cs_net_profit as profit, + cast(0 as decimal(7,2)) as return_amt, + cast(0 as decimal(7,2)) as net_loss + from catalog_sales + union all + select cr_catalog_page_sk as page_sk, + cr_returned_date_sk as date_sk, + cast(0 as decimal(7,2)) as sales_price, + cast(0 as decimal(7,2)) as profit, + cr_return_amount as return_amt, + cr_net_loss as net_loss + from catalog_returns + ) salesreturns, + date_dim, + catalog_page + where date_sk = d_date_sk + and d_date between cast('1998-08-04' as date) + and (cast('1998-08-04' as date) + 14 days) + and page_sk = cp_catalog_page_sk + group by cp_catalog_page_id) + , + wsr as + (select web_site_id, + sum(sales_price) as sales, + sum(profit) as profit, + sum(return_amt) as returns, + sum(net_loss) as profit_loss + from + ( select ws_web_site_sk as wsr_web_site_sk, + ws_sold_date_sk as date_sk, + ws_ext_sales_price as sales_price, + ws_net_profit as profit, + cast(0 as decimal(7,2)) as return_amt, + cast(0 as decimal(7,2)) as net_loss + from web_sales + union all + select ws_web_site_sk as wsr_web_site_sk, + wr_returned_date_sk as date_sk, + cast(0 as decimal(7,2)) as sales_price, + cast(0 as decimal(7,2)) as profit, + wr_return_amt as return_amt, + wr_net_loss as net_loss + from web_returns left outer join web_sales on + ( wr_item_sk = ws_item_sk + and wr_order_number = ws_order_number) + ) salesreturns, + date_dim, + web_site + where date_sk = d_date_sk + and d_date between cast('1998-08-04' as date) + and (cast('1998-08-04' as date) + 14 days) + and wsr_web_site_sk = web_site_sk + group by web_site_id) + select channel + , id + , sum(sales) as sales + , sum(returns) as returns + , sum(profit) as profit + from + (select 'store channel' as channel + , 'store' || s_store_id as id + , sales + , returns + , (profit - profit_loss) as profit + from ssr + union all + select 'catalog channel' as channel + , 'catalog_page' || cp_catalog_page_id as id + , sales + , returns + , (profit - profit_loss) as profit + from csr + union all + select 'web channel' as channel + , 'web_site' || web_site_id as id + , sales + , returns + , (profit - profit_loss) as profit + from wsr + ) x + group by rollup (channel, id) + order by channel + ,id + limit 100 +POSTHOOK: type: QUERY +POSTHOOK: Input: default@catalog_page +POSTHOOK: Input: default@catalog_returns +POSTHOOK: Input: default@catalog_sales +POSTHOOK: Input: default@date_dim +POSTHOOK: Input: default@store +POSTHOOK: Input: default@store_returns +POSTHOOK: Input: default@store_sales +POSTHOOK: Input: default@web_returns +POSTHOOK: Input: default@web_sales +POSTHOOK: Input: default@web_site +POSTHOOK: Output: hdfs://### HDFS PATH ### +Plan optimized by CBO. + +Vertex dependency in root stage +Map 1 <- Reducer 11 (BROADCAST_EDGE), Union 2 (CONTAINS) +Map 21 <- Reducer 15 (BROADCAST_EDGE), Union 22 (CONTAINS) +Map 23 <- Union 22 (CONTAINS) +Map 25 <- Reducer 19 (BROADCAST_EDGE), Union 26 (CONTAINS) +Map 9 <- Union 2 (CONTAINS) +Reducer 11 <- Map 10 (CUSTOM_SIMPLE_EDGE) +Reducer 12 <- Map 10 (SIMPLE_EDGE), Union 22 (SIMPLE_EDGE) +Reducer 13 <- Map 24 (SIMPLE_EDGE), Reducer 12 (SIMPLE_EDGE) +Reducer 14 <- Reducer 13 (SIMPLE_EDGE), Union 6 (CONTAINS) +Reducer 15 <- Map 10 (CUSTOM_SIMPLE_EDGE) +Reducer 16 <- Map 10 (SIMPLE_EDGE), Union 26 (SIMPLE_EDGE) +Reducer 17 <- Map 30 (SIMPLE_EDGE), Reducer 16 (SIMPLE_EDGE) +Reducer 18 <- Reducer 17 (SIMPLE_EDGE), Union 6 (CONTAINS) +Reducer 19 <- Map 10 (CUSTOM_SIMPLE_EDGE) +Reducer 28 <- Map 27 (SIMPLE_EDGE), Map 29 (SIMPLE_EDGE), Union 26 (CONTAINS) +Reducer 3 <- Map 10 (SIMPLE_EDGE), Union 2 (SIMPLE_EDGE) +Reducer 4 <- Map 20 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE) +Reducer 5 <- Reducer 4 (SIMPLE_EDGE), Union 6 (CONTAINS) +Reducer 7 <- Union 6 (SIMPLE_EDGE) +Reducer 8 <- Reducer 7 (SIMPLE_EDGE) + +Stage-0 + Fetch Operator + limit:100 + Stage-1 + Reducer 8 vectorized + File Output Operator [FS_300] + Limit [LIM_299] (rows=100 width=619) + Number of rows:100 + Select Operator [SEL_298] (rows=38846 width=619) + Output:["_col0","_col1","_col2","_col3","_col4"] + <-Reducer 7 [SIMPLE_EDGE] vectorized + SHUFFLE [RS_297] + Select Operator [SEL_296] (rows=38846 width=619) + Output:["_col0","_col1","_col2","_col3","_col4"] + Group By Operator [GBY_295] (rows=38846 width=627) + Output:["_col0","_col1","_col3","_col4","_col5"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)"],keys:KEY._col0, KEY._col1, KEY._col2 + <-Union 6 [SIMPLE_EDGE] + <-Reducer 14 [CONTAINS] vectorized + Reduce Output Operator [RS_310] + PartitionCols:_col0, _col1, _col2 + Group By Operator [GBY_309] (rows=59581 width=627) + Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(_col2)","sum(_col3)","sum(_col4)"],keys:_col0, _col1, 0L + Top N Key Operator [TNK_308] (rows=39721 width=618) + keys:_col0, _col1, 0L,sort order:+++,top n:100 + Select Operator [SEL_307] (rows=38846 width=619) + Output:["_col0","_col1","_col2","_col3","_col4"] + Group By Operator [GBY_306] (rows=38846 width=548) + Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)","sum(VALUE._col3)"],keys:KEY._col0 + <-Reducer 13 [SIMPLE_EDGE] + SHUFFLE [RS_45] + PartitionCols:_col0 + Group By Operator [GBY_44] (rows=46000 width=548) + Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(_col2)","sum(_col4)","sum(_col3)","sum(_col5)"],keys:_col8 + Merge Join Operator [MERGEJOIN_219] (rows=34813117 width=535) + Conds:RS_40._col0=RS_305._col0(Inner),Output:["_col2","_col3","_col4","_col5","_col8"] + <-Map 24 [SIMPLE_EDGE] vectorized + SHUFFLE [RS_305] + PartitionCols:_col0 + Select Operator [SEL_304] (rows=46000 width=104) + Output:["_col0","_col1"] + TableScan [TS_35] (rows=46000 width=104) + default@catalog_page,catalog_page,Tbl:COMPLETE,Col:COMPLETE,Output:["cp_catalog_page_sk","cp_catalog_page_id"] + <-Reducer 12 [SIMPLE_EDGE] + SHUFFLE [RS_40] + PartitionCols:_col0 + Merge Join Operator [MERGEJOIN_218] (rows=34813117 width=438) + Conds:Union 22._col1=RS_273._col0(Inner),Output:["_col0","_col2","_col3","_col4","_col5"] + <-Map 10 [SIMPLE_EDGE] vectorized + SHUFFLE [RS_273] + PartitionCols:_col0 + Select Operator [SEL_270] (rows=8116 width=4) + Output:["_col0"] + Filter Operator [FIL_269] (rows=8116 width=98) + predicate:CAST( d_date AS TIMESTAMP) BETWEEN TIMESTAMP'1998-08-04 00:00:00' AND TIMESTAMP'1998-08-18 00:00:00' + TableScan [TS_8] (rows=73049 width=98) + default@date_dim,date_dim,Tbl:COMPLETE,Col:COMPLETE,Output:["d_date_sk","d_date"] + <-Union 22 [SIMPLE_EDGE] + <-Map 21 [CONTAINS] vectorized + Reduce Output Operator [RS_322] + PartitionCols:_col1 + Select Operator [SEL_321] (rows=285117694 width=455) + Output:["_col0","_col1","_col2","_col3","_col4","_col5"] + Filter Operator [FIL_320] (rows=285117694 width=231) + predicate:((cs_sold_date_sk BETWEEN DynamicValue(RS_38_date_dim_d_date_sk_min) AND DynamicValue(RS_38_date_dim_d_date_sk_max) and in_bloom_filter(cs_sold_date_sk, DynamicValue(RS_38_date_dim_d_date_sk_bloom_filter))) and cs_catalog_page_sk is not null and cs_sold_date_sk is not null) + TableScan [TS_250] (rows=287989836 width=231) + Output:["cs_sold_date_sk","cs_catalog_page_sk","cs_ext_sales_price","cs_net_profit"] + <-Reducer 15 [BROADCAST_EDGE] vectorized + BROADCAST [RS_319] + Group By Operator [GBY_318] (rows=1 width=12) + Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"] + <-Map 10 [CUSTOM_SIMPLE_EDGE] vectorized + SHUFFLE [RS_281] + Group By Operator [GBY_278] (rows=1 width=12) + Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"] + Select Operator [SEL_274] (rows=8116 width=4) + Output:["_col0"] + Please refer to the previous Select Operator [SEL_270] + <-Map 23 [CONTAINS] vectorized + Reduce Output Operator [RS_325] + PartitionCols:_col1 + Select Operator [SEL_324] (rows=28221805 width=451) + Output:["_col0","_col1","_col2","_col3","_col4","_col5"] + Filter Operator [FIL_323] (rows=28221805 width=227) + predicate:(cr_catalog_page_sk is not null and cr_returned_date_sk is not null) + TableScan [TS_255] (rows=28798881 width=227) + Output:["cr_returned_date_sk","cr_catalog_page_sk","cr_return_amount","cr_net_loss"] + <-Reducer 18 [CONTAINS] vectorized + Reduce Output Operator [RS_317] + PartitionCols:_col0, _col1, _col2 + Group By Operator [GBY_316] (rows=59581 width=627) + Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(_col2)","sum(_col3)","sum(_col4)"],keys:_col0, _col1, 0L + Top N Key Operator [TNK_315] (rows=39721 width=618) + keys:_col0, _col1, 0L,sort order:+++,top n:100 + Select Operator [SEL_314] (rows=53 width=615) + Output:["_col0","_col1","_col2","_col3","_col4"] + Group By Operator [GBY_313] (rows=53 width=548) + Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)","sum(VALUE._col3)"],keys:KEY._col0 + <-Reducer 17 [SIMPLE_EDGE] + SHUFFLE [RS_77] + PartitionCols:_col0 + Group By Operator [GBY_76] (rows=84 width=548) + Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(_col2)","sum(_col4)","sum(_col3)","sum(_col5)"],keys:_col8 + Merge Join Operator [MERGEJOIN_221] (rows=30966059 width=543) + Conds:RS_72._col0=RS_312._col0(Inner),Output:["_col2","_col3","_col4","_col5","_col8"] + <-Map 30 [SIMPLE_EDGE] vectorized + SHUFFLE [RS_312] + PartitionCols:_col0 + Select Operator [SEL_311] (rows=84 width=104) + Output:["_col0","_col1"] + TableScan [TS_67] (rows=84 width=104) + default@web_site,web_site,Tbl:COMPLETE,Col:COMPLETE,Output:["web_site_sk","web_site_id"] + <-Reducer 16 [SIMPLE_EDGE] + SHUFFLE [RS_72] + PartitionCols:_col0 + Merge Join Operator [MERGEJOIN_220] (rows=30966059 width=447) + Conds:Union 26._col1=RS_275._col0(Inner),Output:["_col0","_col2","_col3","_col4","_col5"] + <-Map 10 [SIMPLE_EDGE] vectorized + SHUFFLE [RS_275] + PartitionCols:_col0 + Please refer to the previous Select Operator [SEL_270] + <-Union 26 [SIMPLE_EDGE] + <-Map 25 [CONTAINS] vectorized + Reduce Output Operator [RS_330] + PartitionCols:_col1 + Select Operator [SEL_329] (rows=143930874 width=455) + Output:["_col0","_col1","_col2","_col3","_col4","_col5"] + Filter Operator [FIL_328] (rows=143930874 width=231) + predicate:((ws_sold_date_sk BETWEEN DynamicValue(RS_70_date_dim_d_date_sk_min) AND DynamicValue(RS_70_date_dim_d_date_sk_max) and in_bloom_filter(ws_sold_date_sk, DynamicValue(RS_70_date_dim_d_date_sk_bloom_filter))) and ws_sold_date_sk is not null and ws_web_site_sk is not null) + TableScan [TS_260] (rows=144002668 width=231) + Output:["ws_sold_date_sk","ws_web_site_sk","ws_ext_sales_price","ws_net_profit"] + <-Reducer 19 [BROADCAST_EDGE] vectorized + BROADCAST [RS_327] + Group By Operator [GBY_326] (rows=1 width=12) + Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"] + <-Map 10 [CUSTOM_SIMPLE_EDGE] vectorized + SHUFFLE [RS_282] + Group By Operator [GBY_279] (rows=1 width=12) + Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"] + Select Operator [SEL_276] (rows=8116 width=4) + Output:["_col0"] + Please refer to the previous Select Operator [SEL_270] + <-Reducer 28 [CONTAINS] + Reduce Output Operator [RS_268] + PartitionCols:_col1 + Select Operator [SEL_266] (rows=134782734 width=454) + Output:["_col0","_col1","_col2","_col3","_col4","_col5"] + Merge Join Operator [MERGEJOIN_265] (rows=134782734 width=230) + Conds:RS_333._col0, _col2=RS_336._col1, _col2(Inner),Output:["_col1","_col3","_col6","_col7"] + <-Map 27 [SIMPLE_EDGE] vectorized + SHUFFLE [RS_333] + PartitionCols:_col0, _col2 + Select Operator [SEL_332] (rows=143966669 width=11) + Output:["_col0","_col1","_col2"] + Filter Operator [FIL_331] (rows=143966669 width=11) + predicate:ws_web_site_sk is not null + TableScan [TS_52] (rows=144002668 width=11) + default@web_sales,web_sales,Tbl:COMPLETE,Col:COMPLETE,Output:["ws_item_sk","ws_web_site_sk","ws_order_number"] + <-Map 29 [SIMPLE_EDGE] vectorized + SHUFFLE [RS_336] + PartitionCols:_col1, _col2 + Select Operator [SEL_335] (rows=13749816 width=225) + Output:["_col0","_col1","_col2","_col3","_col4"] + Filter Operator [FIL_334] (rows=13749816 width=225) + predicate:wr_returned_date_sk is not null + TableScan [TS_55] (rows=14398467 width=225) + default@web_returns,web_returns,Tbl:COMPLETE,Col:COMPLETE,Output:["wr_returned_date_sk","wr_item_sk","wr_order_number","wr_return_amt","wr_net_loss"] + <-Reducer 5 [CONTAINS] vectorized + Reduce Output Operator [RS_294] + PartitionCols:_col0, _col1, _col2 + Group By Operator [GBY_293] (rows=59581 width=627) + Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(_col2)","sum(_col3)","sum(_col4)"],keys:_col0, _col1, 0L + Top N Key Operator [TNK_292] (rows=39721 width=618) + keys:_col0, _col1, 0L,sort order:+++,top n:100 + Select Operator [SEL_291] (rows=822 width=617) + Output:["_col0","_col1","_col2","_col3","_col4"] + Group By Operator [GBY_290] (rows=822 width=548) + Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)","sum(VALUE._col3)"],keys:KEY._col0 + <-Reducer 4 [SIMPLE_EDGE] + SHUFFLE [RS_21] + PartitionCols:_col0 + Group By Operator [GBY_20] (rows=1704 width=548) + Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(_col2)","sum(_col4)","sum(_col3)","sum(_col5)"],keys:_col8 + Merge Join Operator [MERGEJOIN_217] (rows=64325014 width=376) + Conds:RS_16._col0=RS_289._col0(Inner),Output:["_col2","_col3","_col4","_col5","_col8"] + <-Map 20 [SIMPLE_EDGE] vectorized + SHUFFLE [RS_289] + PartitionCols:_col0 + Select Operator [SEL_288] (rows=1704 width=104) + Output:["_col0","_col1"] + TableScan [TS_11] (rows=1704 width=104) + default@store,store,Tbl:COMPLETE,Col:COMPLETE,Output:["s_store_sk","s_store_id"] + <-Reducer 3 [SIMPLE_EDGE] + SHUFFLE [RS_16] + PartitionCols:_col0 + Merge Join Operator [MERGEJOIN_216] (rows=64325014 width=277) + Conds:Union 2._col1=RS_271._col0(Inner),Output:["_col0","_col2","_col3","_col4","_col5"] + <-Map 10 [SIMPLE_EDGE] vectorized + SHUFFLE [RS_271] + PartitionCols:_col0 + Please refer to the previous Select Operator [SEL_270] + <-Union 2 [SIMPLE_EDGE] + <-Map 1 [CONTAINS] vectorized + Reduce Output Operator [RS_287] + PartitionCols:_col1 + Select Operator [SEL_286] (rows=525329897 width=445) + Output:["_col0","_col1","_col2","_col3","_col4","_col5"] + Filter Operator [FIL_285] (rows=525329897 width=221) + predicate:((ss_sold_date_sk BETWEEN DynamicValue(RS_14_date_dim_d_date_sk_min) AND DynamicValue(RS_14_date_dim_d_date_sk_max) and in_bloom_filter(ss_sold_date_sk, DynamicValue(RS_14_date_dim_d_date_sk_bloom_filter))) and ss_sold_date_sk is not null and ss_store_sk is not null) + TableScan [TS_222] (rows=575995635 width=221) + Output:["ss_sold_date_sk","ss_store_sk","ss_ext_sales_price","ss_net_profit"] + <-Reducer 11 [BROADCAST_EDGE] vectorized + BROADCAST [RS_284] + Group By Operator [GBY_283] (rows=1 width=12) + Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"] + <-Map 10 [CUSTOM_SIMPLE_EDGE] vectorized + SHUFFLE [RS_280] + Group By Operator [GBY_277] (rows=1 width=12) + Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"] + Select Operator [SEL_272] (rows=8116 width=4) + Output:["_col0"] + Please refer to the previous Select Operator [SEL_270] + <-Map 9 [CONTAINS] vectorized + Reduce Output Operator [RS_303] + PartitionCols:_col1 + Select Operator [SEL_302] (rows=53634860 width=447) + Output:["_col0","_col1","_col2","_col3","_col4","_col5"] + Filter Operator [FIL_301] (rows=53634860 width=223) + predicate:(sr_returned_date_sk is not null and sr_store_sk is not null) + TableScan [TS_233] (rows=57591150 width=223) + Output:["sr_returned_date_sk","sr_store_sk","sr_return_amt","sr_net_loss"] + http://git-wip-us.apache.org/repos/asf/hive/blob/b8299551/ql/src/test/results/clientpositive/perf/tez/constraints/query50.q.out ---------------------------------------------------------------------- diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query50.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query50.q.out new file mode 100644 index 0000000..05d84d8 --- /dev/null +++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query50.q.out @@ -0,0 +1,242 @@ +PREHOOK: query: explain +select + s_store_name + ,s_company_id + ,s_street_number + ,s_street_name + ,s_street_type + ,s_suite_number + ,s_city + ,s_county + ,s_state + ,s_zip + ,sum(case when (sr_returned_date_sk - ss_sold_date_sk <= 30 ) then 1 else 0 end) as `30 days` + ,sum(case when (sr_returned_date_sk - ss_sold_date_sk > 30) and + (sr_returned_date_sk - ss_sold_date_sk <= 60) then 1 else 0 end ) as `31-60 days` + ,sum(case when (sr_returned_date_sk - ss_sold_date_sk > 60) and + (sr_returned_date_sk - ss_sold_date_sk <= 90) then 1 else 0 end) as `61-90 days` + ,sum(case when (sr_returned_date_sk - ss_sold_date_sk > 90) and + (sr_returned_date_sk - ss_sold_date_sk <= 120) then 1 else 0 end) as `91-120 days` + ,sum(case when (sr_returned_date_sk - ss_sold_date_sk > 120) then 1 else 0 end) as `>120 days` +from + store_sales + ,store_returns + ,store + ,date_dim d1 + ,date_dim d2 +where + d2.d_year = 2000 +and d2.d_moy = 9 +and ss_ticket_number = sr_ticket_number +and ss_item_sk = sr_item_sk +and ss_sold_date_sk = d1.d_date_sk +and sr_returned_date_sk = d2.d_date_sk +and ss_customer_sk = sr_customer_sk +and ss_store_sk = s_store_sk +group by + s_store_name + ,s_company_id + ,s_street_number + ,s_street_name + ,s_street_type + ,s_suite_number + ,s_city + ,s_county + ,s_state + ,s_zip +order by s_store_name + ,s_company_id + ,s_street_number + ,s_street_name + ,s_street_type + ,s_suite_number + ,s_city + ,s_county + ,s_state + ,s_zip +limit 100 +PREHOOK: type: QUERY +PREHOOK: Input: default@date_dim +PREHOOK: Input: default@store +PREHOOK: Input: default@store_returns +PREHOOK: Input: default@store_sales +PREHOOK: Output: hdfs://### HDFS PATH ### +POSTHOOK: query: explain +select + s_store_name + ,s_company_id + ,s_street_number + ,s_street_name + ,s_street_type + ,s_suite_number + ,s_city + ,s_county + ,s_state + ,s_zip + ,sum(case when (sr_returned_date_sk - ss_sold_date_sk <= 30 ) then 1 else 0 end) as `30 days` + ,sum(case when (sr_returned_date_sk - ss_sold_date_sk > 30) and + (sr_returned_date_sk - ss_sold_date_sk <= 60) then 1 else 0 end ) as `31-60 days` + ,sum(case when (sr_returned_date_sk - ss_sold_date_sk > 60) and + (sr_returned_date_sk - ss_sold_date_sk <= 90) then 1 else 0 end) as `61-90 days` + ,sum(case when (sr_returned_date_sk - ss_sold_date_sk > 90) and + (sr_returned_date_sk - ss_sold_date_sk <= 120) then 1 else 0 end) as `91-120 days` + ,sum(case when (sr_returned_date_sk - ss_sold_date_sk > 120) then 1 else 0 end) as `>120 days` +from + store_sales + ,store_returns + ,store + ,date_dim d1 + ,date_dim d2 +where + d2.d_year = 2000 +and d2.d_moy = 9 +and ss_ticket_number = sr_ticket_number +and ss_item_sk = sr_item_sk +and ss_sold_date_sk = d1.d_date_sk +and sr_returned_date_sk = d2.d_date_sk +and ss_customer_sk = sr_customer_sk +and ss_store_sk = s_store_sk +group by + s_store_name + ,s_company_id + ,s_street_number + ,s_street_name + ,s_street_type + ,s_suite_number + ,s_city + ,s_county + ,s_state + ,s_zip +order by s_store_name + ,s_company_id + ,s_street_number + ,s_street_name + ,s_street_type + ,s_suite_number + ,s_city + ,s_county + ,s_state + ,s_zip +limit 100 +POSTHOOK: type: QUERY +POSTHOOK: Input: default@date_dim +POSTHOOK: Input: default@store +POSTHOOK: Input: default@store_returns +POSTHOOK: Input: default@store_sales +POSTHOOK: Output: hdfs://### HDFS PATH ### +Plan optimized by CBO. + +Vertex dependency in root stage +Map 11 <- Reducer 7 (BROADCAST_EDGE), Reducer 8 (BROADCAST_EDGE), Reducer 9 (BROADCAST_EDGE) +Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 10 (SIMPLE_EDGE) +Reducer 3 <- Map 11 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE) +Reducer 4 <- Map 12 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE) +Reducer 5 <- Reducer 4 (SIMPLE_EDGE) +Reducer 6 <- Reducer 5 (SIMPLE_EDGE) +Reducer 7 <- Reducer 2 (CUSTOM_SIMPLE_EDGE) +Reducer 8 <- Reducer 2 (CUSTOM_SIMPLE_EDGE) +Reducer 9 <- Reducer 2 (CUSTOM_SIMPLE_EDGE) + +Stage-0 + Fetch Operator + limit:100 + Stage-1 + Reducer 6 vectorized + File Output Operator [FS_118] + Limit [LIM_117] (rows=100 width=858) + Number of rows:100 + Select Operator [SEL_116] (rows=11945216 width=857) + Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14"] + <-Reducer 5 [SIMPLE_EDGE] vectorized + SHUFFLE [RS_115] + Group By Operator [GBY_114] (rows=11945216 width=857) + Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)","sum(VALUE._col3)","sum(VALUE._col4)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4, KEY._col5, KEY._col6, KEY._col7, KEY._col8, KEY._col9 + <-Reducer 4 [SIMPLE_EDGE] + SHUFFLE [RS_23] + PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9 + Group By Operator [GBY_22] (rows=11945216 width=857) + Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14"],aggregations:["sum(_col10)","sum(_col11)","sum(_col12)","sum(_col13)","sum(_col14)"],keys:_col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9 + Top N Key Operator [TNK_43] (rows=11945216 width=821) + keys:_col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9,sort order:++++++++++,top n:100 + Select Operator [SEL_20] (rows=11945216 width=821) + Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14"] + Merge Join Operator [MERGEJOIN_96] (rows=11945216 width=821) + Conds:RS_17._col8=RS_113._col0(Inner),Output:["_col0","_col5","_col11","_col12","_col13","_col14","_col15","_col16","_col17","_col18","_col19","_col20"] + <-Map 12 [SIMPLE_EDGE] vectorized + SHUFFLE [RS_113] + PartitionCols:_col0 + Select Operator [SEL_112] (rows=1704 width=821) + Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10"] + TableScan [TS_9] (rows=1704 width=821) + default@store,store,Tbl:COMPLETE,Col:COMPLETE,Output:["s_store_sk","s_store_name","s_company_id","s_street_number","s_street_name","s_street_type","s_suite_number","s_city","s_county","s_state","s_zip"] + <-Reducer 3 [SIMPLE_EDGE] + SHUFFLE [RS_17] + PartitionCols:_col8 + Merge Join Operator [MERGEJOIN_95] (rows=11945216 width=3) + Conds:RS_14._col1, _col2, _col3=RS_111._col1, _col2, _col4(Inner),Output:["_col0","_col5","_col8"] + <-Reducer 2 [SIMPLE_EDGE] + PARTITION_ONLY_SHUFFLE [RS_14] + PartitionCols:_col1, _col2, _col3 + Merge Join Operator [MERGEJOIN_94] (rows=1339446 width=8) + Conds:RS_99._col0=RS_102._col0(Inner),Output:["_col0","_col1","_col2","_col3"] + <-Map 1 [SIMPLE_EDGE] vectorized + SHUFFLE [RS_99] + PartitionCols:_col0 + Select Operator [SEL_98] (rows=53632139 width=15) + Output:["_col0","_col1","_col2","_col3"] + Filter Operator [FIL_97] (rows=53632139 width=15) + predicate:(sr_customer_sk is not null and sr_returned_date_sk is not null) + TableScan [TS_0] (rows=57591150 width=15) + default@store_returns,store_returns,Tbl:COMPLETE,Col:COMPLETE,Output:["sr_returned_date_sk","sr_item_sk","sr_customer_sk","sr_ticket_number"] + <-Map 10 [SIMPLE_EDGE] vectorized + SHUFFLE [RS_102] + PartitionCols:_col0 + Select Operator [SEL_101] (rows=50 width=4) + Output:["_col0"] + Filter Operator [FIL_100] (rows=50 width=12) + predicate:((d_moy = 9) and (d_year = 2000)) + TableScan [TS_3] (rows=73049 width=12) + default@date_dim,d2,Tbl:COMPLETE,Col:COMPLETE,Output:["d_date_sk","d_year","d_moy"] + <-Map 11 [SIMPLE_EDGE] vectorized + SHUFFLE [RS_111] + PartitionCols:_col1, _col2, _col4 + Select Operator [SEL_110] (rows=501694138 width=19) + Output:["_col0","_col1","_col2","_col3","_col4"] + Filter Operator [FIL_109] (rows=501694138 width=19) + predicate:((ss_customer_sk BETWEEN DynamicValue(RS_14_store_returns_sr_customer_sk_min) AND DynamicValue(RS_14_store_returns_sr_customer_sk_max) and in_bloom_filter(ss_customer_sk, DynamicValue(RS_14_store_returns_sr_customer_sk_bloom_filter))) and (ss_item_sk BETWEEN DynamicValue(RS_14_store_returns_sr_item_sk_min) AND DynamicValue(RS_14_store_returns_sr_item_sk_max) and in_bloom_filter(ss_item_sk, DynamicValue(RS_14_store_returns_sr_item_sk_bloom_filter))) and (ss_ticket_number BETWEEN DynamicValue(RS_14_store_returns_sr_ticket_number_min) AND DynamicValue(RS_14_store_returns_sr_ticket_number_max) and in_bloom_filter(ss_ticket_number, DynamicValue(RS_14_store_returns_sr_ticket_number_bloom_filter))) and ss_customer_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=19) + default@store_sales,store_sales,Tbl:COMPLETE,Col:COMPLETE,Output:["ss_sold_date_sk","ss_item_sk","ss_customer_sk","ss_store_sk","ss_ticket_number"] + <-Reducer 7 [BROADCAST_EDGE] vectorized + BROADCAST [RS_104] + Group By Operator [GBY_103] (rows=1 width=12) + Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"] + <-Reducer 2 [CUSTOM_SIMPLE_EDGE] + PARTITION_ONLY_SHUFFLE [RS_71] + Group By Operator [GBY_70] (rows=1 width=12) + Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"] + Select Operator [SEL_69] (rows=1339446 width=8) + Output:["_col0"] + Please refer to the previous Merge Join Operator [MERGEJOIN_94] + <-Reducer 8 [BROADCAST_EDGE] vectorized + BROADCAST [RS_106] + Group By Operator [GBY_105] (rows=1 width=12) + Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"] + <-Reducer 2 [CUSTOM_SIMPLE_EDGE] + PARTITION_ONLY_SHUFFLE [RS_76] + Group By Operator [GBY_75] (rows=1 width=12) + Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"] + Select Operator [SEL_74] (rows=1339446 width=0) + Output:["_col0"] + Please refer to the previous Merge Join Operator [MERGEJOIN_94] + <-Reducer 9 [BROADCAST_EDGE] vectorized + BROADCAST [RS_108] + Group By Operator [GBY_107] (rows=1 width=12) + Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"] + <-Reducer 2 [CUSTOM_SIMPLE_EDGE] + PARTITION_ONLY_SHUFFLE [RS_81] + Group By Operator [GBY_80] (rows=1 width=12) + Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"] + Select Operator [SEL_79] (rows=1339446 width=8) + Output:["_col0"] + Please refer to the previous Merge Join Operator [MERGEJOIN_94] +
