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
21 changes: 17 additions & 4 deletions services/libs/tinybird/pipes/issue_analysis_copy_pipe.pipe
Original file line number Diff line number Diff line change
@@ -1,28 +1,39 @@
DESCRIPTION >
Compacts activities from same issue into one, keeping necessary information in a single row. Helps to serve issue-wide widgets in the development tab.
Compacts activities from same issue into one, keeping necessary information in a single row. Helps to serve issue-wide widgets in the development tab.


NODE issues_opened
SQL >

SELECT activityId as id, sourceId, timestamp AS openedAt, segmentId
FROM activityRelations_deduplicated_cleaned_bucket_union
WHERE type = 'issues-opened'
WHERE type = 'issues-opened' AND toYear(timestamp) >= 1971



NODE issues_closed
SQL >

SELECT sourceParentId, MIN(timestamp) AS closedAt
FROM activityRelations_deduplicated_cleaned_bucket_union
WHERE type = 'issues-closed' AND sourceParentId != ''
WHERE type = 'issues-closed' AND sourceParentId != '' AND toYear(timestamp) >= 1971
GROUP BY sourceParentId



NODE issues_comment
SQL >

SELECT sourceParentId, MIN(timestamp) AS commentedAt
FROM activityRelations_deduplicated_cleaned_bucket_union
WHERE type = 'issue-comment' AND sourceParentId != '' AND toYear(timestamp) >= 1971
GROUP BY sourceParentId



NODE issue_analysis_results_merged
SQL >

SELECT
opened.id,
opened.sourceId,
Expand All @@ -42,7 +53,9 @@ SQL >
LEFT JOIN issues_closed AS closed ON opened.sourceId = closed.sourceParentId
LEFT JOIN issues_comment AS comment ON opened.sourceId = comment.sourceParentId

TYPE COPY
TYPE copy
TARGET_DATASOURCE issues_analyzed
COPY_MODE replace
COPY_SCHEDULE 20 * * * *


Loading