Skip to content

Commit 828c2ab

Browse files
authored
Numerics in beetween (#8004)
1 parent 9818f56 commit 828c2ab

File tree

10 files changed

+49
-49
lines changed

10 files changed

+49
-49
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,37 +16,37 @@ select avg(ss_quantity) avg_ss_q
1616
and cd_demo_sk = ss_cdemo_sk
1717
and cd_marital_status = 'U'
1818
and cd_education_status = 'Secondary'
19-
and ss_sales_price between 100.00 and 150.00
19+
and ss_sales_price between 100.00::numeric and 150.00::numeric
2020
and hd_dep_count = 3
2121
)or
2222
(ss_hdemo_sk=hd_demo_sk
2323
and cd_demo_sk = ss_cdemo_sk
2424
and cd_marital_status = 'W'
2525
and cd_education_status = 'College'
26-
and ss_sales_price between 50.00 and 100.00
26+
and ss_sales_price between 50.00::numeric and 100.00::numeric
2727
and hd_dep_count = 1
2828
) or
2929
(ss_hdemo_sk=hd_demo_sk
3030
and cd_demo_sk = ss_cdemo_sk
3131
and cd_marital_status = 'D'
3232
and cd_education_status = 'Primary'
33-
and ss_sales_price between 150.00 and 200.00
33+
and ss_sales_price between 150.00::numeric and 200.00::numeric
3434
and hd_dep_count = 1
3535
))
3636
and((ss_addr_sk = ca_address_sk
3737
and ca_country = 'United States'
3838
and ca_state in ('TX', 'OK', 'MI')
39-
and ss_net_profit between 100 and 200
39+
and ss_net_profit between 100::numeric and 200::numeric
4040
) or
4141
(ss_addr_sk = ca_address_sk
4242
and ca_country = 'United States'
4343
and ca_state in ('WA', 'NC', 'OH')
44-
and ss_net_profit between 150 and 300
44+
and ss_net_profit between 150::numeric and 300::numeric
4545
) or
4646
(ss_addr_sk = ca_address_sk
4747
and ca_country = 'United States'
4848
and ca_state in ('MT', 'FL', 'GA')
49-
and ss_net_profit between 50 and 250
49+
and ss_net_profit between 50::numeric and 250::numeric
5050
))
5151
;
5252

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ select *
1313
,{{warehouse}}
1414
,{{item}}
1515
,{{date_dim}}
16-
where i_current_price between 0.99 and 1.49
16+
where i_current_price between 0.99::numeric and 1.49::numeric
1717
and i_item_sk = inv_item_sk
1818
and inv_warehouse_sk = w_warehouse_sk
1919
and inv_date_sk = d_date_sk
@@ -23,7 +23,7 @@ select *
2323
where (case when inv_before > 0
2424
then inv_after / inv_before
2525
else null
26-
end) between (2.0/3.0) and (3.0/2.0)
26+
end) between (2.0/3.0)::numeric and (3.0/2.0)::numeric
2727
order by w_warehouse_name
2828
,i_item_id
2929
limit 100;

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

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,49 +6,49 @@ from (select avg(ss_list_price) B1_LP
66
,count(distinct ss_list_price) B1_CNTD
77
from {{store_sales}}
88
where ss_quantity between 0 and 5
9-
and (ss_list_price between 73 and (73+10)
10-
or ss_coupon_amt between 7826 and (7826+1000)
11-
or ss_wholesale_cost between 70 and (70+20))) B1,
9+
and (ss_list_price between 73::numeric and (73+10)::numeric
10+
or ss_coupon_amt between 7826::numeric and (7826+1000)::numeric
11+
or ss_wholesale_cost between 70::numeric and (70+20)::numeric)) B1,
1212
(select avg(ss_list_price) B2_LP
1313
,count(ss_list_price) B2_CNT
1414
,count(distinct ss_list_price) B2_CNTD
1515
from {{store_sales}}
1616
where ss_quantity between 6 and 10
17-
and (ss_list_price between 152 and (152+10)
18-
or ss_coupon_amt between 2196 and (2196+1000)
19-
or ss_wholesale_cost between 56 and (56+20))) B2,
17+
and (ss_list_price between 152::numeric and (152+10)::numeric
18+
or ss_coupon_amt between 2196::numeric and (2196+1000)::numeric
19+
or ss_wholesale_cost between 56::numeric and (56+20)::numeric)) B2,
2020
(select avg(ss_list_price) B3_LP
2121
,count(ss_list_price) B3_CNT
2222
,count(distinct ss_list_price) B3_CNTD
2323
from {{store_sales}}
2424
where ss_quantity between 11 and 15
25-
and (ss_list_price between 53 and (53+10)
26-
or ss_coupon_amt between 3430 and (3430+1000)
27-
or ss_wholesale_cost between 13 and (13+20))) B3,
25+
and (ss_list_price between 53::numeric and (53+10)::numeric
26+
or ss_coupon_amt between 3430::numeric and (3430+1000)::numeric
27+
or ss_wholesale_cost between 13::numeric and (13+20)::numeric)) B3,
2828
(select avg(ss_list_price) B4_LP
2929
,count(ss_list_price) B4_CNT
3030
,count(distinct ss_list_price) B4_CNTD
3131
from {{store_sales}}
3232
where ss_quantity between 16 and 20
33-
and (ss_list_price between 186 and (186+10)
34-
or ss_coupon_amt between 3262 and (3262+1000)
35-
or ss_wholesale_cost between 20 and (20+20))) B4,
33+
and (ss_list_price between 186::numeric and (186+10)::numeric
34+
or ss_coupon_amt between 3262::numeric and (3262+1000)::numeric
35+
or ss_wholesale_cost between 20::numeric and (20+20)::numeric)) B4,
3636
(select avg(ss_list_price) B5_LP
3737
,count(ss_list_price) B5_CNT
3838
,count(distinct ss_list_price) B5_CNTD
3939
from {{store_sales}}
4040
where ss_quantity between 21 and 25
41-
and (ss_list_price between 85 and (85+10)
42-
or ss_coupon_amt between 3310 and (3310+1000)
43-
or ss_wholesale_cost between 37 and (37+20))) B5,
41+
and (ss_list_price between 85::numeric and (85+10)::numeric
42+
or ss_coupon_amt between 3310::numeric and (3310+1000)::numeric
43+
or ss_wholesale_cost between 37::numeric and (37+20)::numeric)) B5,
4444
(select avg(ss_list_price) B6_LP
4545
,count(ss_list_price) B6_CNT
4646
,count(distinct ss_list_price) B6_CNTD
4747
from {{store_sales}}
4848
where ss_quantity between 26 and 30
49-
and (ss_list_price between 180 and (180+10)
50-
or ss_coupon_amt between 12592 and (12592+1000)
51-
or ss_wholesale_cost between 22 and (22+20))) B6
49+
and (ss_list_price between 180::numeric and (180+10)::numeric
50+
or ss_coupon_amt between 12592::numeric and (12592+1000)::numeric
51+
or ss_wholesale_cost between 22::numeric and (22+20)::numeric)) B6
5252
limit 100;
5353

