Skip to content

Commit e6e6922

Browse files
committed
chore: filter top contributors and top organizations by activity type
Signed-off-by: Raúl Santos <4837+borfast@users.noreply.github.com>
1 parent b945990 commit e6e6922

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

services/libs/tinybird/pipes/top_member_org_copy.pipe

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,14 @@ NODE top_member_org_copy_member_activity_count
1717
SQL >
1818
SELECT memberId, count(*) AS activityCount
1919
FROM activityRelations_deduplicated_cleaned_ds
20-
WHERE (timestamp >= (now() - toIntervalYear(10))) AND (timestamp < now())
20+
WHERE
21+
(timestamp >= (now() - toIntervalYear(10)))
22+
AND (timestamp < now())
23+
AND (type, platform) IN (
24+
SELECT activityType, platform
25+
FROM activityTypes_filtered at
26+
WHERE at.isCodeContribution = true OR at.isCollaboration = true
27+
)
2128
GROUP BY memberId
2229
ORDER BY activityCount DESC
2330
LIMIT 100
@@ -41,7 +48,15 @@ NODE top_member_org_copy_organization_activity_count
4148
SQL >
4249
SELECT organizationId, count(*) AS activityCount
4350
FROM activityRelations_deduplicated_cleaned_ds
44-
WHERE (timestamp >= (now() - toIntervalYear(10))) AND (timestamp < now()) AND organizationId != ''
51+
WHERE
52+
(timestamp >= (now() - toIntervalYear(10)))
53+
AND (timestamp < now())
54+
AND organizationId != ''
55+
AND (type, platform) IN (
56+
SELECT activityType, platform
57+
FROM activityTypes_filtered at
58+
WHERE at.isCodeContribution = true OR at.isCollaboration = true
59+
)
4560
GROUP BY organizationId
4661
ORDER BY activityCount DESC
4762
LIMIT 100

0 commit comments

Comments
 (0)