Created
May 1, 2016 06:08
-
-
Save mbergal/7aac30619884c0aaacb9d73b8c04f729 to your computer and use it in GitHub Desktop.
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
SELECT structPayload.sessionId, SUM(failures) failures, SUM(restores) restores | |
FROM | |
( | |
SELECT | |
structPayload.sessionId, | |
CASE WHEN structPayload.event = 'failure' THEN 1 | |
ELSE 0 END as failures, | |
CASE WHEN structPayload.event = 'restored' THEN 1 | |
ELSE 0 END as restores | |
FROM [aaa.aaaaa_20160501] | |
WHERE metadata.labels.value = 'express' | |
ORDER BY metadata.timestamp desc LIMIT 1000 | |
) a | |
GROUP BY structPayload.sessionId |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment