Commit
·
bcd373e
1
Parent(s):
965c302
Add script
Browse files
query.sql
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
SELECT
|
| 2 |
+
*
|
| 3 |
+
FROM (
|
| 4 |
+
SELECT
|
| 5 |
+
repo_name,
|
| 6 |
+
lang.name AS language_name
|
| 7 |
+
FROM
|
| 8 |
+
`bigquery-public-data.github_repos.languages` AS lang_table,
|
| 9 |
+
UNNEST(LANGUAGE) AS lang) lang_table
|
| 10 |
+
JOIN
|
| 11 |
+
`bigquery-public-data.github_repos.licenses` AS license_table
|
| 12 |
+
ON
|
| 13 |
+
license_table.repo_name = lang_table.repo_name
|
| 14 |
+
JOIN (
|
| 15 |
+
SELECT
|
| 16 |
+
*
|
| 17 |
+
FROM
|
| 18 |
+
`bigquery-public-data.github_repos.commits` AS commits_table,
|
| 19 |
+
UNNEST(repo_name) AS unnested_repo_name) commits_table
|
| 20 |
+
ON
|
| 21 |
+
commits_table.unnested_repo_name = lang_table.repo_name
|
| 22 |
+
WHERE
|
| 23 |
+
((license_table.license LIKE 'mit')
|
| 24 |
+
OR (license_table.license LIKE 'artistic-2.0')
|
| 25 |
+
OR (license_table.license LIKE 'isc')
|
| 26 |
+
OR (license_table.license LIKE 'cc0-1.0')
|
| 27 |
+
OR (license_table.license LIKE 'apache-2.0')
|
| 28 |
+
OR (license_table.license LIKE 'unlicense')
|
| 29 |
+
OR (license_table.license LIKE 'bsd-3-clause')
|
| 30 |
+
OR (license_table.license LIKE 'bsd-2-clause'));
|