Skip to content

Commit 550f3b3

Browse files
authored
Canonical results for tpcds s1 (#11402)
1 parent 37b6f07 commit 550f3b3

File tree

132 files changed

+4729
-4844
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+4729
-4844
lines changed

ydb/library/benchmarks/gen_queries/consts.yql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@ $scale_factor = 1;
2828

2929
$round = ($x, $y) -> { return Math::Round($x, $y); };
3030
$upscale = ($x) -> { return $x; };
31+
32+
$todecimal = ($x, $p, $s) -> { return cast($x as double); };

ydb/library/benchmarks/gen_queries/consts_decimal.yql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ $scale_factor = 1;
2828

2929
$round = ($x,$y) -> {return $x;};
3030
$upscale = ($x) -> { return cast($x as decimal(35,9)); };
31+
$todecimal = ($x, $p, $s) -> { return cast(cast($x as string?) as decimal($p,$s)); };

ydb/library/benchmarks/queries/tpcds/pg/q41.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ select distinct(i_product_name)
1414
(i_category = 'Women' and
1515
(i_color = 'brown' or i_color = 'honeydew') and
1616
(i_units = 'Bunch' or i_units = 'Ton') and
17-
(i_size = 'petite' or i_size = 'large')
17+
(i_size = 'N/A' or i_size = 'small')
1818
) or
1919
(i_category = 'Men' and
2020
(i_color = 'floral' or i_color = 'deep') and
@@ -35,7 +35,7 @@ select distinct(i_product_name)
3535
(i_category = 'Women' and
3636
(i_color = 'cyan' or i_color = 'papaya') and
3737
(i_units = 'Cup' or i_units = 'Dram') and
38-
(i_size = 'petite' or i_size = 'large')
38+
(i_size = 'N/A' or i_size = 'small')
3939
) or
4040
(i_category = 'Men' and
4141
(i_color = 'orange' or i_color = 'frosted') and

ydb/library/benchmarks/queries/tpcds/pg/q66.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ select
196196
and cs_ship_mode_sk = sm_ship_mode_sk
197197
and d_year = 2001
198198
and t_time between 30838 AND 30838+28800
199-
and sm_carrier in ('MSC','BARIAN')
199+
and sm_carrier in ('DHL','BARIAN')
200200
group by
201201
w_warehouse_name
202202
,w_warehouse_sq_ft

ydb/library/benchmarks/queries/tpcds/pg/q71.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ select i_brand_id brand_id, i_brand brand,t_hour,t_minute,
3535
and time_sk = t_time_sk
3636
and (t_meal_time = 'breakfast' or t_meal_time = 'dinner')
3737
group by i_brand, i_brand_id,t_hour,t_minute
38-
order by ext_price desc nulls first, i_brand_id nulls first, t_hour,t_minute
38+
order by ext_price desc nulls last, i_brand_id nulls first
3939
limit 1000
4040
;
4141

ydb/library/benchmarks/queries/tpcds/pg/q76.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
select channel, col_name, d_year, d_qoy, i_category, COUNT(*) sales_cnt, SUM(ext_sales_price) sales_amt FROM (
44
SELECT 'store' as channel, 'ss_store_sk' col_name, d_year, d_qoy, i_category, ss_ext_sales_price ext_sales_price
55
FROM {{store_sales}}, {{item}}, {{date_dim}}
6-
WHERE ss_addr_sk IS NULL
6+
WHERE ss_store_sk IS NULL
77
AND ss_sold_date_sk=d_date_sk
88
AND ss_item_sk=i_item_sk
99
UNION ALL
1010
SELECT 'web' as channel, 'ws_ship_customer_sk' col_name, d_year, d_qoy, i_category, ws_ext_sales_price ext_sales_price
1111
FROM {{web_sales}}, {{item}}, {{date_dim}}
12-
WHERE ws_web_page_sk IS NULL
12+
WHERE ws_ship_customer_sk IS NULL
1313
AND ws_sold_date_sk=d_date_sk
1414
AND ws_item_sk=i_item_sk
1515
UNION ALL
1616
SELECT 'catalog' as channel, 'cs_ship_addr_sk' col_name, d_year, d_qoy, i_category, cs_ext_sales_price ext_sales_price
1717
FROM {{catalog_sales}}, {{item}}, {{date_dim}}
18-
WHERE cs_warehouse_sk IS NULL
18+
WHERE cs_ship_addr_sk IS NULL
1919
AND cs_sold_date_sk=d_date_sk
2020
AND cs_item_sk=i_item_sk) foo
2121
GROUP BY channel, col_name, d_year, d_qoy, i_category

ydb/library/benchmarks/queries/tpcds/pg/q83.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ with sr_items as
5050
group by i_item_id)
5151
select sr_items.item_id
5252
,sr_item_qty
53-
,sr_item_qty/(sr_item_qty+cr_item_qty+wr_item_qty)/3.0 * 100 sr_dev
53+
,cast(sr_item_qty as double)/(sr_item_qty+cr_item_qty+wr_item_qty)/3.0 * 100 sr_dev
5454
,cr_item_qty
55-
,cr_item_qty/(sr_item_qty+cr_item_qty+wr_item_qty)/3.0 * 100 cr_dev
55+
,cast(cr_item_qty as double)/(sr_item_qty+cr_item_qty+wr_item_qty)/3.0 * 100 cr_dev
5656
,wr_item_qty
57-
,wr_item_qty/(sr_item_qty+cr_item_qty+wr_item_qty)/3.0 * 100 wr_dev
57+
,cast(wr_item_qty as double)/(sr_item_qty+cr_item_qty+wr_item_qty)/3.0 * 100 wr_dev
5858
,(sr_item_qty+cr_item_qty+wr_item_qty)/3.0 average
5959
from sr_items
6060
,cr_items

ydb/library/benchmarks/queries/tpcds/pg/q85.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ select substr(r_reason_desc,1,20) reason
99
where ws_web_page_sk = wp_web_page_sk
1010
and ws_item_sk = wr_item_sk
1111
and ws_order_number = wr_order_number
12-
and ws_sold_date_sk = d_date_sk and d_year = 2001
12+
and ws_sold_date_sk = d_date_sk and d_year = 2000
1313
and cd1.cd_demo_sk = wr_refunded_cdemo_sk
1414
and cd2.cd_demo_sk = wr_returning_cdemo_sk
1515
and ca_address_sk = wr_refunded_addr_sk

ydb/library/benchmarks/queries/tpcds/yql/q15.sql

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,8 @@
33
-- NB: Subquerys
44

55
-- start query 1 in stream 0 using template query15.tpl and seed 1819994127
6-
$todecimal = ($x) -> {
7-
return cast(cast($x as string?) as decimal(7,2))
8-
};
9-
106
select customer_address.ca_zip
11-
,sum($todecimal(cs_sales_price))
7+
,sum($todecimal(cs_sales_price, 7, 2))
128
from {{catalog_sales}} as catalog_sales
139
cross join {{customer}} as customer
1410
cross join {{customer_address}} as customer_address

ydb/library/benchmarks/queries/tpcds/yql/q18.sql

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
-- TODO this commit should be reverted upon proper fix for https://github.com/ydb-platform/ydb/issues/7565
44
-- NB: Subquerys
55
-- start query 1 in stream 0 using template query18.tpl and seed 1978355063
6-
select item.i_item_id,
7-
customer_address.ca_country,
8-
customer_address.ca_state,
9-
customer_address.ca_county,
6+
select item.i_item_id i_item_id,
7+
customer_address.ca_country ca_country,
8+
customer_address.ca_state ca_state,
9+
customer_address.ca_county ca_county,
1010
avg( cast(cs_quantity as float)) agg1,
1111
avg( cast(cs_list_price as float)) agg2,
1212
avg( cast(cs_coupon_amt as float)) agg3,
@@ -34,10 +34,10 @@ select item.i_item_id,
3434
ca_state in ('MS','IN','ND'
3535
,'OK','NM','VA','MS')
3636
group by rollup (item.i_item_id, customer_address.ca_country, customer_address.ca_state, customer_address.ca_county)
37-
order by customer_address.ca_country,
38-
customer_address.ca_state,
39-
customer_address.ca_county,
40-
item.i_item_id, agg6
37+
order by ca_country,
38+
ca_state,
39+
ca_county,
40+
i_item_id, agg6
4141
limit 100;
4242

4343
-- end query 1 in stream 0 using template query18.tpl

0 commit comments

Comments
 (0)