Skip to content

Commit 485a47b

Browse files
authored
fix: correct openedAt epoch corruption in PR merge MV (IN-1190) (#4320)
Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
1 parent 1002f93 commit 485a47b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

services/libs/tinybird/pipes/pull_request_analysis_baseline_merge_MV.pipe

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,9 @@ SQL >
254254
SELECT
255255
if(existing.id != '', existing.id, new.id) as id,
256256
if(existing.sourceId != '', existing.sourceId, new.prSourceId) as sourceId,
257-
COALESCE(existing.openedAt, new.openedAt) as openedAt,
257+
if(
258+
existing.openedAt != toDateTime(0), existing.openedAt, new.openedAt
259+
) as openedAt,
258260
if(existing.segmentId != '', existing.segmentId, new.segmentId) as segmentId,
259261
if(existing.channel != '', existing.channel, new.channel) as channel,
260262
if(existing.memberId != '', existing.memberId, new.memberId) as memberId,

0 commit comments

Comments
 (0)