Commit
·
1114f13
1
Parent(s):
d4416e0
Update README.md
Browse files
README.md
CHANGED
|
@@ -158,3 +158,173 @@ ON commits_table_base.commit = commit_base
|
|
| 158 |
Then export the final dataset from GCP to a bucket as parquet files.
|
| 159 |
Then copy those parquet files to the hf dataset on an instance.
|
| 160 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 158 |
Then export the final dataset from GCP to a bucket as parquet files.
|
| 159 |
Then copy those parquet files to the hf dataset on an instance.
|
| 160 |
|
| 161 |
+
|
| 162 |
+
|
| 163 |
+
|
| 164 |
+
|
| 165 |
+
|
| 166 |
+
### Redoing it to add licenses
|
| 167 |
+
|
| 168 |
+
|
| 169 |
+
|
| 170 |
+
|
| 171 |
+
Samples: 76674567
|
| 172 |
+
76,674,567
|
| 173 |
+
|
| 174 |
+
|
| 175 |
+
SQL queries executed one-by-one. They're split up as BigQuery was raising `Resources exceeded during query execution` when running all in one.
|
| 176 |
+
|
| 177 |
+
```sql
|
| 178 |
+
SELECT
|
| 179 |
+
commit, difference, subject, message, unnested_repo_name, license
|
| 180 |
+
FROM (
|
| 181 |
+
SELECT
|
| 182 |
+
repo_name,
|
| 183 |
+
lang.name AS language_name
|
| 184 |
+
FROM
|
| 185 |
+
`bigquery-public-data.github_repos.languages` AS lang_table,
|
| 186 |
+
UNNEST(LANGUAGE) AS lang) lang_table
|
| 187 |
+
JOIN
|
| 188 |
+
`bigquery-public-data.github_repos.licenses` AS license_table
|
| 189 |
+
ON
|
| 190 |
+
license_table.repo_name = lang_table.repo_name
|
| 191 |
+
JOIN (
|
| 192 |
+
SELECT
|
| 193 |
+
*
|
| 194 |
+
FROM
|
| 195 |
+
`bigquery-public-data.github_repos.commits` AS commits_table,
|
| 196 |
+
UNNEST(repo_name) AS unnested_repo_name) commits_table
|
| 197 |
+
ON
|
| 198 |
+
commits_table.unnested_repo_name = lang_table.repo_name
|
| 199 |
+
WHERE
|
| 200 |
+
((license_table.license LIKE 'mit')
|
| 201 |
+
OR (license_table.license LIKE 'artistic-2.0')
|
| 202 |
+
OR (license_table.license LIKE 'isc')
|
| 203 |
+
OR (license_table.license LIKE 'cc0-1.0')
|
| 204 |
+
OR (license_table.license LIKE 'epl-1.0')
|
| 205 |
+
OR (license_table.license LIKE 'mpl-2.0')
|
| 206 |
+
OR (license_table.license LIKE 'unlicense')
|
| 207 |
+
OR (license_table.license LIKE 'apache-2.0')
|
| 208 |
+
OR (license_table.license LIKE 'bsd-3-clause')
|
| 209 |
+
OR (license_table.license LIKE 'agpl-3.0')
|
| 210 |
+
OR (license_table.license LIKE 'lgpl-2.1')
|
| 211 |
+
OR (license_table.license LIKE 'bsd-2-clause'))
|
| 212 |
+
AND ( (lang_table.language_name LIKE 'Python')
|
| 213 |
+
OR (lang_table.language_name LIKE 'Java')
|
| 214 |
+
OR (lang_table.language_name LIKE 'JavaScript')
|
| 215 |
+
OR (lang_table.language_name LIKE 'HTML')
|
| 216 |
+
OR (lang_table.language_name LIKE 'Common Lisp')
|
| 217 |
+
OR (lang_table.language_name LIKE 'Shell')
|
| 218 |
+
OR (lang_table.language_name LIKE 'R')
|
| 219 |
+
OR (lang_table.language_name LIKE 'Perl%')
|
| 220 |
+
OR (lang_table.language_name LIKE 'SQL')
|
| 221 |
+
OR (lang_table.language_name LIKE 'C')
|
| 222 |
+
OR (lang_table.language_name LIKE 'C#')
|
| 223 |
+
OR (lang_table.language_name LIKE 'C++')
|
| 224 |
+
OR (lang_table.language_name LIKE 'TypeScript')
|
| 225 |
+
OR (lang_table.language_name LIKE 'Go')
|
| 226 |
+
OR (lang_table.language_name LIKE 'Rust')
|
| 227 |
+
OR (lang_table.language_name LIKE 'Swift')
|
| 228 |
+
OR (lang_table.language_name LIKE 'PHP')
|
| 229 |
+
OR (lang_table.language_name LIKE 'Dart')
|
| 230 |
+
OR (lang_table.language_name LIKE 'Kotlin')
|
| 231 |
+
OR (lang_table.language_name LIKE 'Matlab')
|
| 232 |
+
OR (lang_table.language_name LIKE 'MATLAB')
|
| 233 |
+
OR (lang_table.language_name LIKE 'Ruby') )
|
| 234 |
+
AND
|
| 235 |
+
LENGTH(commits_table.message) > 5
|
| 236 |
+
AND
|
| 237 |
+
LENGTH(commits_table.message) < 10000
|
| 238 |
+
AND LOWER(commits_table.message) NOT LIKE 'update readme.md'
|
| 239 |
+
AND LOWER(commits_table.message) NOT LIKE 'initial commit'
|
| 240 |
+
AND LOWER(commits_table.message) NOT LIKE 'update'
|
| 241 |
+
AND LOWER(commits_table.message) NOT LIKE 'mirroring from micro.blog.'
|
| 242 |
+
AND LOWER(commits_table.message) NOT LIKE 'update data.json'
|
| 243 |
+
AND LOWER(commits_table.message) NOT LIKE 'update data.js'
|
| 244 |
+
AND LOWER(commits_table.message) NOT LIKE 'add files via upload'
|
| 245 |
+
AND LOWER(commits_table.message) NOT LIKE 'update readme'
|
| 246 |
+
AND LOWER(commits_table.message) NOT LIKE "can't you see i'm updating the time?"
|
| 247 |
+
AND LOWER(commits_table.message) NOT LIKE 'pi push'
|
| 248 |
+
AND LOWER(commits_table.message) NOT LIKE 'dummy'
|
| 249 |
+
AND LOWER(commits_table.message) NOT LIKE 'update index.html'
|
| 250 |
+
AND LOWER(commits_table.message) NOT LIKE 'first commit'
|
| 251 |
+
AND LOWER(commits_table.message) NOT LIKE 'create readme.md'
|
| 252 |
+
AND LOWER(commits_table.message) NOT LIKE 'heartbeat update'
|
| 253 |
+
AND LOWER(commits_table.message) NOT LIKE 'updated readme'
|
| 254 |
+
AND LOWER(commits_table.message) NOT LIKE 'update log'
|
| 255 |
+
AND LOWER(commits_table.message) NOT LIKE 'test'
|
| 256 |
+
AND LOWER(commits_table.message) NOT LIKE 'no message'
|
| 257 |
+
AND LOWER(commits_table.message) NOT LIKE 'readme'
|
| 258 |
+
AND LOWER(commits_table.message) NOT LIKE 'wip'
|
| 259 |
+
AND LOWER(commits_table.message) NOT LIKE 'updates'
|
| 260 |
+
AND LOWER(commits_table.message) NOT LIKE 'first commit'
|
| 261 |
+
AND LOWER(commits_table.message) NOT LIKE 'commit'
|
| 262 |
+
AND LOWER(commits_table.message) NOT LIKE 'update _config.yaml'
|
| 263 |
+
AND LOWER(commits_table.message) NOT LIKE 'update data.json'
|
| 264 |
+
AND LOWER(commits_table.message) NOT LIKE 'update data.js'
|
| 265 |
+
AND LOWER(commits_table.message) NOT LIKE 'merge%';
|
| 266 |
+
```
|
| 267 |
+
|
| 268 |
+
|
| 269 |
+
|
| 270 |
+
3,641,694,786
|
| 271 |
+
|
| 272 |
+
|
| 273 |
+
```sql
|
| 274 |
+
SELECT commit, subject, message, STRING_AGG(unnested_repo_name), license AS repos
|
| 275 |
+
FROM `huggingface-ml.commits_table_24122022.commits_table_base`
|
| 276 |
+
GROUP BY commit, subject, message, license
|
| 277 |
+
```
|
| 278 |
+
|
| 279 |
+
```sql
|
| 280 |
+
SELECT *
|
| 281 |
+
FROM (
|
| 282 |
+
SELECT
|
| 283 |
+
commit,subject,message,repos,difference,license
|
| 284 |
+
FROM
|
| 285 |
+
`huggingface-ml.commits_table_24122022.commits_table_dedup` AS commits_table_dedup
|
| 286 |
+
JOIN (
|
| 287 |
+
SELECT
|
| 288 |
+
commit AS commit_base,difference
|
| 289 |
+
FROM
|
| 290 |
+
`bigquery-public-data.github_repos.commits` AS commits_table_base
|
| 291 |
+
) commits_table_base
|
| 292 |
+
ON
|
| 293 |
+
commits_table_base.commit_base = commits_table_dedup.commit
|
| 294 |
+
)
|
| 295 |
+
```
|
| 296 |
+
|
| 297 |
+
```sql
|
| 298 |
+
SELECT
|
| 299 |
+
commit,subject,message,repos,license,d.old_path as old_file,d.new_path as new_file
|
| 300 |
+
FROM
|
| 301 |
+
`huggingface-ml.commits_table_24122022.commits_table_dedup_difference` AS commits_table,
|
| 302 |
+
UNNEST(difference) AS d
|
| 303 |
+
WHERE (d.old_path = d.new_path) AND (d.old_path IS NOT NULL) AND (d.new_path IS NOT NULL)
|
| 304 |
+
```
|
| 305 |
+
|
| 306 |
+
```sql
|
| 307 |
+
SELECT commit,repos,licenses
|
| 308 |
+
FROM (
|
| 309 |
+
(
|
| 310 |
+
SELECT commit AS commit_base
|
| 311 |
+
FROM `huggingface-ml.commits_table_24122022.commits_table_dedup_files`
|
| 312 |
+
GROUP BY commit
|
| 313 |
+
HAVING COUNT(*) = 1
|
| 314 |
+
)
|
| 315 |
+
JOIN (
|
| 316 |
+
SELECT
|
| 317 |
+
commit,subject,message,repos,old_file,new_file
|
| 318 |
+
FROM
|
| 319 |
+
`huggingface-ml.commits_table_24122022.commits_table_dedup_files` AS commits_table_base
|
| 320 |
+
) commits_table_base
|
| 321 |
+
ON commits_table_base.commit = commit_base
|
| 322 |
+
)
|
| 323 |
+
```
|
| 324 |
+
|
| 325 |
+
|
| 326 |
+
Then export the final dataset from GCP to a bucket as parquet files.
|
| 327 |
+
Then copy those parquet files to the hf dataset on an instance.
|
| 328 |
+
|
| 329 |
+
|
| 330 |
+
|