This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#standardsql | |
WITH all_spams_fides AS ( | |
SELECT DISTINCT requestId, | |
FIRST_VALUE(vrd.score) OVER (PARTITION BY requestId ORDER BY vrd.score DESC) as score, | |
is_admin_deleted | |
FROM mi.fides_events_nrt n, UNNEST(verifierData) as vrd | |
INNER JOIN a.mts_requests r ON r.request_id = requestId | |
WHERE (n._PARTITIONTIME >= '2017-09-21' OR n._PARTITIONTIME IS NULL) | |
AND time > 1506034800000 |