From 10d7002b95278395abd93d21a1dad95f34f0af01 Mon Sep 17 00:00:00 2001 From: Sean Rose <1994030+sean-rose@users.noreply.github.com> Date: Tue, 23 Jan 2024 08:14:29 -0800 Subject: [PATCH] Look for additional FxA deletion events (DENG-2422). (#4870) --- .../fxa_delete_events_v2/query.sql | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sql/moz-fx-data-shared-prod/firefox_accounts_derived/fxa_delete_events_v2/query.sql b/sql/moz-fx-data-shared-prod/firefox_accounts_derived/fxa_delete_events_v2/query.sql index 6220db9d2b..25238b2824 100644 --- a/sql/moz-fx-data-shared-prod/firefox_accounts_derived/fxa_delete_events_v2/query.sql +++ b/sql/moz-fx-data-shared-prod/firefox_accounts_derived/fxa_delete_events_v2/query.sql @@ -11,7 +11,7 @@ WITH hmac_key AS ( key_id = 'fxa_hmac_prod' ) SELECT - `timestamp` AS submission_timestamp, + MIN(`timestamp`) AS submission_timestamp, TO_HEX(SHA256(jsonPayload.fields.uid)) AS user_id, TO_HEX( udf.hmac_sha256((SELECT * FROM hmac_key), CAST(jsonPayload.fields.uid AS BYTES)) @@ -25,6 +25,10 @@ WHERE AND DATE_ADD(@submission_date, INTERVAL 1 DAY) ) AND DATE(`timestamp`) = @submission_date - AND jsonPayload.type = 'activityEvent' - AND jsonPayload.fields.event = 'account.deleted' + AND ( + jsonPayload.type IN ('accountDeleted', 'accountDeleted.byRequest', 'DB.deleteAccount') + OR (jsonPayload.type = 'activityEvent' AND jsonPayload.fields.event = 'account.deleted') + ) AND jsonPayload.fields.uid IS NOT NULL +GROUP BY + jsonPayload.fields.uid