five9/definitions/assertions/digital_data_freshness.sqlx

7 lines
304 B
Plaintext

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