Noos
PT EN
RAN-DBDEA-00043
Ranvier · DBDEA

Exam DBDEA Topics: transformation Difficulty: medium

Building catalog.sales.silver_customers from bronze, an engineer must: (1) split the STRING column full_name on the single space character into two new STRING columns, first_name and last_name; (2) drop full_name and the PII column ssn; (3) rename cust_id to customer_id. A teammate proposes: ```python silver = (bronze .withColumn("first_name", split(col("full_name"), " ")) .withColumn("last_name", split(col("full_name"), " ")) .drop("full_name", "ssn") .withColumnRenamed("cust_id", "customer_id")) ``` What is wrong with this proposal?

Options (Reading Mode) Click to filter discussion →
  1. A. Nothing is wrong — the chain meets all three requirements as written
  2. B. drop() cannot remove two columns in a single call — full_name and ssn must be dropped in separate drop() calls
  3. C. split() returns an ARRAY, so the new columns would hold arrays — use .getItem(0) and .getItem(1)
  4. D. withColumnRenamed('cust_id', 'customer_id') renames in the wrong direction — the arguments are (new, existing)
Reveal answer

Correct answer: split() returns an ARRAY, so the new columns would hold arrays — use .getItem(0) and .getItem(1)

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): split() returns an ARRAY, so the new columns would hold arrays — use .getItem(0) and .getItem(1)

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.