diff --git a/definitions/assertions/calls_data_freshness.sqlx b/definitions/assertions/calls_data_freshness.sqlx new file mode 100644 index 0000000..7e94917 --- /dev/null +++ b/definitions/assertions/calls_data_freshness.sqlx @@ -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 \ No newline at end of file diff --git a/definitions/assertions/digital_data_freshness.sqlx b/definitions/assertions/digital_data_freshness.sqlx new file mode 100644 index 0000000..d7d619a --- /dev/null +++ b/definitions/assertions/digital_data_freshness.sqlx @@ -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 \ No newline at end of file