Brief
Choose a tool for a specific job using equal answers, duration, memory, and explicitly estimated cost.
Voss wants a large cluster immediately to announce Hidden Depot. Mara hands you two fictional measurement sheets, while Imani insists T2 and T3 stay linked to the correct D7 version. Recommend a tool for the 2 GB copy and a decision method for full volume before the story's meeting. This exercise has no timer.
Your mission
- Compare the four join results from DuckDB and Spark.
- Calculate both medians and their ratio, and note peak memory.
- Calculate compute cost at the fictional €0.12/minute with a one-minute minimum.
- Choose a tool for the copy and give three measurements needed before an optional move to a cluster.
How to check your work
- Same four time-aware pairs, no false duplicates.
- 18 s versus 54 s, ratio 3; fictional peaks 1.4 versus 3.2 GB.
- €0.12 compute under the stated assumption, not a real quote.
- DuckDB for the copy; decide full volume after time, memory, disk, and cost measurements.
Course example
WITH trips(trip_id, depot_id, event_min) AS (
VALUES ('T1', 'D7', 1170), ('T2', 'D7', 1285),
('T3', 'D7', 1300), ('T4', 'D8', 1310)
), depots(depot_id, name, valid_from, valid_to) AS (
VALUES ('D7', 'North Yard', 0, 1200),
('D7', 'Hidden Depot', 1200, 1440),
('D8', 'South Yard', 0, 1440)
)
SELECT t.trip_id, d.name
FROM trips AS t
LEFT JOIN depots AS d
ON t.depot_id = d.depot_id
AND t.event_min >= d.valid_from
AND t.event_min < d.valid_to
ORDER BY t.trip_id;