diff --git a/definitions/assertions/agent_status_data_freshness.sqlx b/definitions/assertions/agent_status_data_freshness.sqlx index 2684cea..856dfa3 100644 --- a/definitions/assertions/agent_status_data_freshness.sqlx +++ b/definitions/assertions/agent_status_data_freshness.sqlx @@ -6,4 +6,5 @@ select * from( select max(timestamp) max_timestamp from ${ref("pphe_five9_raw","agent_status_*")} 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 +where TIMESTAMP_DIFF(max_timestamp, TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 1 DAY), hour) < 0 +or max_timestamp is null \ No newline at end of file diff --git a/definitions/assertions/calls_data_freshness.sqlx b/definitions/assertions/calls_data_freshness.sqlx index c9a9145..c1519dd 100644 --- a/definitions/assertions/calls_data_freshness.sqlx +++ b/definitions/assertions/calls_data_freshness.sqlx @@ -6,4 +6,5 @@ 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 +where TIMESTAMP_DIFF(max_timestamp, TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 1 DAY), hour) < 0 +or max_timestamp is null \ No newline at end of file diff --git a/definitions/assertions/csc_rev_data_freshness.sqlx b/definitions/assertions/csc_rev_data_freshness.sqlx index 0359c6e..0b905fa 100644 --- a/definitions/assertions/csc_rev_data_freshness.sqlx +++ b/definitions/assertions/csc_rev_data_freshness.sqlx @@ -6,4 +6,5 @@ select * from( select max(CHANGE_DATE) MAX_CHANGE_DATE from ${ref("pphe_five9_raw","csc_rev_changes_*")} where _TABLE_SUFFIX = FORMAT_DATE('%Y%m%d',current_date("Europe/Amsterdam"))) -where TIMESTAMP_DIFF(safe_cast(MAX_CHANGE_DATE as timestamp), TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 1 DAY), hour) < 0 \ No newline at end of file +where TIMESTAMP_DIFF(safe_cast(MAX_CHANGE_DATE as timestamp), TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 1 DAY), hour) < 0 +or MAX_CHANGE_DATE is null \ No newline at end of file diff --git a/definitions/assertions/digital_data_freshness.sqlx b/definitions/assertions/digital_data_freshness.sqlx index e38b5c5..cc431fb 100644 --- a/definitions/assertions/digital_data_freshness.sqlx +++ b/definitions/assertions/digital_data_freshness.sqlx @@ -6,4 +6,5 @@ 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 +where TIMESTAMP_DIFF(max_timestamp, TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 1 DAY), hour) < 0 +or max_timestamp is null \ No newline at end of file