⚙️Broadcast Join
Also known as Broadcast Hash Join, Map-Side Join, Map Join
A join that sends a small table to every worker. The big table stays put.
Think of it like
It is like giving each cook a copy of a short recipe. No one has to walk to get it.
Example
A shop joins 3 billion sales rows to a list of 200 stores. The store list goes to every worker, and the sales rows never move.
Why it matters
Moving a big table across the network is often the slowest step in a job. A broadcast join skips it.
Definition
Example code
sql
SELECT /*+ BROADCAST(s) */ *
FROM sales t JOIN stores s ON t.store_id = s.store_id;Common mistake
Key takeaways
- 1Small table copied. Every worker gets all of it.
- 2Big table stays. No shuffle across the network.
- 3Size limit. Spark does it under 10 MB by default.