Noos
PT EN
RAN-DBDEA-00226
Ranvier · DBDEA

Exam DBDEA Topics: transformation Difficulty: hard

A re-delivered bronze file duplicated customer records: the same customer_id now appears up to three times, and the copies differ in their updated_at values, so no two rows are fully identical. For the silver table, the team must end up with exactly one row per customer_id, and keeping any one of the copies is acceptable. A teammate proposes calling distinct() on the bronze DataFrame. What is the difference between the two candidate calls?

Options (Reading Mode) Click to filter discussion →
  1. A. distinct() compares every column, so rows that differ in updated_at all survive; dropDuplicates(['customer_id']) keeps a single row per key
  2. B. distinct() and dropDuplicates() are interchangeable, so the teammate's call would already deduplicate on the customer_id key
  3. C. distinct() accepts a column list, as in distinct('customer_id'), and deduplicates on just the columns passed to it
  4. D. dropDuplicates(['customer_id']) cannot work by itself; it must be combined with a row_number() window to pick the surviving row
Reveal answer

Correct answer: distinct() compares every column, so rows that differ in updated_at all survive; dropDuplicates(['customer_id']) keeps a single row per key

Reference: https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-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 (A): distinct() compares every column, so rows that differ in updated_at all survive; dropDuplicates(['customer_id']) keeps a single row per key

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.