Skip to content

Commit 0db3d8b

Browse files
authored
Add null first (#2926)
1 parent e5bd37c commit 0db3d8b

File tree

9 files changed

+42
-29
lines changed

9 files changed

+42
-29
lines changed

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ select i_item_id,
2626
ca_state in ('AR','TX','NC'
2727
,'GA','MS','WV','AL')
2828
group by rollup (i_item_id, ca_country, ca_state, ca_county)
29-
order by ca_country,
30-
ca_state,
31-
ca_county,
32-
i_item_id
29+
order by ca_country nulls first,
30+
ca_state nulls first,
31+
ca_county nulls first,
32+
i_item_id nulls first
3333
limit 100;
3434

3535
-- end query 1 in stream 0 using template ../query_templates/query18.tpl

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ select
4848
cd_dep_count,
4949
cd_dep_employed_count,
5050
cd_dep_college_count
51-
order by ca_state,
52-
cd_gender,
53-
cd_marital_status,
54-
cd_dep_count,
55-
cd_dep_employed_count,
56-
cd_dep_college_count
51+
order by ca_state nulls first,
52+
cd_gender nulls first,
53+
cd_marital_status nulls first,
54+
cd_dep_count nulls first,
55+
cd_dep_employed_count nulls first,
56+
cd_dep_college_count nulls first
5757
limit 100;
5858

5959
-- end query 1 in stream 0 using template ../query_templates/query35.tpl

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ select ca_zip, ca_county, sum(ws_sales_price)
1515
and ws_sold_date_sk = d_date_sk
1616
and d_qoy = 1 and d_year = 1998
1717
group by ca_zip, ca_county
18-
order by ca_zip, ca_county
18+
order by ca_zip nulls first, ca_county nulls first
1919
limit 100;
2020

2121
-- end query 1 in stream 0 using template ../query_templates/query45.tpl

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ select c_last_name
2626
where ss_customer_sk = c_customer_sk
2727
and customer.c_current_addr_sk = current_addr.ca_address_sk
2828
and current_addr.ca_city <> bought_city
29-
order by c_last_name
30-
,c_first_name
31-
,ca_city
32-
,bought_city
33-
,ss_ticket_number
29+
order by c_last_name nulls first
30+
,c_first_name nulls first
31+
,ca_city nulls first
32+
,bought_city nulls first
33+
,ss_ticket_number nulls first
3434
limit 100;
3535

3636
-- end query 1 in stream 0 using template ../query_templates/query46.tpl

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ with year_total as (
5656
and t_w_firstyear.year_total > 0::numeric
5757
and case when t_w_firstyear.year_total > 0::numeric then t_w_secyear.year_total / t_w_firstyear.year_total else null::numeric end
5858
> case when t_s_firstyear.year_total > 0::numeric then t_s_secyear.year_total / t_s_firstyear.year_total else null::numeric end
59-
order by 2,1,3
59+
order by 2 nulls first,1 nulls first,3 nulls first
6060
limit 100;
6161

6262
-- end query 1 in stream 0 using template ../query_templates/query74.tpl

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ select
1818
and store.s_number_employees between 200 and 295
1919
group by ss_ticket_number,ss_customer_sk,ss_addr_sk,store.s_city) ms,{{customer}}
2020
where ss_customer_sk = c_customer_sk
21-
order by c_last_name,c_first_name,substr(s_city,1,30), profit
21+
order by c_last_name nulls first,c_first_name nulls first,substr(s_city,1,30) nulls first, profit nulls first
2222
limit 100;
2323

2424
-- end query 1 in stream 0 using template ../query_templates/query79.tpl

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

+16-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,22 @@ with customer_total_return as
2424
and ca_address_sk = c_current_addr_sk
2525
and ca_state = 'TX'
2626
and ctr1.ctr_customer_sk = c_customer_sk
27-
order by c_customer_id,c_salutation,c_first_name,c_last_name,ca_street_number,ca_street_name
28-
,ca_street_type,ca_suite_number,ca_city,ca_county,ca_state,ca_zip,ca_country,ca_gmt_offset
29-
,ca_location_type,ctr_total_return
27+
order by c_customer_id nulls first
28+
,c_salutation nulls first
29+
,c_first_name nulls first
30+
,c_last_name nulls first
31+
,ca_street_number nulls first
32+
,ca_street_name nulls first
33+
,ca_street_type nulls first
34+
,ca_suite_number nulls first
35+
,ca_city nulls first
36+
,ca_county nulls first
37+
,ca_state nulls first
38+
,ca_zip nulls first
39+
,ca_country nulls first
40+
,ca_gmt_offset nulls first
41+
,ca_location_type nulls first
42+
,ctr_total_return nulls first
3043
limit 100;
3144

3245
-- end query 1 in stream 0 using template ../query_templates/query81.tpl

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ group by
2525
,i_class
2626
,i_current_price
2727
order by
28-
i_category
29-
,i_class
30-
,i_item_id
31-
,i_item_desc
32-
,revenueratio;
28+
i_category nulls first
29+
,i_class nulls first
30+
,i_item_id nulls first
31+
,i_item_desc nulls first
32+
,revenueratio nulls first;
3333

3434
-- end query 1 in stream 0 using template ../query_templates/query98.tpl

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ group by
2828
substr(w_warehouse_name,1,20)
2929
,sm_type
3030
,cc_name
31-
order by substr(w_warehouse_name,1,20)
32-
,sm_type
33-
,cc_name
31+
order by substr(w_warehouse_name,1,20) nulls first
32+
,sm_type nulls first
33+
,cc_name nulls first
3434
limit 100;
3535

3636
-- end query 1 in stream 0 using template ../query_templates/query99.tpl

0 commit comments

Comments
 (0)