arcs-bench / tasks /readable /040 /task_readable.sql
anon
Upload tasks/ folder for end-to-end loader reproducibility
02edc38
/*
{
"qid": "040",
"task_type": "ambig",
"has_intended_resolution": true,
"language": "SQLite",
"db": "github_repos",
"question": "Find all repository IDs that experienced rapid increase in push based on absolute change from 2022 to 2023.",
"gold_ambiguity_points": [
{
"id": "A",
"phrase": "rapid increase in push",
"type": "infinite",
"ambiguity_type": "semantic_value",
"parameter_name": "push_threshold",
"parameter_dtype": "int",
"parameter_sample_operators": [
">",
">="
],
"parameter_sample_values": [
70
],
"intended_parameter_operator": ">=",
"intended_parameter_value": 70
}
],
"gold_intended_query_id": "GQRY",
"extra_info": {}
}
*/
----- START OF GOLD QUERY `GQRY` -----
/*
{
"id": "GQRY",
"parameter_names": [
"push_threshold"
],
"parameter_values": {
"push_threshold": 70
},
"other_exec_results": [],
"required_columns": [
0
],
"required_sorted": false,
"extra_info": {
"ambiguity_resolution": {
"[A] rapid increase in push": ":push_threshold"
}
}
}
*/
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;
/* EXEC 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
... TRUNCATED ...
229130005 174 262 88
406918379 401 483 82
465250207 641 723 82
579673939 12 92 80
380057700 133 209 76
*/
----- END OF GOLD QUERY -----