Skip to content

Instantly share code, notes, and snippets.

Avatar

Paul Rossman paulrossman

View GitHub Profile
@paulrossman
paulrossman / forkcount.sql
Created Oct 20, 2015
BigQuery sql for GitHub Archive dataset: fork count per repo
View forkcount.sql
/* fork count per repo */
SELECT
REGEXP_REPLACE(repo.name, 'MyOrg/', '') AS repo,
COUNT (*) AS cnt
FROM (
SELECT
type,
repo.name,
FROM
@paulrossman
paulrossman / issuelatency.sql
Created Oct 20, 2015
BigQuery sql for GitHub Archive dataset: issue close latency for issues opened after 2015-01-01 @ 00:00:00 UTC and closed before 2015-01-31
View issuelatency.sql
/* issue close latency for issues opened after 2015-01-01 @ 00:00:00 UTC and closed before 2015-01-31 */
SELECT
REGEXP_REPLACE(repo.name, 'MyOrg/', '') AS repo,
CEIL((closed_at-created_at)/86400) AS latency,
FROM (
SELECT
type,
repo.name,
JSON_EXTRACT(payload, '$.action') AS event,