pingcap/ossinsight

[Explorer] Execution failed for question 3b9eaf90-82ae-4296-af07-21195260c04c: which repository has the most number of issues and pull requests

AbhinavAchha opened this issue · 1 comments

Hi, It's failed to execute the question 3b9eaf90-82ae-4296-af07-21195260c04c which repository has the most number of issues and pull requests (errorType = error-query-execute):

  • executedAt: 2024-05-29T14:43:00.000+00:00
  • requestedAt: 2024-05-29T14:43:00.000+00:00

Error message

unexpected rpc resp is MPPStreamResponse

Generated SQL

SELECT
  `repo_name`,
  SUM(
    CASE
      WHEN `type` = 'IssuesEvent' THEN 1
      ELSE 0
    END
  ) + SUM(
    CASE
      WHEN `type` = 'PullRequestEvent' THEN 1
      ELSE 0
    END
  ) AS `total_issues_and_pull_requests`
FROM
  `github_events`
GROUP BY
  `repo_name`
ORDER BY
  `total_issues_and_pull_requests` DESC
LIMIT
  1

The generated SQL cost too much memory to get the result. When I ask the same question, it generates another SQL and it can get the result successfully.

The pingcap teams will investigate whether the memory consumption of your post SQL can be optimized. Thanks for reporting it!

https://ossinsight.io/explore/?id=e28b7865-c396-4528-ac7c-7b39f577ffd8

SELECT
  `repo_name`,
  COUNT(*) AS `total_issues_and_pull_requests`
FROM
  `github_events`
WHERE
  `type` IN ('IssuesEvent', 'PullRequestEvent')
GROUP BY
  `repo_name`
ORDER BY
  `total_issues_and_pull_requests` DESC
LIMIT
  1

image