Skip to content

Instantly share code, notes, and snippets.

@up1
Created February 12, 2015 04:54
Show Gist options
  • Save up1/b83f0613516155201e34 to your computer and use it in GitHub Desktop.
Save up1/b83f0613516155201e34 to your computer and use it in GitHub Desktop.
Demo :: Google BigQuery
select
repository_language,
type,
count(distinct(repository_url)) as active_repos_by_url,
count(repository_language) as events,
YEAR(created_at) as year,
QUARTER(created_at) as quarter
from [githubarchive:github.timeline]
where
(
type = 'PushEvent'
OR type = 'ForkEvent'
OR (type = 'IssuesEvent' AND (payload_action="opened" OR payload_action=="reopened"))
OR (type = 'CreateEvent' AND payload_ref_type="repository")
OR type = 'WatchEvent'
)
AND repository_language !=''
AND repository_url != ''
AND YEAR(created_at)= 2014
AND QUARTER(created_at)=4
group by
repository_language,
type,
year,
quarter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment