-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
13d0f81
commit e76e1a0
Showing
3 changed files
with
79 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,4 @@ WHERE | |
END | ||
GROUP BY dayofweek, hour | ||
ORDER BY dayofweek, hour | ||
; | ||
|
||
|
||
; |
21 changes: 21 additions & 0 deletions
21
...gs/public_api/http_endpoints/sql/GET-repos-contributors-time_distribution_dump_hzlrWA.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
USE gharchive_dev; | ||
|
||
SELECT | ||
DAYOFWEEK(created_at) - 1 AS dayofweek, | ||
HOUR(created_at) AS hour, | ||
COUNT(1) AS pushes | ||
FROM github_events | ||
WHERE | ||
repo_id IN (SELECT repo_id FROM github_repos WHERE repo_name = CONCAT(${owner}, '/', ${repo}) LIMIT 1) | ||
AND type = 'PushEvent' | ||
AND action = '' | ||
AND | ||
CASE | ||
WHEN ${from} = '' THEN created_at >= DATE_SUB(NOW(), INTERVAL 1 YEAR) | ||
ELSE (created_at >= ${from} AND created_at <= ${to}) | ||
END | ||
GROUP BY dayofweek, hour | ||
ORDER BY dayofweek, hour | ||
; | ||
|
||
|