Muennighoff commited on
Commit
085e000
·
1 Parent(s): 2fc76e6

Create query_single_file_limit.sql

Browse files
Files changed (1) hide show
  1. query_single_file_limit.sql +52 -0
query_single_file_limit.sql ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ SELECT commit, old_file, new_file, subject, message, unnested_repo_name
2
+ FROM (
3
+ SELECT commit, d.old_path old_file, d.new_path new_file, subject, message, unnested_repo_name
4
+ FROM (
5
+ SELECT *
6
+ FROM (
7
+ SELECT *, ROW_NUMBER()OVER(PARTITION BY commit) AS RN
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
25
+ LIMIT 10000) commits_table
26
+ ON
27
+ commits_table.unnested_repo_name = lang_table.repo_name
28
+ WHERE
29
+ ((license_table.license LIKE 'mit')
30
+ OR (license_table.license LIKE 'artistic-2.0')
31
+ OR (license_table.license LIKE 'isc')
32
+ OR (license_table.license LIKE 'cc0-1.0')
33
+ OR (license_table.license LIKE 'apache-2.0')
34
+ OR (license_table.license LIKE 'unlicense')
35
+ OR (license_table.license LIKE 'bsd-3-clause')
36
+ OR (license_table.license LIKE 'bsd-2-clause'))
37
+ AND (
38
+ LENGTH(commits_table.message) > 10
39
+ )
40
+ AND (
41
+ LENGTH(commits_table.message) < 10000
42
+ )
43
+ AND commits_table.message NOT IN (
44
+ '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'
45
+ )
46
+ AND commits_table.message not like 'Merge%')
47
+ WHERE RN = 1), UNNEST(difference) as d
48
+ WHERE (d.old_path = d.new_path) AND (d.old_path IS NOT NULL) AND (d.new_path IS NOT NULL)
49
+ )
50
+ GROUP BY commit, old_file, new_file, subject, message, unnested_repo_name
51
+ HAVING COUNT(commit) = 1
52
+