Skip to content

Commit a95c38d

Browse files
committed
feat: add replace by spillover date task example
1 parent ea739f0 commit a95c38d

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[DESTINATION]
2+
PROJECT="g-project"
3+
DATASET="playground"
4+
TABLE="test_booking_count"
5+
6+
[TRANSFORMATION]
7+
TASK_WINDOW="DAILY"
8+
TIMEZONE="Asia/Jakarta"
9+
USE_SPILLOVER="TRUE"
10+
CONCURRENCY=5
11+
12+
[LOAD]
13+
LOAD_METHOD="REPLACE"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
select
2+
TIMESTAMP('__dstart__') as dstart,
3+
TIMESTAMP('__dend__') as dend,
4+
"beerus" as hakai,
5+
"naruto" as rasengan,
6+
CAST("__execution_time__" AS TIMESTAMP) as `load_timestamp`
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
SELECT
2+
date
3+
FROM
4+
`g-project.playground.calendar_date`
5+
-- this query will generate 14 calendar dates which we will replace 14 partitions using the main query
6+
WHERE date >= DATE_SUB('__dstart__', INTERVAL 14 DAY)
7+
AND date < '__dend__'
8+
ORDER BY date

0 commit comments

Comments
 (0)