5454
-- end query 1 in stream 0 using template ../query_templates/query28.tpl

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ select i_item_id
44
,i_item_desc
55
,i_current_price
66
from {{item}}, {{inventory}}, {{date_dim}}, {{catalog_sales}}
7-
where i_current_price between 39 and (39 + 30)
7+
where i_current_price between 39::numeric and (39 + 30)::numeric
88
and inv_item_sk = i_item_sk
99
and d_date_sk=inv_date_sk
1010
and d_date between cast('2001-01-16' as date) and (cast('2001-01-16' as date) + interval '60' day)::date

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ select
1515
,{{item}}
1616
,{{date_dim}}
1717
where
18-
i_current_price between 0.99 and 1.49
18+
i_current_price between 0.99::numeric and 1.49::numeric
1919
and i_item_sk = cs_item_sk
2020
and cs_warehouse_sk = w_warehouse_sk
2121
and cs_sold_date_sk = d_date_sk

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ select sum (ss_quantity)
1313
and
1414
cd_education_status = 'Unknown'
1515
and
16-
ss_sales_price between 100.00 and 150.00
16+
ss_sales_price between 100.00::numeric and 150.00::numeric
1717
)
1818
or
1919
(
@@ -23,7 +23,7 @@ select sum (ss_quantity)
2323
and
2424
cd_education_status = 'College'
2525
and
26-
ss_sales_price between 50.00 and 100.00
26+
ss_sales_price between 50.00::numeric and 100.00::numeric
2727
)
2828
or
2929
(
@@ -33,7 +33,7 @@ select sum (ss_quantity)
3333
and
3434
cd_education_status = 'Primary'
3535
and
36-
ss_sales_price between 150.00 and 200.00
36+
ss_sales_price between 150.00::numeric and 200.00::numeric
3737
)
3838
)
3939
and
@@ -44,23 +44,23 @@ select sum (ss_quantity)
4444
ca_country = 'United States'
4545
and
4646
ca_state in ('MI', 'GA', 'NH')
47-
and ss_net_profit between 0 and 2000
47+
and ss_net_profit between 0::numeric and 2000::numeric
4848
)
4949
or
5050
(ss_addr_sk = ca_address_sk
5151
and
5252
ca_country = 'United States'
5353
and
5454
ca_state in ('TX', 'KY', 'SD')
55-
and ss_net_profit between 150 and 3000
55+
and ss_net_profit between 150::numeric and 3000::numeric
5656
)
5757
or
5858
(ss_addr_sk = ca_address_sk
5959
and
6060
ca_country = 'United States'
6161
and
6262
ca_state in ('NY', 'OH', 'FL')
63-
and ss_net_profit between 50 and 25000
63+
and ss_net_profit between 50::numeric and 25000::numeric
6464
)
6565
)
6666
;

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ with ss_items as
5353
from ss_items,cs_items,ws_items
5454
where ss_items.item_id=cs_items.item_id
5555
and ss_items.item_id=ws_items.item_id
56-
and ss_item_rev between 0.9 * cs_item_rev and 1.1 * cs_item_rev
57-
and ss_item_rev between 0.9 * ws_item_rev and 1.1 * ws_item_rev
58-
and cs_item_rev between 0.9 * ss_item_rev and 1.1 * ss_item_rev
59-
and cs_item_rev between 0.9 * ws_item_rev and 1.1 * ws_item_rev
60-
and ws_item_rev between 0.9 * ss_item_rev and 1.1 * ss_item_rev
61-
and ws_item_rev between 0.9 * cs_item_rev and 1.1 * cs_item_rev
56+
and ss_item_rev between 0.9::numeric * cs_item_rev and 1.1::numeric * cs_item_rev
57+
and ss_item_rev between 0.9::numeric * ws_item_rev and 1.1::numeric * ws_item_rev
58+
and cs_item_rev between 0.9::numeric * ss_item_rev and 1.1::numeric * ss_item_rev
59+
and cs_item_rev between 0.9::numeric * ws_item_rev and 1.1::numeric * ws_item_rev
60+
and ws_item_rev between 0.9::numeric * ss_item_rev and 1.1::numeric * ss_item_rev
61+
and ws_item_rev between 0.9::numeric * cs_item_rev and 1.1::numeric * cs_item_rev
6262
order by item_id
6363
,ss_item_rev
6464
limit 100;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ cross_sales as
6767
hd2.hd_income_band_sk = ib2.ib_income_band_sk and
6868
cd1.cd_marital_status <> cd2.cd_marital_status and
6969
i_color in ('azure','gainsboro','misty','blush','hot','lemon') and
70-
i_current_price between 80 and (80 + 10) and
71-
i_current_price between (80 + 1) and (80 + 15)
70+
i_current_price between 80::numeric and (80 + 10)::numeric and
71+
i_current_price between (80 + 1)::numeric and (80 + 15)::numeric
7272
group by i_product_name
7373
,i_item_sk
7474
,s_store_name

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ select i_item_id
44
,i_item_desc
55
,i_current_price
66
from {{item}}, {{inventory}}, {{date_dim}}, {{store_sales}}
7-
where i_current_price between 49 and (49+30)
7+
where i_current_price between 49::numeric and (49+30)::numeric
88
and inv_item_sk = i_item_sk
99
and d_date_sk=inv_date_sk
1010
and d_date between cast('2001-01-28' as date) and (cast('2001-01-28' as date) + interval '60' day)::date

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ select substr(r_reason_desc,1,20) reason
2525
and
2626
cd1.cd_education_status = cd2.cd_education_status
2727
and
28-
ws_sales_price between 100.00 and 150.00
28+
ws_sales_price between 100.00::numeric and 150.00::numeric
2929
)
3030
or
3131
(
@@ -37,7 +37,7 @@ select substr(r_reason_desc,1,20) reason
3737
and
3838
cd1.cd_education_status = cd2.cd_education_status
3939
and
40-
ws_sales_price between 50.00 and 100.00
40+
ws_sales_price between 50.00::numeric and 100.00::numeric
4141
)
4242
or
4343
(
@@ -49,7 +49,7 @@ select substr(r_reason_desc,1,20) reason
4949
and
5050
cd1.cd_education_status = cd2.cd_education_status
5151
and
52-
ws_sales_price between 150.00 and 200.00
52+
ws_sales_price between 150.00::numeric and 200.00::numeric
5353
)
5454
)
5555
and
@@ -58,21 +58,21 @@ select substr(r_reason_desc,1,20) reason
5858
ca_country = 'United States'
5959
and
6060
ca_state in ('TX', 'VA', 'CA')
61-
and ws_net_profit between 100 and 200
61+
and ws_net_profit between 100::numeric and 200::numeric
6262
)
6363
or
6464
(
6565
ca_country = 'United States'
6666
and
6767
ca_state in ('AR', 'NE', 'MO')
68-
and ws_net_profit between 150 and 300
68+
and ws_net_profit between 150::numeric and 300::numeric
6969
)
7070
or
7171
(
7272
ca_country = 'United States'
7373
and
7474
ca_state in ('IA', 'MS', 'WA')
75-
and ws_net_profit between 50 and 250
75+
and ws_net_profit between 50::numeric and 250::numeric
7676
)
7777
)
7878
group by r_reason_desc

0 commit comments

Comments
 (0)