forked from apache/spark
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #191 from markhamstra/csd-2.2
Merging Apache bugfixes
- Loading branch information
Showing
31 changed files
with
1,581 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
-- start query 10 in stream 0 using template query10.tpl | ||
with | ||
v1 as ( | ||
select | ||
ws_bill_customer_sk as customer_sk | ||
from web_sales, | ||
date_dim | ||
where ws_sold_date_sk = d_date_sk | ||
and d_year = 2002 | ||
and d_moy between 4 and 4+3 | ||
union all | ||
select | ||
cs_ship_customer_sk as customer_sk | ||
from catalog_sales, | ||
date_dim | ||
where cs_sold_date_sk = d_date_sk | ||
and d_year = 2002 | ||
and d_moy between 4 and 4+3 | ||
), | ||
v2 as ( | ||
select | ||
ss_customer_sk as customer_sk | ||
from store_sales, | ||
date_dim | ||
where ss_sold_date_sk = d_date_sk | ||
and d_year = 2002 | ||
and d_moy between 4 and 4+3 | ||
) | ||
select | ||
cd_gender, | ||
cd_marital_status, | ||
cd_education_status, | ||
count(*) cnt1, | ||
cd_purchase_estimate, | ||
count(*) cnt2, | ||
cd_credit_rating, | ||
count(*) cnt3, | ||
cd_dep_count, | ||
count(*) cnt4, | ||
cd_dep_employed_count, | ||
count(*) cnt5, | ||
cd_dep_college_count, | ||
count(*) cnt6 | ||
from customer c | ||
join customer_address ca on (c.c_current_addr_sk = ca.ca_address_sk) | ||
join customer_demographics on (cd_demo_sk = c.c_current_cdemo_sk) | ||
left semi join v1 on (v1.customer_sk = c.c_customer_sk) | ||
left semi join v2 on (v2.customer_sk = c.c_customer_sk) | ||
where | ||
ca_county in ('Walker County','Richland County','Gaines County','Douglas County','Dona Ana County') | ||
group by | ||
cd_gender, | ||
cd_marital_status, | ||
cd_education_status, | ||
cd_purchase_estimate, | ||
cd_credit_rating, | ||
cd_dep_count, | ||
cd_dep_employed_count, | ||
cd_dep_college_count | ||
order by | ||
cd_gender, | ||
cd_marital_status, | ||
cd_education_status, | ||
cd_purchase_estimate, | ||
cd_credit_rating, | ||
cd_dep_count, | ||
cd_dep_employed_count, | ||
cd_dep_college_count | ||
limit 100 | ||
-- end query 10 in stream 0 using template query10.tpl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
-- start query 19 in stream 0 using template query19.tpl | ||
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 | ||
and ss_sold_date_sk between 2451484 and 2451513 -- partition key filter | ||
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 | ||
-- end query 19 in stream 0 using template query19.tpl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
-- start query 27 in stream 0 using template query27.tpl | ||
with results as | ||
(select i_item_id, | ||
s_state, | ||
ss_quantity agg1, | ||
ss_list_price agg2, | ||
ss_coupon_amt agg3, | ||
ss_sales_price agg4 | ||
--0 as g_state, | ||
--avg(ss_quantity) agg1, | ||
--avg(ss_list_price) agg2, | ||
--avg(ss_coupon_amt) agg3, | ||
--avg(ss_sales_price) agg4 | ||
from store_sales, customer_demographics, date_dim, store, item | ||
where ss_sold_date_sk = d_date_sk and | ||
ss_sold_date_sk between 2451545 and 2451910 and | ||
ss_item_sk = i_item_sk and | ||
ss_store_sk = s_store_sk and | ||
ss_cdemo_sk = cd_demo_sk and | ||
cd_gender = 'F' and | ||
cd_marital_status = 'D' and | ||
cd_education_status = 'Primary' and | ||
d_year = 2000 and | ||
s_state in ('TN','AL', 'SD', 'SD', 'SD', 'SD') | ||
--group by i_item_id, s_state | ||
) | ||
|
||
select i_item_id, | ||
s_state, g_state, agg1, agg2, agg3, agg4 | ||
from ( | ||
select i_item_id, s_state, 0 as g_state, avg(agg1) agg1, avg(agg2) agg2, avg(agg3) agg3, avg(agg4) agg4 from results | ||
group by i_item_id, s_state | ||
union all | ||
select i_item_id, NULL AS s_state, 1 AS g_state, avg(agg1) agg1, avg(agg2) agg2, avg(agg3) agg3, | ||
avg(agg4) agg4 from results | ||
group by i_item_id | ||
union all | ||
select NULL AS i_item_id, NULL as s_state, 1 as g_state, avg(agg1) agg1, avg(agg2) agg2, avg(agg3) agg3, | ||
avg(agg4) agg4 from results | ||
) foo | ||
order by i_item_id, s_state | ||
limit 100 | ||
-- end query 27 in stream 0 using template query27.tpl |
Oops, something went wrong.