Spark · hard · ~14 min
A groupBy(customer_id).agg(...) over clickstream data has one brutal customer: an internal load-test account generating 31% of all events. AQE's skew-join handling doesn't apply — this is an aggregation, and every event for that key must reach the same reducer. The stage straggles for 50 minutes on one task.
groupBy(customer_id).agg(...)
Filtering the account is forbidden (its numbers are reported). Design the two-phase salted aggregation.