Skip to content

Instantly share code, notes, and snippets.

@igrigorik
Last active January 17, 2020 05:23
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igrigorik/90fab69946d27842882c to your computer and use it in GitHub Desktop.
Save igrigorik/90fab69946d27842882c to your computer and use it in GitHub Desktop.
/* count of issues opened, closed, and reopened on 2019/01/01 */
SELECT event as issue_status, COUNT(*) as cnt FROM (
SELECT type, repo.name, actor.login,
JSON_EXTRACT(payload, '$.action') as event,
FROM `githubarchive.day.20190101`
WHERE type = 'IssuesEvent'
)
GROUP by issue_status;
@jasonhall-at-google
Copy link

It might be useful to fully-specify the table name, e.g., [githubarchive:day.events_]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment