Add assertion conditions for calls and digital - checking data freshness

This commit is contained in:
Anna Saiapina 2024-07-24 11:10:57 +00:00 committed by GCP Dataform
parent 4bb7cee271
commit 6665749ed6
2 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,7 @@
config { type: "assertion" }
select * from(
select max(timestamp) max_timestamp
from ${ref("pphe_five9_raw","calls_*")}
where _TABLE_SUFFIX = FORMAT_DATE('%Y%m%d',current_date("Europe/Amsterdam")))
where TIMESTAMP_DIFF(max_timestamp, TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 1 DAY), hour) < 0

View File

@ -0,0 +1,7 @@
config { type: "assertion" }
select * from(
select max(timestamp) max_timestamp
from ${ref("pphe_five9_raw","digital_*")}
where _TABLE_SUFFIX = FORMAT_DATE('%Y%m%d',current_date("Europe/Amsterdam")))
where TIMESTAMP_DIFF(max_timestamp, TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 1 DAY), hour) < 0