Skip to content

Commit 2319518

Browse files
authored
feat: connected platforms on projects (#3069)
Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
1 parent 129b2a4 commit 2319518

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

services/libs/tinybird/pipes/insightsProjects_filtered.pipe

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,21 @@ SQL >
99
FROM collectionsInsightsProjects cip final
1010
join collections c on c.id = cip.collectionId
1111

12+
NODE insightsProjects_filtered_integrations_deduplicated
13+
SQL >
14+
SELECT platform, segmentId FROM integrations FINAL
15+
16+
NODE insightsProjects_filtered_segment_id_mapping
17+
SQL >
18+
SELECT id, segmentId from insightsProjects FINAL
19+
20+
NODE insightsProjects_filtered_connected_platforms
21+
SQL >
22+
SELECT id, groupArray(platform) AS connectedPlatforms
23+
FROM insightsProjects_filtered_segment_id_mapping
24+
JOIN insightsProjects_filtered_integrations_deduplicated USING (segmentId)
25+
GROUP BY id
26+
1227
NODE insightsProjects_filtered_1
1328
SQL >
1429
%
@@ -27,10 +42,12 @@ SQL >
2742
insightsProjects.github,
2843
insightsProjects.twitter,
2944
coalesce(countDistinctMerge(segmentsAggregatedMV.organizationCount), 0) as "organizationCount",
30-
coalesce(countDistinctMerge(segmentsAggregatedMV.contributorCount), 0) as "contributorCount"
45+
coalesce(countDistinctMerge(segmentsAggregatedMV.contributorCount), 0) as "contributorCount",
46+
insightsProjects_filtered_connected_platforms.connectedPlatforms
3147
FROM insightsProjects FINAL
3248
left join collection_info on collection_info.insightsProjectId = insightsProjects.id
3349
left join segmentsAggregatedMV on segmentsAggregatedMV.segmentId = insightsProjects.segmentId
50+
left join insightsProjects_filtered_connected_platforms using (id)
3451
where
3552
insightsProjects.enabled = 1
3653
{% if defined(slug) %}
@@ -67,4 +84,5 @@ SQL >
6784
insightsProjects.website,
6885
insightsProjects.linkedin,
6986
insightsProjects.github,
70-
insightsProjects.twitter
87+
insightsProjects.twitter,
88+
insightsProjects_filtered_connected_platforms.connectedPlatforms

0 commit comments

Comments
 (0)