Skip to content

Commit 05549e1

Browse files
authored
Comparison tpcds yql/pg (#4502)
1 parent d102931 commit 05549e1

File tree

12 files changed

+15
-15
lines changed

12 files changed

+15
-15
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ union all
111111
order by t_s_secyear.customer_id
112112
,t_s_secyear.customer_first_name
113113
,t_s_secyear.customer_last_name
114-
,t_s_secyear.customer_email_address
114+
,t_s_secyear.customer_birth_country
115115
limit 100;
116116

117117
-- end query 1 in stream 0 using template ../query_templates/query4.tpl

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ select i_item_id,
1111
cs_bill_cdemo_sk = cd_demo_sk and
1212
cs_promo_sk = p_promo_sk and
1313
cd_gender = 'F' and
14-
cd_marital_status = 'W' and
14+
cd_marital_status = 'S' and
1515
cd_education_status = 'College' and
1616
(p_channel_email = 'N' or p_channel_event = 'N') and
1717
d_year = 1998

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ select
3434
) as sub
3535
order by
3636
lochierarchy desc
37-
,case when lochierarchy = 0 then s_state end
37+
,case when lochierarchy = 0 then s_state else null end nulls first
3838
,rank_within_parent
3939
limit 100;
4040

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ select customer_address.ca_zip
1515
cross join {{date_dim}} as date_dim
1616
where cs_bill_customer_sk = c_customer_sk
1717
and c_current_addr_sk = ca_address_sk
18-
and ( substring(cast(ca_zip as string),1,5) in ('85669', '86197','88274','83405','86475',
18+
and ( substring(cast(ca_zip as string),0,5) in ('85669', '86197','88274','83405','86475',
1919
'85392', '85460', '80348', '81792')
2020
or ca_state in ('CA','WA','GA')
2121
or cs_sales_price > 500)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ select item.i_brand_id brand_id, item.i_brand brand, item.i_manufact_id, item.i
1717
and d_year=1998
1818
and ss_customer_sk = c_customer_sk
1919
and c_current_addr_sk = ca_address_sk
20-
and substring(cast(ca_zip as string),1,5) <> substring(cast(s_zip as string),1,5)
20+
and substring(cast(ca_zip as string),0,5) <> substring(cast(s_zip as string),0,5)
2121
and ss_store_sk = s_store_sk
2222
group by item.i_brand
2323
,item.i_brand_id

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
-- NB: Subquerys
44
$blabla = (
5-
select substring(cast(item.i_item_desc as string),1,30) itemdesc,item.i_item_sk item_sk,date_dim.d_date solddate
5+
select substring(cast(item.i_item_desc as string),0,30) itemdesc,item.i_item_sk item_sk,date_dim.d_date solddate
66
from {{store_sales}} as store_sales
77
cross join {{date_dim}} as date_dim
88
cross join {{item}} as item

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ select customer_address.ca_zip, customer_address.ca_county, sum(ws_sales_price)
1111
where ws_bill_customer_sk = c_customer_sk
1212
and c_current_addr_sk = ca_address_sk
1313
and ws_item_sk = i_item_sk
14-
and ( substring(cast(ca_zip as string),1,5) in ('85669', '86197','88274','83405','86475', '85392', '85460', '80348', '81792')
14+
and ( substring(cast(ca_zip as string),0,5) in ('85669', '86197','88274','83405','86475', '85392', '85460', '80348', '81792')
1515
or
1616
i_item_id in (select i_item_id
1717
from {{item}} as item

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ and ws_warehouse_sk = w_warehouse_sk
2727
and ws_ship_mode_sk = sm_ship_mode_sk
2828
and ws_web_site_sk = web_site_sk
2929
group by
30-
substring(cast(w_warehouse_name as string),1,20) as bla
30+
substring(cast(w_warehouse_name as string),0,20) as bla
3131
,ship_mode.sm_type
3232
,web_site.web_name
3333
order by bla

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
-- NB: Subquerys
44
-- start query 1 in stream 0 using template query79.tpl and seed 2031708268
55
select
6-
c_last_name,c_first_name,substring(cast(s_city as string),1,30) bla,ss_ticket_number,amt,profit
6+
c_last_name,c_first_name,substring(cast(s_city as string),0,30) bla,ss_ticket_number,amt,profit
77
from
88
(select store_sales.ss_ticket_number ss_ticket_number
99
,store_sales.ss_customer_sk ss_customer_sk

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{% include 'header.sql.jinja' %}
22

33
-- NB: Subquerys
4-
$bla1 = ( SELECT substring(cast(ca_zip as string),1,5) AS ca_zip
4+
$bla1 = ( SELECT substring(cast(ca_zip as string),0,5) AS ca_zip
55
FROM {{customer_address}}
6-
WHERE substring(cast(ca_zip as string),1,5) IN (
6+
WHERE substring(cast(ca_zip as string),0,5) IN (
77
'47602','16704','35863','28577','83910','36201',
88
'58412','48162','28055','41419','80332',
99
'38607','77817','24891','16226','18410',
@@ -85,7 +85,7 @@ $bla1 = ( SELECT substring(cast(ca_zip as string),1,5) AS ca_zip
8585
'28239','58032','18884','16791','21343',
8686
'97462','18569','75660','15475'));
8787
$bla2 = (select A1.ca_zip as ca_zip
88-
from (SELECT substring(cast(customer_address.ca_zip as string),1,5) ca_zip,count(*) cnt
88+
from (SELECT substring(cast(customer_address.ca_zip as string),0,5) ca_zip,count(*) cnt
8989
FROM {{customer_address}} as customer_address
9090
cross join {{customer}} as customer
9191
WHERE ca_address_sk = c_current_addr_sk and
@@ -107,7 +107,7 @@ select store.s_store_name
107107
where ss_store_sk = s_store_sk
108108
and ss_sold_date_sk = d_date_sk
109109
and d_qoy = 2 and d_year = 1998
110-
and (substring(cast(s_zip as string),1,2) = substring(V1.ca_zip,1,2))
110+
and (substring(cast(s_zip as string),0,2) = substring(V1.ca_zip,0,2))
111111
group by store.s_store_name
112112
order by store.s_store_name
113113
limit 100;

0 commit comments

Comments
 (0)