Skip to content

Commit 2764fa1

Browse files
Added casts to date_dim dates in TCPDS queries (#4060)
1 parent 8b2c38b commit 2764fa1

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
-- NB: Subquerys
44
$week_seq = (select d_week_seq
55
from {{date_dim}} as date_dim
6-
where d_date = cast('1998-02-21' as date));
6+
where cast(d_date as date) = cast('1998-02-21' as date));
77
$ss_items =
88
(select item.i_item_id item_id
99
,sum(ss_ext_sales_price) ss_item_rev

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ $sr_items =
1414
where d_week_seq in
1515
(select d_week_seq
1616
from {{date_dim}} as date_dim
17-
where d_date in (cast('2000-06-17' as date),cast('2000-08-22' as date),cast('2000-11-17' as date))))
17+
where cast(d_date as date) in (cast('2000-06-17' as date),cast('2000-08-22' as date),cast('2000-11-17' as date))))
1818
and sr_returned_date_sk = d_date_sk
1919
group by item.i_item_id);
2020
$cr_items =
@@ -30,7 +30,7 @@ $sr_items =
3030
where d_week_seq in
3131
(select d_week_seq
3232
from {{date_dim}} as date_dim
33-
where d_date in (cast('2000-06-17' as date),cast('2000-08-22' as date),cast('2000-11-17' as date))))
33+
where cast(d_date as date) in (cast('2000-06-17' as date),cast('2000-08-22' as date),cast('2000-11-17' as date))))
3434
and cr_returned_date_sk = d_date_sk
3535
group by item.i_item_id);
3636
$wr_items =
@@ -46,7 +46,7 @@ $wr_items =
4646
where d_week_seq in
4747
(select d_week_seq
4848
from {{date_dim}} as date_dim
49-
where d_date in (cast('2000-06-17' as date),cast('2000-08-22' as date),cast('2000-11-17' as date))))
49+
where cast(d_date as date) in (cast('2000-06-17' as date),cast('2000-08-22' as date),cast('2000-11-17' as date))))
5050
and wr_returned_date_sk = d_date_sk
5151
group by item.i_item_id);
5252
-- start query 1 in stream 0 using template query83.tpl and seed 1930872976

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
$bla1 = (select distinct
55
COALESCE(c_last_name,'') as c_last_name,
66
COALESCE(c_first_name,'') as c_first_name,
7-
COALESCE(d_date, cast(0 as Date)) as d_date
7+
COALESCE(cast(d_date as date), cast(0 as Date)) as d_date
88
from {{store_sales}} as store_sales
99
cross join {{date_dim}} as date_dim
1010
cross join {{customer}} as customer
@@ -15,7 +15,7 @@ $bla1 = (select distinct
1515
$bla2 = ((select distinct
1616
COALESCE(c_last_name,'') as c_last_name,
1717
COALESCE(c_first_name,'') as c_first_name,
18-
COALESCE(d_date, cast(0 as Date)) as d_date
18+
COALESCE(cast(d_date as date), cast(0 as Date)) as d_date
1919
from {{catalog_sales}} as catalog_sales
2020
cross join {{date_dim}} as date_dim
2121
cross join {{customer}} as customer
@@ -26,7 +26,7 @@ $bla2 = ((select distinct
2626
(select distinct
2727
COALESCE(c_last_name,'') as c_last_name,
2828
COALESCE(c_first_name,'') as c_first_name,
29-
COALESCE(d_date, cast(0 as Date)) as d_date
29+
COALESCE(cast(d_date as date), cast(0 as Date)) as d_date
3030
from {{web_sales}} as web_sales
3131
cross join {{date_dim}} as date_dim
3232
cross join {{customer}} as customer

0 commit comments

Comments
 (0)