Sign in to run and submit your work
Reading is open to everyone. Running code and saving drafts need an account so your work is yours and comes back on your next visit.
or
CODE WORKSPACE
Return partition_day, records_to_replay, and latest_arrival_at.
Result columns · in this order
partition_dayrecords_to_replaylatest_arrival_atHow to approach it
Filter qualifying source_events and aggregate by event-time partition.
Sample input
| event_id | event_time | ingested_at | is_correction |
|---|---|---|---|
| 502 | 2026-03-02 10:00:00 | 2026-03-05 09:00:00 | 0 |
| 503 | 2026-03-03 11:00:00 | 2026-03-05 10:00:00 | 1 |
| 505 | 2026-03-04 14:00:00 | 2026-03-06 02:00:00 | 0 |
3 rows — all rows shown.
Expected output
| partition_day | records_to_replay | latest_arrival_at |
|---|---|---|
| 2026-03-02 | 1 | 2026-03-05 09:00:00 |
| 2026-03-03 | 1 | 2026-03-05 10:00:00 |
| 2026-03-04 | 1 | 2026-03-06 02:00:00 |
3 rows — all rows shown.
Constraints
Group by date(event_time). A record qualifies if is_correction = 1 or date(ingested_at) > date(event_time). Order by partition_day.
Expected skills
Late-data replay planning and event-time partitioning.
Submit for review to find out what your query gets right, what it gets wrong, and how it compares with the best working query for this exercise.
This scenario runs a full workspace — editor, canvas and results side by side. It needs a laptop or desktop to be usable. Open this page on a bigger screen to start building.