Skip to content

Commit 54ce496

Browse files
authored
chore(tinybird): update tb pipes to get repos from unified ds [CM-912] (#3788)
1 parent 4420d0a commit 54ce496

14 files changed

Lines changed: 121 additions & 124 deletions

services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_0.pipe

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,15 @@ SQL >
3636
and (
3737
(
3838
platform IN ('git', 'gerrit', 'github', 'gitlab')
39-
AND channel
40-
IN (SELECT arrayJoin(i.repositories) FROM insightsProjects i where isNull (i.deletedAt))
41-
AND activityRelations_bucket_MV_ds_0.segmentId IN (
42-
SELECT segmentId
39+
AND (channel, activityRelations_bucket_MV_ds_0.segmentId) IN (
40+
SELECT r.url, r.segmentId
4341
FROM repositories r FINAL
44-
WHERE (r.excluded IS NULL OR r.excluded = false)
42+
INNER JOIN insightsProjects i FINAL ON r.insightsProjectId = i.id
43+
WHERE
44+
isNull (r.deletedAt)
45+
AND isNull (i.deletedAt)
46+
AND r.excluded = false
47+
AND r.enabled = true
4548
)
4649
)
4750
OR platform NOT IN ('git', 'gerrit', 'github', 'gitlab')

services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_1.pipe

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,15 @@ SQL >
3636
and (
3737
(
3838
platform IN ('git', 'gerrit', 'github', 'gitlab')
39-
AND channel
40-
IN (SELECT arrayJoin(i.repositories) FROM insightsProjects i where isNull (i.deletedAt))
41-
AND activityRelations_bucket_MV_ds_1.segmentId IN (
42-
SELECT segmentId
39+
AND (channel, activityRelations_bucket_MV_ds_1.segmentId) IN (
40+
SELECT r.url, r.segmentId
4341
FROM repositories r FINAL
44-
WHERE (r.excluded IS NULL OR r.excluded = false)
42+
INNER JOIN insightsProjects i FINAL ON r.insightsProjectId = i.id
43+
WHERE
44+
isNull (r.deletedAt)
45+
AND isNull (i.deletedAt)
46+
AND r.excluded = false
47+
AND r.enabled = true
4548
)
4649
)
4750
OR platform NOT IN ('git', 'gerrit', 'github', 'gitlab')

services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_2.pipe

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,15 @@ SQL >
3636
and (
3737
(
3838
platform IN ('git', 'gerrit', 'github', 'gitlab')
39-
AND channel
40-
IN (SELECT arrayJoin(i.repositories) FROM insightsProjects i where isNull (i.deletedAt))
41-
AND activityRelations_bucket_MV_ds_2.segmentId IN (
42-
SELECT segmentId
39+
AND (channel, activityRelations_bucket_MV_ds_2.segmentId) IN (
40+
SELECT r.url, r.segmentId
4341
FROM repositories r FINAL
44-
WHERE (r.excluded IS NULL OR r.excluded = false)
42+
INNER JOIN insightsProjects i FINAL ON r.insightsProjectId = i.id
43+
WHERE
44+
isNull (r.deletedAt)
45+
AND isNull (i.deletedAt)
46+
AND r.excluded = false
47+
AND r.enabled = true
4548
)
4649
)
4750
OR platform NOT IN ('git', 'gerrit', 'github', 'gitlab')

services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_3.pipe

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,15 @@ SQL >
3636
and (
3737
(
3838
platform IN ('git', 'gerrit', 'github', 'gitlab')
39-
AND channel
40-
IN (SELECT arrayJoin(i.repositories) FROM insightsProjects i where isNull (i.deletedAt))
41-
AND activityRelations_bucket_MV_ds_3.segmentId IN (
42-
SELECT segmentId
39+
AND (channel, activityRelations_bucket_MV_ds_3.segmentId) IN (
40+
SELECT r.url, r.segmentId
4341
FROM repositories r FINAL
44-
WHERE (r.excluded IS NULL OR r.excluded = false)
42+
INNER JOIN insightsProjects i FINAL ON r.insightsProjectId = i.id
43+
WHERE
44+
isNull (r.deletedAt)
45+
AND isNull (i.deletedAt)
46+
AND r.excluded = false
47+
AND r.enabled = true
4548
)
4649
)
4750
OR platform NOT IN ('git', 'gerrit', 'github', 'gitlab')

services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_4.pipe

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,15 @@ SQL >
3636
and (
3737
(
3838
platform IN ('git', 'gerrit', 'github', 'gitlab')
39-
AND channel
40-
IN (SELECT arrayJoin(i.repositories) FROM insightsProjects i where isNull (i.deletedAt))
41-
AND activityRelations_bucket_MV_ds_4.segmentId IN (
42-
SELECT segmentId
39+
AND (channel, activityRelations_bucket_MV_ds_4.segmentId) IN (
40+
SELECT r.url, r.segmentId
4341
FROM repositories r FINAL
44-
WHERE (r.excluded IS NULL OR r.excluded = false)
42+
INNER JOIN insightsProjects i FINAL ON r.insightsProjectId = i.id
43+
WHERE
44+
isNull (r.deletedAt)
45+
AND isNull (i.deletedAt)
46+
AND r.excluded = false
47+
AND r.enabled = true
4548
)
4649
)
4750
OR platform NOT IN ('git', 'gerrit', 'github', 'gitlab')

services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_5.pipe

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,15 @@ SQL >
3636
and (
3737
(
3838
platform IN ('git', 'gerrit', 'github', 'gitlab')
39-
AND channel
40-
IN (SELECT arrayJoin(i.repositories) FROM insightsProjects i where isNull (i.deletedAt))
41-
AND activityRelations_bucket_MV_ds_5.segmentId IN (
42-
SELECT segmentId
39+
AND (channel, activityRelations_bucket_MV_ds_5.segmentId) IN (
40+
SELECT r.url, r.segmentId
4341
FROM repositories r FINAL
44-
WHERE (r.excluded IS NULL OR r.excluded = false)
42+
INNER JOIN insightsProjects i FINAL ON r.insightsProjectId = i.id
43+
WHERE
44+
isNull (r.deletedAt)
45+
AND isNull (i.deletedAt)
46+
AND r.excluded = false
47+
AND r.enabled = true
4548
)
4649
)
4750
OR platform NOT IN ('git', 'gerrit', 'github', 'gitlab')

services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_6.pipe

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,15 @@ SQL >
3636
and (
3737
(
3838
platform IN ('git', 'gerrit', 'github', 'gitlab')
39-
AND channel
40-
IN (SELECT arrayJoin(i.repositories) FROM insightsProjects i where isNull (i.deletedAt))
41-
AND activityRelations_bucket_MV_ds_6.segmentId IN (
42-
SELECT segmentId
39+
AND (channel, activityRelations_bucket_MV_ds_6.segmentId) IN (
40+
SELECT r.url, r.segmentId
4341
FROM repositories r FINAL
44-
WHERE (r.excluded IS NULL OR r.excluded = false)
42+
INNER JOIN insightsProjects i FINAL ON r.insightsProjectId = i.id
43+
WHERE
44+
isNull (r.deletedAt)
45+
AND isNull (i.deletedAt)
46+
AND r.excluded = false
47+
AND r.enabled = true
4548
)
4649
)
4750
OR platform NOT IN ('git', 'gerrit', 'github', 'gitlab')

services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_7.pipe

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,15 @@ SQL >
3636
and (
3737
(
3838
platform IN ('git', 'gerrit', 'github', 'gitlab')
39-
AND channel
40-
IN (SELECT arrayJoin(i.repositories) FROM insightsProjects i where isNull (i.deletedAt))
41-
AND activityRelations_bucket_MV_ds_7.segmentId IN (
42-
SELECT segmentId
39+
AND (channel, activityRelations_bucket_MV_ds_7.segmentId) IN (
40+
SELECT r.url, r.segmentId
4341
FROM repositories r FINAL
44-
WHERE (r.excluded IS NULL OR r.excluded = false)
42+
INNER JOIN insightsProjects i FINAL ON r.insightsProjectId = i.id
43+
WHERE
44+
isNull (r.deletedAt)
45+
AND isNull (i.deletedAt)
46+
AND r.excluded = false
47+
AND r.enabled = true
4548
)
4649
)
4750
OR platform NOT IN ('git', 'gerrit', 'github', 'gitlab')

services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_8.pipe

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,15 @@ SQL >
3636
and (
3737
(
3838
platform IN ('git', 'gerrit', 'github', 'gitlab')
39-
AND channel
40-
IN (SELECT arrayJoin(i.repositories) FROM insightsProjects i where isNull (i.deletedAt))
41-
AND activityRelations_bucket_MV_ds_8.segmentId IN (
42-
SELECT segmentId
39+
AND (channel, activityRelations_bucket_MV_ds_8.segmentId) IN (
40+
SELECT r.url, r.segmentId
4341
FROM repositories r FINAL
44-
WHERE (r.excluded IS NULL OR r.excluded = false)
42+
INNER JOIN insightsProjects i FINAL ON r.insightsProjectId = i.id
43+
WHERE
44+
isNull (r.deletedAt)
45+
AND isNull (i.deletedAt)
46+
AND r.excluded = false
47+
AND r.enabled = true
4548
)
4649
)
4750
OR platform NOT IN ('git', 'gerrit', 'github', 'gitlab')

services/libs/tinybird/pipes/activityRelations_bucket_clean_enrich_copy_pipe_9.pipe

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,15 @@ SQL >
3636
and (
3737
(
3838
platform IN ('git', 'gerrit', 'github', 'gitlab')
39-
AND channel
40-
IN (SELECT arrayJoin(i.repositories) FROM insightsProjects i where isNull (i.deletedAt))
41-
AND activityRelations_bucket_MV_ds_9.segmentId IN (
42-
SELECT segmentId
39+
AND (channel, activityRelations_bucket_MV_ds_9.segmentId) IN (
40+
SELECT r.url, r.segmentId
4341
FROM repositories r FINAL
44-
WHERE (r.excluded IS NULL OR r.excluded = false)
42+
INNER JOIN insightsProjects i FINAL ON r.insightsProjectId = i.id
43+
WHERE
44+
isNull (r.deletedAt)
45+
AND isNull (i.deletedAt)
46+
AND r.excluded = false
47+
AND r.enabled = true
4548
)
4649
)
4750
OR platform NOT IN ('git', 'gerrit', 'github', 'gitlab')

0 commit comments

Comments
 (0)