File size: 1,980 Bytes
085e000 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
SELECT commit, old_file, new_file, subject, message, unnested_repo_name
FROM (
SELECT commit, d.old_path old_file, d.new_path new_file, subject, message, unnested_repo_name
FROM (
SELECT *
FROM (
SELECT *, ROW_NUMBER()OVER(PARTITION BY commit) AS RN
FROM (
SELECT
repo_name,
lang.name AS language_name
FROM
`bigquery-public-data.github_repos.languages` AS lang_table,
UNNEST(LANGUAGE) AS lang) lang_table
JOIN
`bigquery-public-data.github_repos.licenses` AS license_table
ON
license_table.repo_name = lang_table.repo_name
JOIN (
SELECT
*
FROM
`bigquery-public-data.github_repos.commits` AS commits_table,
UNNEST(repo_name) AS unnested_repo_name
LIMIT 10000) commits_table
ON
commits_table.unnested_repo_name = lang_table.repo_name
WHERE
((license_table.license LIKE 'mit')
OR (license_table.license LIKE 'artistic-2.0')
OR (license_table.license LIKE 'isc')
OR (license_table.license LIKE 'cc0-1.0')
OR (license_table.license LIKE 'apache-2.0')
OR (license_table.license LIKE 'unlicense')
OR (license_table.license LIKE 'bsd-3-clause')
OR (license_table.license LIKE 'bsd-2-clause'))
AND (
LENGTH(commits_table.message) > 10
)
AND (
LENGTH(commits_table.message) < 10000
)
AND commits_table.message NOT IN (
'update readme.md', 'initial commit', 'update', 'Mirroring from micro.blog.', 'update data.json', 'update data.js', 'add files via upload', 'update readme', "Can't you see I'm updating the time?", 'pi push', 'dummy', 'update index.html', 'first commit', 'create readme.md', 'heartbeat update', 'updated readme', 'update log', 'test', 'no message', 'readme', 'wip', 'updates', 'commit', 'update _config.yaml'
)
AND commits_table.message not like 'Merge%')
WHERE RN = 1), UNNEST(difference) as d
WHERE (d.old_path = d.new_path) AND (d.old_path IS NOT NULL) AND (d.new_path IS NOT NULL)
)
GROUP BY commit, old_file, new_file, subject, message, unnested_repo_name
HAVING COUNT(commit) = 1
|