Data Preparation for ML and AI

A Spark job on Amazon EMR enriches a multi-terabyte fact dataset with a lookup table that fits comfortably in each executor's memory. A shuffle join stalls on one heavily skewed key, and all matching rows must be retained without changing cluster capacity. Which change BEST addresses the bottleneck?

Show the answer

Correct answerD. Broadcast the lookup table for the join.

AWhy not this: More hash partitions do not distribute a single hot key across multiple partitions.

BWhy not this: Hash partitioning by the same skewed key still places that key's fact records in one partition.

CWhy not this: Deduplicating by join key discards fact records and violates the retention requirement.

DWhy this is right: The lookup fits in executor memory, allowing a broadcast join without the skewed fact-side shuffle.

Broadcasting the small lookup table avoids shuffling the large fact dataset by the skewed key while preserving matching rows. Increasing shuffle partitions does not split records sharing one hash-partitioned key across partitions.