Skip to content

Instantly share code, notes, and snippets.

@igrigorik igrigorik/bq.sql
Last active Jun 29, 2016

Embed
What would you like to do?
/* count of issues opened, closed, and reopened between 1/1/2015 and 2/1/2015 */
SELECT event as issue_status, COUNT(*) as cnt FROM (
SELECT type, repo.name, actor.login,
JSON_EXTRACT(payload, '$.action') as event,
FROM (TABLE_DATE_RANGE([githubarchive:day.],
TIMESTAMP('2015-01-01'),
TIMESTAMP('2015-02-01')
))
WHERE type = 'IssuesEvent'
)
GROUP by issue_status;
@jasonhall-at-google

This comment has been minimized.

Copy link

commented Jan 13, 2015

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
You can’t perform that action at this time.