five9/definitions/assertions/calls_data_freshness.sqlx

9 lines
330 B
Plaintext

config {
type: "assertion",
tags: ["calls"] }
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