Files
doris/regression-test/suites/variant_github_events_p2/sql/issuesWithTheMostComments3.sql
2024-12-12 12:16:04 +08:00

18 lines
444 B
SQL

SELECT
repo_name,
comments,
issues,
round(comments / issues, 2) AS ratio
FROM
(
SELECT
cast(v["repo"]["name"] as string) as repo_name,
count() AS comments,
count(distinct cast(v["payload"]["issue"]["number"] as int)) AS issues
FROM github_events
WHERE cast(v["type"] as string) = 'IssueCommentEvent'
GROUP BY cast(v["repo"]["name"] as string)
) t
ORDER BY comments DESC, 1, 3, 4
LIMIT 50