tweak(): making the active_users_aggregates checks more lenient (#4714)

* making the active_users_aggregates checks more lenient

* reformated sql generator templates for active users checks

* implementing lucia-vargas-a feedback from PR#4714
This commit is contained in:
kik-kik 2023-12-15 16:12:52 +01:00 коммит произвёл GitHub
Родитель 85216b9c2a
Коммит b7b0fbab5e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 48 добавлений и 8 удалений

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

@ -94,8 +94,18 @@ live_table_qdau_count AS (
)
SELECT
IF(
(SELECT * FROM live_table_qdau_count) <> (SELECT * FROM qdau_sum),
ERROR("QDAU mismatch between aggregates table and live table"),
ABS((SELECT * FROM qdau_sum) - (SELECT * FROM live_table_qdau_count)) > 10,
ERROR(
CONCAT(
"QDAU mismatch between the live (`telemetry_live.main_v5`) and active_users_aggregates (`{{ dataset_id }}.{{ table_name }}`) tables is greated than 10.",
" Live table count: ",
(SELECT * FROM live_table_qdau_count),
" | active_users_aggregates (QDAU): ",
(SELECT * FROM qdau_sum),
" | Delta detected: ",
ABS((SELECT * FROM qdau_sum) - (SELECT * FROM live_table_qdau_count))
)
),
NULL
);
@ -142,8 +152,18 @@ distinct_client_count AS (
)
SELECT
IF(
ABS((SELECT * FROM dau_sum) - (SELECT * FROM distinct_client_count)) > 1,
ERROR("DAU mismatch between aggregates table and live table"),
ABS((SELECT * FROM dau_sum) - (SELECT * FROM distinct_client_count)) > 10,
ERROR(
CONCAT(
"DAU mismatch between the live (`telemetry_live.main_v5`) and active_users_aggregates (`{{ dataset_id }}.{{ table_name }}`) tables is greated than 10.",
" Live table count: ",
(SELECT * FROM distinct_client_count),
" | active_users_aggregates (DAU): ",
(SELECT * FROM dau_sum),
" | Delta detected: ",
ABS((SELECT * FROM dau_sum) - (SELECT * FROM distinct_client_count))
)
),
NULL
);

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

@ -121,8 +121,18 @@ distinct_client_count AS (
)
SELECT
IF(
ABS((SELECT * FROM dau_sum) - (SELECT * FROM distinct_client_count)) > 1,
ERROR("DAU mismatch between aggregates table and live table"),
ABS((SELECT * FROM dau_sum) - (SELECT * FROM distinct_client_count)) > 10,
ERROR(
CONCAT(
"DAU mismatch between the firefox_ios live (`org_mozilla_firefox_live`, `org_mozilla_fenix_live.baseline_v1`,`org_mozilla_firefox_beta_live.baseline_v1`,`org_mozilla_fenix_nightly_live.baseline_v1`, `org_mozilla_fennec_aurora_live.baseline_v1`) and active_users_aggregates (`fenix_derived.active_users_aggregates_v2`) tables is greated than 10.",
" Live table count: ",
(SELECT * FROM distinct_client_count),
" | active_users_aggregates (DAU): ",
(SELECT * FROM dau_sum),
" | Delta detected: ",
ABS((SELECT * FROM dau_sum) - (SELECT * FROM distinct_client_count))
)
),
NULL
);

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

@ -43,7 +43,17 @@ distinct_client_count AS (
)
SELECT
IF(
(SELECT * FROM dau_sum) <> (SELECT * FROM distinct_client_count),
ERROR("DAU mismatch between aggregates table and live table"),
ABS((SELECT * FROM dau_sum) - (SELECT * FROM distinct_client_count)) > 10,
ERROR(
CONCAT(
"DAU mismatch between the {{ app_name }} live across all channels ({%- for channel in channels %}{{ channel.table }},{% endfor -%}) and active_users_aggregates ({%- raw %}`{{ dataset_id }}.{{ table_name }}`{%- endraw %}) tables is greated than 10.",
" Live table count: ",
(SELECT * FROM distinct_client_count),
" | active_users_aggregates (DAU): ",
(SELECT * FROM dau_sum),
" | Delta detected: ",
ABS((SELECT * FROM dau_sum) - (SELECT * FROM distinct_client_count))
)
),
NULL
);