-
Notifications
You must be signed in to change notification settings - Fork 4
/
queries.bq
43 lines (34 loc) · 1.41 KB
/
queries.bq
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
SELECT repository_language, actor_attributes_location as pushes FROM [githubarchive:github.timeline]
WHERE type="PushEvent"
AND repository_language != ""
AND REGEXP_MATCH(actor_attributes_location,r'^[\s\w]+,[\s]*[\s\w]+$')
#LIMIT 100
SELECT LOWER(REGEXP_REPLACE(actor_attributes_location, r'^[\s\w]+,[\s]*', '')) as country FROM [githubarchive:github.timeline]
WHERE type="PushEvent"
AND repository_language != ""
AND REGEXP_MATCH(actor_attributes_location,r'^[\s\w]+,[\s]*[\s\w]+$')
LIMIT 10;
SELECT repository_language, actor_attributes_location, COUNT(actor_attributes_location) AS loccnt FROM [githubarchive:github.timeline]
WHERE type="PushEvent"
AND (
repository_language == "JavaScript" OR
repository_language == "Java" OR
repository_language == "Ruby" OR
repository_language == "Python" OR
repository_language == "PHP" OR
repository_language == "C" OR
repository_language == "C++" OR
repository_language == "Shell" OR
repository_language == "C#" OR
repository_language == "Objective-C"
)
AND REGEXP_MATCH(actor_attributes_location,r'^[\s\w]+,[\s]*[\s\w]+$')
GROUP BY repository_language, actor_attributes_location
ORDER BY loccnt DESC
#LIMIT 100;
SELECT actor_attributes_location as loc, COUNT(repository_language) AS langcnt, repository_language FROM [githubarchive:github.timeline]
WHERE type="PushEvent"
AND repository_language != ""
AND actor_attributes_location != ""
GROUP BY repository_language, loc
ORDER BY langcnt DESC