Muennighoff
commited on
Commit
·
c4c812d
1
Parent(s):
085e000
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
SQL queries executed one-by-one. They're split up as BigQuery was raising `Resources exceeded during query execution` when running all in one.
|
4 |
+
|
5 |
+
```sql
|
6 |
+
SELECT
|
7 |
+
commit, difference, subject, message, unnested_repo_name
|
8 |
+
FROM (
|
9 |
+
SELECT
|
10 |
+
repo_name,
|
11 |
+
lang.name AS language_name
|
12 |
+
FROM
|
13 |
+
`bigquery-public-data.github_repos.languages` AS lang_table,
|
14 |
+
UNNEST(LANGUAGE) AS lang) lang_table
|
15 |
+
JOIN
|
16 |
+
`bigquery-public-data.github_repos.licenses` AS license_table
|
17 |
+
ON
|
18 |
+
license_table.repo_name = lang_table.repo_name
|
19 |
+
JOIN (
|
20 |
+
SELECT
|
21 |
+
*
|
22 |
+
FROM
|
23 |
+
`bigquery-public-data.github_repos.commits` AS commits_table,
|
24 |
+
UNNEST(repo_name) AS unnested_repo_name) commits_table
|
25 |
+
ON
|
26 |
+
commits_table.unnested_repo_name = lang_table.repo_name
|
27 |
+
|
28 |
+
|
29 |
+
WHERE
|
30 |
+
((license_table.license LIKE 'mit')
|
31 |
+
OR (license_table.license LIKE 'artistic-2.0')
|
32 |
+
OR (license_table.license LIKE 'isc')
|
33 |
+
OR (license_table.license LIKE 'cc0-1.0')
|
34 |
+
OR (license_table.license LIKE 'epl-1.0')
|
35 |
+
OR (license_table.license LIKE 'mpl-2.0')
|
36 |
+
OR (license_table.license LIKE 'unlicense')
|
37 |
+
OR (license_table.license LIKE 'apache-2.0')
|
38 |
+
OR (license_table.license LIKE 'bsd-3-clause')
|
39 |
+
OR (license_table.license LIKE 'agpl-3.0')
|
40 |
+
OR (license_table.license LIKE 'lgpl-2.1')
|
41 |
+
OR (license_table.license LIKE 'bsd-2-clause'))
|
42 |
+
AND ( (lang_table.language_name LIKE 'Python')
|
43 |
+
OR (lang_table.language_name LIKE 'Java')
|
44 |
+
OR (lang_table.language_name LIKE 'JavaScript')
|
45 |
+
OR (lang_table.language_name LIKE 'HTML')
|
46 |
+
OR (lang_table.language_name LIKE 'Common Lisp')
|
47 |
+
OR (lang_table.language_name LIKE 'Shell')
|
48 |
+
OR (lang_table.language_name LIKE 'R')
|
49 |
+
OR (lang_table.language_name LIKE 'Perl%')
|
50 |
+
OR (lang_table.language_name LIKE 'SQL')
|
51 |
+
OR (lang_table.language_name LIKE 'C')
|
52 |
+
OR (lang_table.language_name LIKE 'C#')
|
53 |
+
OR (lang_table.language_name LIKE 'C++')
|
54 |
+
OR (lang_table.language_name LIKE 'TypeScript')
|
55 |
+
OR (lang_table.language_name LIKE 'Go')
|
56 |
+
OR (lang_table.language_name LIKE 'Rust')
|
57 |
+
OR (lang_table.language_name LIKE 'Swift')
|
58 |
+
OR (lang_table.language_name LIKE 'PHP')
|
59 |
+
OR (lang_table.language_name LIKE 'Dart')
|
60 |
+
OR (lang_table.language_name LIKE 'Kotlin')
|
61 |
+
OR (lang_table.language_name LIKE 'Matlab')
|
62 |
+
OR (lang_table.language_name LIKE 'MATLAB')
|
63 |
+
OR (lang_table.language_name LIKE 'Ruby') )
|
64 |
+
AND ( (LENGTH(commits_table.message) > 10) );
|
65 |
+
```
|
66 |
+
|
67 |
+
```sql
|
68 |
+
SELECT commit, subject, message, STRING_AGG(unnested_repo_name) AS repos
|
69 |
+
FROM `huggingface-ml.commits_table_24122022.commits_table_base`
|
70 |
+
GROUP BY commit, subject, message
|
71 |
+
```
|
72 |
+
|
73 |
+
```sql
|
74 |
+
SELECT *
|
75 |
+
FROM (
|
76 |
+
SELECT
|
77 |
+
commit,subject,message,repos,difference
|
78 |
+
FROM
|
79 |
+
`huggingface-ml.commits_table_24122022.commits_table_dedup` AS commits_table_dedup
|
80 |
+
JOIN (
|
81 |
+
SELECT
|
82 |
+
commit AS commit_base,difference
|
83 |
+
FROM
|
84 |
+
`bigquery-public-data.github_repos.commits` AS commits_table_base
|
85 |
+
) commits_table_base
|
86 |
+
ON
|
87 |
+
commits_table_base.commit_base = commits_table_dedup.commit
|
88 |
+
)
|
89 |
+
```
|
90 |
+
|
91 |
+
```sql
|
92 |
+
SELECT
|
93 |
+
commit,subject,message,repos,d.old_path as old_file,d.new_path as new_file
|
94 |
+
FROM
|
95 |
+
`huggingface-ml.commits_table_24122022.commits_table_dedup_difference` AS commits_table,
|
96 |
+
UNNEST(difference) AS d
|
97 |
+
WHERE (d.old_path = d.new_path) AND (d.old_path IS NOT NULL) AND (d.new_path IS NOT NULL)
|
98 |
+
```
|
99 |
+
|
100 |
+
```sql
|
101 |
+
SELECT commit,subject,message,repos,old_file,new_file
|
102 |
+
FROM (
|
103 |
+
(
|
104 |
+
SELECT commit AS commit_base
|
105 |
+
FROM `huggingface-ml.commits_table_24122022.commits_table_dedup_files`
|
106 |
+
GROUP BY commit
|
107 |
+
HAVING COUNT(*) = 1
|
108 |
+
)
|
109 |
+
JOIN (
|
110 |
+
SELECT
|
111 |
+
commit,subject,message,repos,old_file,new_file
|
112 |
+
FROM
|
113 |
+
`huggingface-ml.commits_table_24122022.commits_table_dedup_files` AS commits_table_base
|
114 |
+
) commits_table_base
|
115 |
+
ON commits_table_base.commit = commit_base
|
116 |
+
)
|
117 |
+
```
|
118 |
+
|