Noos
PT EN
RAN-DBDEA-00040
Ranvier · DBDEA

Exam DBDEA Topics: transformation Difficulty: medium

A nightly job joins a 900 GB transactions DataFrame to a 250 MB currency_rates dimension on currency_code and then aggregates by market. The Spark UI shows a SortMergeJoin whose shuffle of the transactions data dominates the runtime. The rates table fits comfortably in every executor's memory. ```python joined = txns.join(rates, "currency_code") ``` Which change most directly avoids shuffling the large DataFrame for this join?

Options (Reading Mode) Click to filter discussion →
  1. A. Increase spark.sql.shuffle.partitions so each task shuffles a smaller slice of the transactions data
  2. B. Call txns.cache() before the join so Spark reuses a shuffle-free copy of the transactions data
  3. C. Run OPTIMIZE on the currency_rates table to compact its files before the join
  4. D. Force a broadcast hash join by wrapping the small side: txns.join(broadcast(rates), 'currency_code')
Reveal answer

Correct answer: Force a broadcast hash join by wrapping the small side: txns.join(broadcast(rates), 'currency_code')

Reference: https://docs.databricks.com/aws/en/pyspark/reference/functions

02 — The Myelin Layer · Canonical Discussion

Where the exam tries to trick you — and how those who passed solved it.

0 Passed

contributed to this question

Answer Distractor Matrix Click an option to filter or open its dissection.
✦ Consolidated Synthesis (Wiki) rev. #1 (baseline) · CC BY-SA 4.0
Start synthesis for this question →

No community synthesis consolidated for this question yet. Below is the verifiable official starting point — if you passed the exam, open the option dissection.

Official Answer (D): Force a broadcast hash join by wrapping the small side: txns.join(broadcast(rates), 'currency_code')

Ranvier · DBDEA

Contribute to this Question

Your contribution builds your Orbital Sheath

Peer contributions

No public contribution yet. Be the first who passed to explain why the distractors trick candidates — your contribution builds your Orbital Sheath.