Skip to content

Instantly share code, notes, and snippets.

@mesaugat
Last active September 5, 2017 16:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mesaugat/291bdad97c1360a908e307538e78f136 to your computer and use it in GitHub Desktop.
Save mesaugat/291bdad97c1360a908e307538e78f136 to your computer and use it in GitHub Desktop.
--
-- Most unique commits per user from Jan 2016 to March 2017
--
-- https://bigquery.cloud.google.com/savedquery/39178653524:e4b670a18035460792b0554983dde6ad
--
SELECT
u.login AS login,
u.location AS location,
COUNT(c.id) AS num_commits
FROM
[ghtorrent-bq.ght_2017_04_01.commits] c
JOIN (
SELECT
login,
location,
id
FROM
[ghtorrent-bq.ght_2017_04_01.users]
WHERE
country_code = 'np') u
ON
c.author_id = u.id,
WHERE
DATE(created_at) BETWEEN DATE('2016-01-01')
AND DATE('2017-04-01')
GROUP BY
login,
location
ORDER BY
num_commits DESC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment