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
2 changes: 2 additions & 0 deletions sql/reports/topgear/hourly.sql
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ registration_end AS (
MAX(COALESCE(cp."actualEndDate", cp."scheduledEndDate")) AS registration_end_date
FROM challenges."ChallengePhase" cp
JOIN challenges."Phase" p ON p.id = cp."phaseId"
JOIN base_challenges bc ON bc.id = cp."challengeId"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ correctness]
Ensure that the base_challenges CTE is correctly filtering and joining with ChallengePhase. If base_challenges does not contain all relevant challengeId values, this join may exclude necessary data.

WHERE p.name = 'Registration'
GROUP BY cp."challengeId"
),
Expand All @@ -105,6 +106,7 @@ submission_end AS (
MAX(COALESCE(cp."actualEndDate", cp."scheduledEndDate")) AS submission_end_date
FROM challenges."ChallengePhase" cp
JOIN challenges."Phase" p ON p.id = cp."phaseId"
JOIN base_challenges bc ON bc.id = cp."challengeId"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ correctness]
Verify that the base_challenges CTE includes all challengeId values needed for the submission_end CTE. If base_challenges is too restrictive, it could lead to missing data in the final report.

WHERE p.name IN ('Topcoder Submission', 'Submission')
GROUP BY cp."challengeId"
)
Expand Down
Loading