Skip to content

Commit 2a93861

Browse files
committed
HIVE-29203:get_aggr_stats_for doesn't aggregate stats when direct sql batch retrieve is enabled
1 parent 4bb0809 commit 2a93861

File tree

3 files changed

+388
-10
lines changed

3 files changed

+388
-10
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
set hive.mapred.mode=nonstrict;
2+
set hive.auto.convert.anti.join=true;
3+
set hive.metastore.direct.sql.batch.size=1000;
4+
-- start query 1 in stream 0 using template query16.tpl and seed 171719422
5+
explain
6+
select
7+
count(distinct cs_order_number) as `order count`
8+
,sum(cs_ext_ship_cost) as `total shipping cost`
9+
,sum(cs_net_profit) as `total net profit`
10+
from
11+
catalog_sales cs1
12+
,date_dim
13+
,customer_address
14+
,call_center
15+
where
16+
d_date between '2001-4-01' and
17+
(cast('2001-4-01' as date) + 60 days)
18+
and cs1.cs_ship_date_sk = d_date_sk
19+
and cs1.cs_ship_addr_sk = ca_address_sk
20+
and ca_state = 'NY'
21+
and cs1.cs_call_center_sk = cc_call_center_sk
22+
and cc_county in ('Ziebach County','Levy County','Huron County','Franklin Parish',
23+
'Daviess County'
24+
)
25+
and exists (select *
26+
from catalog_sales cs2
27+
where cs1.cs_order_number = cs2.cs_order_number
28+
and cs1.cs_warehouse_sk <> cs2.cs_warehouse_sk)
29+
and not exists(select *
30+
from catalog_returns cr1
31+
where cs1.cs_order_number = cr1.cr_order_number)
32+
order by count(distinct cs_order_number)
33+
limit 100;
34+
35+
-- end query 1 in stream 0 using template query16.tpl

0 commit comments

Comments
 (0)