DE Mastery GitHub

Apache Spark · SPK-06

Joins and aggregations at scale

From your world. Redshift DISTSTYLE ALL ≈ broadcast; distribution keys and skew

Practice quiz with instant feedback. For a scored run that counts toward your local progress, use uv run de quiz SPK-06.

1You join a 2 billion-row fact to a 500-row dimension on company_id. Which join strategy is ideal and why?
2What is the cost signature of a SortMergeJoin on the physical plan?
3A developer wraps the 1-billion-row fact in F.broadcast() to 'speed up' the join. What happens?
4You need a left join of orders to payments. You must keep every order, even if it has no payment. Someone used an inner join. What is the bug?
5One company_id value owns 80% of the fact rows, so one join task runs far longer than the others. What is this, and which fix does NOT change the result?
6When is a broadcast VARIABLE (sc.broadcast) the right tool, as opposed to a broadcast JOIN?
7Why should an accumulator not be used as business logic (e.g. to compute a final total that must be exact)?
8In this multi-company dataset, order_id is unique within a company but can repeat across companies. You join orders to order_items on order_id alone. What can go wrong?