Skip to content

Instantly share code, notes, and snippets.

@apa512
Created April 20, 2016 17:59
Show Gist options
  • Save apa512/9c5e4306093e29e6b81915452dafddb3 to your computer and use it in GitHub Desktop.
Save apa512/9c5e4306093e29e6b81915452dafddb3 to your computer and use it in GitHub Desktop.
SELECT email
FROM (
SELECT
JSON_EXTRACT(payload, '$.commits'),
REGEXP_EXTRACT(
SPLIT(
JSON_EXTRACT(payload, '$.commits'),
'},{'
),
r'email":([^,]+),'
)
AS email
FROM [githubarchive:month.201501]
WHERE type = 'PushEvent'
)
GROUP BY
email
LIMIT 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment