Last active
October 6, 2017 10:04
-
-
Save KrauseFx/6120267014f577c54d649a10f70ed97f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* GitHub query to get the number of comments, PR, releases, etc. for a given GH org */ | |
WITH | |
ProjectData AS (SELECT * FROM `githubarchive.day.2017*` WHERE repo.name LIKE 'fastlane/%'), | |
Actors AS (SELECT DISTINCT(actor.login) AS login FROM ProjectData) | |
SELECT * FROM ( | |
SELECT | |
actors.login, | |
(SELECT COUNT(*) FROM ProjectData WHERE type = 'IssueCommentEvent' AND actor.login = actors.login) AS Comments, | |
(SELECT COUNT(*) FROM ProjectData WHERE type = 'PullRequestEvent' AND actor.login = actors.login) AS PRs, | |
(SELECT COUNT(*) FROM ProjectData WHERE type = 'PullRequestReviewCommentEvent' AND actor.login = actors.login) AS ReviewComments, | |
(SELECT COUNT(*) FROM ProjectData WHERE type = 'ReleaseEvent' AND actor.login = actors.login) AS Releases, | |
(SELECT COUNT(*) FROM ProjectData WHERE type = 'IssuesEvent' AND actor.login = actors.login) AS ClosedRenamedAndLabeledIssues | |
FROM Actors as actors | |
) | |
WHERE PRs > 0 OR Comments > 0 | |
ORDER BY PRs DESC, Comments DESC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment