Last active
December 13, 2016 07:48
-
-
Save eriwen/5db2a6f92f20d15e5f284853fe376203 to your computer and use it in GitHub Desktop.
GitHub Archive stats for new Gradle and Maven repos over time
This file contains 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
SELECT | |
CONCAT(STRING(YEAR(create_date)), LPAD(STRING(MONTH(create_date)), 2, '0')) AS create_month, | |
COUNT(DISTINCT project_name) | |
FROM ( | |
SELECT | |
create_date, | |
LAST(SPLIT(repo_name, '/')) AS project_name -- (avoid forks) | |
FROM ( | |
SELECT | |
repo_name, | |
MIN(committer.date) AS create_date | |
FROM | |
FLATTEN([bigquery-public-data:github_repos.commits],repo_name) | |
WHERE | |
repo_name IN ( | |
SELECT | |
repo_name | |
FROM | |
[bigquery-public-data:github_repos.files] | |
WHERE | |
path = 'build.gradle' | |
GROUP BY | |
repo_name) | |
GROUP BY | |
repo_name) AS t) | |
WHERE | |
create_date >= '2012-01-01 00:00' | |
GROUP BY | |
1 | |
ORDER BY | |
1 |
This file contains 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
SELECT | |
CONCAT(STRING(YEAR(create_date)), LPAD(STRING(MONTH(create_date)), 2, '0')) AS create_month, | |
COUNT(DISTINCT project_name) | |
FROM ( | |
SELECT | |
create_date, | |
LAST(SPLIT(repo_name, '/')) AS project_name -- (avoid forks) | |
FROM ( | |
SELECT | |
repo_name, | |
MIN(committer.date) AS create_date | |
FROM | |
FLATTEN([bigquery-public-data:github_repos.commits],repo_name) | |
WHERE | |
repo_name IN ( | |
SELECT | |
repo_name | |
FROM | |
[bigquery-public-data:github_repos.files] | |
WHERE | |
path = 'pom.xml' | |
GROUP BY | |
repo_name) | |
GROUP BY | |
repo_name) AS t) | |
WHERE | |
create_date >= '2012-01-01 00:00' | |
GROUP BY | |
1 | |
ORDER BY | |
1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Charted via Google Sheets: https://docs.google.com/a/eriwen.com/spreadsheets/d/14d_xpVB7erPhcZ3ZxW0hIQkZ3x995mYB0Q-RD6sbcvo/edit?usp=sharing