Skip to content

Commit 528e5c4

Browse files
authored
refactor: favor GitHub public names over others (#3215)
1 parent aad224b commit 528e5c4

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

services/libs/tinybird/pipes/members_public_names_copy_pipe.pipe

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,22 @@ SQL >
44

55
NODE members_public_names_result
66
SQL >
7-
select memberId, any (username) as publicName
8-
from activityRelations_deduplicated_ds
9-
where segmentId in (select segmentId from segmentIds_in_nonlf_projects)
10-
group by memberId
7+
SELECT memberId, argMax(username, platform_priority) AS publicName
8+
FROM
9+
(
10+
SELECT
11+
memberId,
12+
username,
13+
platform,
14+
CASE
15+
WHEN platform = 'github' THEN 2 WHEN platform = 'git' THEN 1 ELSE 0
16+
END AS platform_priority
17+
FROM activityRelations_deduplicated_ds
18+
WHERE segmentId IN (SELECT segmentId FROM segmentIds_in_nonlf_projects)
19+
)
20+
GROUP BY memberId
1121

1222
TYPE COPY
1323
TARGET_DATASOURCE members_public_names_ds
1424
COPY_MODE replace
15-
COPY_SCHEDULE 0 * * * *
25+
COPY_SCHEDULE 5 * * * *

0 commit comments

Comments
 (0)