Noos
PT EN
RAN-DBDEA-00039
Ranvier · DBDEA

Exam DBDEA Topics: transformation Difficulty: hard

A daily silver job joins about 1 million sales rows to dim_prices, which holds one row per (product_id, store_id) because prices vary by store. After the join runs, the silver table contains about 3 million rows and revenue totals are inflated. The suspicious line: ```python silver = (sales .join(dim_prices, "product_id") .withColumn("revenue", col("qty") * col("price"))) ``` What is the most likely cause, and the correct fix?

Options (Reading Mode) Click to filter discussion →
  1. A. The sales fact contains duplicate transactions — call dropDuplicates() with no subset before the join
  2. B. Spark picked the wrong physical join strategy — force a broadcast join with .hint('broadcast') so each sale matches exactly one price
  3. C. The join key is not unique in dim_prices, so sales fan out one row per store — join on both product_id and store_id
  4. D. dim_prices contains NULL prices that replicate rows during the join — filter out NULL prices before joining
Reveal answer

Correct answer: The join key is not unique in dim_prices, so sales fan out one row per store — join on both product_id and store_id

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 (C): The join key is not unique in dim_prices, so sales fan out one row per store — join on both product_id and store_id

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.