File size: 2,747 Bytes
02edc38
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
/*
{
  "qid": "043",
  "task_type": "ambig",
  "has_intended_resolution": true,
  "language": "SQLite",
  "db": "github_repos",
  "question": "Show the repository name with most events in May.",
  "gold_ambiguity_points": [
    {
      "id": "A",
      "phrase": "May",
      "type": "finite",
      "ambiguity_type": "semantic_table",
      "interpretations": [
        "May 2022",
        "May 2023",
        "May in both 2022 and 2023"
      ],
      "intended_interpretation_idx": 0
    }
  ],
  "gold_intended_query_id": "GQRY-A.0",
  "extra_info": {}
}
*/


----- START OF GOLD QUERY `GQRY-A.0` -----
/*
{
  "id": "GQRY-A.0",
  "parameter_names": [],
  "parameter_values": {},
  "other_exec_results": [],
  "required_columns": [
    0
  ],
  "required_sorted": false,
  "extra_info": {
    "ambiguity_resolution": {
      "[A] May": "May 2022"
    }
  }
}
*/
WITH event_counts AS (
SELECT json_extract(repo, '$.name') AS repo_name, COUNT(*) AS event_count
FROM MONTH_202205
GROUP BY repo_name
)
SELECT event_counts.repo_name, event_counts.event_count
FROM event_counts
WHERE event_count = (
SELECT MAX(event_count)
FROM event_counts
);
/* EXEC RESULT
     repo_name  event_count
Lombiq/Orchard         7833
*/
----- END OF GOLD QUERY -----


----- START OF GOLD QUERY `GQRY-A.1` -----
/*
{
  "id": "GQRY-A.1",
  "parameter_names": [],
  "parameter_values": {},
  "other_exec_results": [],
  "required_columns": [
    0
  ],
  "required_sorted": false,
  "extra_info": {
    "ambiguity_resolution": {
      "[A] May": "May 2023"
    }
  }
}
*/
WITH event_counts AS (
SELECT json_extract(repo, '$.name') AS repo_name, COUNT(*) AS event_count
FROM MONTH_202305
GROUP BY repo_name
)
SELECT event_counts.repo_name, event_counts.event_count
FROM event_counts
WHERE event_count = (
SELECT MAX(event_count)
FROM event_counts
);
/* EXEC RESULT
                            repo_name  event_count
bullet-dev-team/python-pyramid-public         3544
*/
----- END OF GOLD QUERY -----


----- START OF GOLD QUERY `GQRY-A.2` -----
/*
{
  "id": "GQRY-A.2",
  "parameter_names": [],
  "parameter_values": {},
  "other_exec_results": [],
  "required_columns": [
    0
  ],
  "required_sorted": false,
  "extra_info": {
    "ambiguity_resolution": {
      "[A] May": "May in both 2022 and 2023"
    }
  }
}
*/
WITH event_counts AS (
SELECT json_extract(repo, '$.name') AS repo_name, COUNT(*) AS event_count
FROM (
SELECT *
FROM MONTH_202205
UNION ALL
SELECT *
FROM MONTH_202305
) AS combined_may
GROUP BY repo_name
)
SELECT event_counts.repo_name, event_counts.event_count
FROM event_counts
WHERE event_count = (
SELECT MAX(event_count)
FROM event_counts
);
/* EXEC RESULT
     repo_name  event_count
Lombiq/Orchard         7833
*/
----- END OF GOLD QUERY -----