Created
June 7, 2019 21:22
-
-
Save kgorman/a921e3f2fa1595c4a6a349a77465a92d to your computer and use it in GitHub Desktop.
sample fraud query
This file contains hidden or 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
-- fraud processing on a stream of auths from a point of sale | |
SELECT card, | |
MAX(amount) as max_amount, | |
TUMBLE_END(eventTimestamp, interval '5' minute) as ts, | |
lat, | |
lon | |
FROM auth | |
GROUP BY card, TUMBLE(eventTimestamp, interval '5' minute) | |
HAVING COUNT(*) > 4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment