Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion user-cred-v2/UserCredV2App.scala
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,18 @@ object UserCredV2App extends Logging {
.readMostRecentSnapshotNoOlderThan(AccountExpansionInvestigationsScalaDataset, Days(7))
.withRemoteReadPolicy(ExplicitLocation(ProcAtla))
.toTypedPipe
.map(row => (row.userId, row.linkedUserId))
.flatMap(row => undirectedLinkedPairs(row.userId, row.linkedUserId))
}

// Investigations stores an undirected linked-account pair. Joining only
// (userId, linkedUserId) drops main→alt and keeps alt→main — the PageRank
// boosting direction (mass flows follower→followee / engager→author).
private[user_cred_v2] def undirectedLinkedPairs(
userId: Long,
linkedUserId: Long,
): Seq[(Long, Long)] = {
if (userId == linkedUserId) Seq.empty
else Seq((userId, linkedUserId), (linkedUserId, userId))
}

private[user_cred_v2] def filterLinkedUserEdges(
Expand Down