Startrekzky commented on issue #6457:
URL:
https://github.com/apache/incubator-devlake/issues/6457#issuecomment-1836127572
Hi @robgutsopedra , can you try out this SQL?
```
with _pr_commits_data as(
SELECT
DATE_ADD(date(pr.created_date), INTERVAL -MONTH(date(pr.created_date))+1
DAY) as time,
pr.id as pr_id,
pr.merge_commit_sha,
sum(c.additions)+sum(c.deletions) as loc
FROM
pull_requests pr
left join commits c on pr.merge_commit_sha = c.sha
join project_mapping pm on pr.base_repo_id = pm.row_id and pm.table =
'repos'
WHERE
$__timeFilter(pr.created_date)
pm.project_name in ($project)
group by 1,2,3
)
SELECT
time,
sum(loc)/count(distinct pr_id) as 'PR Size'
FROM _pr_commits_data
GROUP BY 1
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]