arcs / tasks /readable /040 /task_readable.md
yanlinf's picture
Release ARCS dataset
1fb4e2d verified
|
Raw History Blame Contribute Delete
1.94 kB

Task: 040

Database: github_repos

Question

Find all repository IDs that experienced rapid increase in push based on absolute change from 2022 to 2023.

Gold Query

WITH w2022 AS (
SELECT json_extract(repo, '$.id') AS repo_id, COUNT(*) AS cnt_2022
FROM YEAR_2022
WHERE type = 'PushEvent'
GROUP BY repo_id
),
w2023 AS (
SELECT json_extract(repo, '$.id') AS repo_id, COUNT(*) AS cnt_2023
FROM YEAR_2023
WHERE type = 'PushEvent'
GROUP BY repo_id
)
SELECT
w2022.repo_id AS repo_id,
w2022.cnt_2022 AS cnt_2022,
w2023.cnt_2023 AS cnt_2023,
w2023.cnt_2023 - w2022.cnt_2022 AS diff
FROM w2022
JOIN w2023 ON w2022.repo_id = w2023.repo_id
WHERE w2023.cnt_2023 - w2022.cnt_2022 >= :push_threshold
ORDER BY w2023.cnt_2023 - w2022.cnt_2022 DESC;

Execution Result:

repo_id cnt_2022 cnt_2023 diff
571344774 499 10864 10365
511095846 4 8919 8915
330914717 8856 16179 7323
561366239 48 6120 6072
429551228 4405 10081 5676
575386595 2139 7319 5180
535755772 1009 4706 3697
486866465 1892 4964 3072
494617035 5512 8457 2945
543738826 821 3698 2877
... ... ... ...
873328 285 377 92
457386152 180 271 91
341389536 207 297 90
385301755 187 277 90
459770643 185 274 89
229130005 174 262 88
406918379 401 483 82
465250207 641 723 82
579673939 12 92 80
380057700 133 209 76

... truncated (57 rows total)