Project: ride operations mart
Blue Heron Rides route mart
The operations lead needs completed-trip counts, riders and fares by route. Deliver a silver table of completed trips with known riders and fare, then a gold route report with a protected fare-per-rider calculation. Keep zero-rider trips in the counts.
Blue Heron Rides needs a route mart for its operations review. Its trip feed includes an unfinished trip, a zero-rider trip and missing fare information. Build persistent Delta outputs from Python cells so the next step can read the table produced by your work.
The report includes completed trips with known rider and fare values. Zero riders are valid for trip counts, but they cannot be a divisor in a fare-per-rider measure. Use that distinction when building the final output. You will publish one row per route with trip counts, ridership and fares. The browser carries your table state between steps; each new Python cell reads those saved tables instead of relying on a variable from a previous exercise. Keep the source trip id until the aggregation so exclusions are auditable.
spark.table('main.bronze.trips').select('id','route','ended_at','riders','fare').write.format('delta').mode('overwrite').saveAsTable('main.silver.ride_detail')
The initial copy preserves incomplete trips for the following explicit quality step.