Created
November 3, 2018 16:29
-
-
Save rafaelkallis/437c6af4d0cd9d6b1f66baf7743ab39f to your computer and use it in GitHub Desktop.
issue lifetime
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
SELECT | |
created_at, | |
closed_at, | |
CONCAT(title, ' ', REGEXP_REPLACE(body, '(\r|\n|\r\n)',' ')) AS text | |
FROM ( | |
SELECT | |
JSON_EXTRACT_SCALAR(payload, '$.issue.created_at') AS created_at, | |
JSON_EXTRACT_SCALAR(payload, '$.issue.closed_at') AS closed_at, | |
JSON_EXTRACT_SCALAR(payload, '$.action') AS action, | |
JSON_EXTRACT_SCALAR(payload, '$.issue.title') AS title, | |
JSON_EXTRACT_SCALAR(payload, '$.issue.body') AS body | |
FROM | |
-- [githubarchive:day.20180201], | |
-- [githubarchive:day.20180202], | |
-- [githubarchive:day.20180203], | |
-- [githubarchive:day.20180204], | |
[githubarchive:day.20180205] | |
WHERE | |
type = 'IssuesEvent' | |
) | |
WHERE | |
body != 'null' | |
AND action = 'closed' | |
LIMIT 10000; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment