Add preventative check to ensure clients_first_seen_v2 and _v3 are never run out of order (#6543)

* Add preventative check to ensure this is never run out of order

* Fix table name
This commit is contained in:
Katie Windau 2024-11-20 16:46:55 -06:00 коммит произвёл GitHub
Родитель 65402717f2
Коммит 60fea351c6
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
2 изменённых файлов: 22 добавлений и 2 удалений

Просмотреть файл

@ -3,7 +3,17 @@
-- ping received and respecting NULLS.
-- Once the first_seen_date is identified after comparing all pings, attributes
-- are retrieved for each client_id from the ping type that reported it.
WITH new_profile_ping AS (
WITH error_check AS (
SELECT
IF(
DATE_ADD(MAX(first_seen_date), INTERVAL 1 day) != @submission_date,
ERROR("Need to run sequentially, day after max day only"),
0
) AS result
FROM
`moz-fx-data-shared-prod.telemetry_derived.clients_first_seen_v2`
),
new_profile_ping AS (
SELECT
client_id AS client_id,
sample_id AS sample_id,

Просмотреть файл

@ -3,7 +3,17 @@
-- ping received and respecting NULLS.
-- Once the first_seen_date is identified after comparing all pings, attributes
-- are retrieved for each client_id from the ping type that reported it.
WITH new_profile_ping_agg AS (
WITH error_check AS (
SELECT
IF(
DATE_ADD(MAX(first_seen_date), INTERVAL 1 day) != @submission_date,
ERROR("Need to run sequentially, day after max day only"),
0
) AS result
FROM
`moz-fx-data-shared-prod.telemetry_derived.clients_first_seen_v3`
),
new_profile_ping_agg AS (
SELECT
client_id AS client_id,
sample_id AS sample_id,