Home โ€บ Interview Questions โ€บ What are the differences between a broadcast join โ€ฆ

What are the differences between a broadcast join and a normal (shuffle) join in Spark?

๐ŸŸก Medium Conceptual Junior level
1Times asked
Jul 2026Last seen
Jul 2026First seen

๐Ÿ’ก Model Answer

A broadcast join replicates the smaller DataFrame to every executor, eliminating the need for a shuffle. This is efficient when one side of the join is small enough to fit in executor memory (typically below the autoBroadcastJoinThreshold). A normal shuffle join partitions both DataFrames on the join key and shuffles data across the cluster, which is expensive in terms of network I/O and disk usage. Broadcast joins reduce shuffle overhead but consume executor memory; if the broadcasted DataFrame is too large, it can cause OOM errors. Normal joins are more scalable for large join partners but can be slower due to the shuffle. Choosing between them depends on the size of the join partners, available memory, and performance requirements.

This answer was generated by AI for study purposes. Use it as a starting point โ€” personalize it with your own experience.

๐ŸŽค Get questions like this answered in real-time

Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers โ€” invisible to screen sharing.

Get Assisting AI โ€” Starts at โ‚น500