Noos
PT EN
RAN-DBDEA-00035
Ranvier · DBDEA

Exam DBDEA Topics: transformation Difficulty: medium

An events bronze table landed event_time as STRING values like '2026-03-14 09:30:00' and amount as STRING values like '125.50'. The silver table must standardize the types: event_time as TIMESTAMP and amount as DOUBLE, keeping the same column names and all other columns unchanged. ```python bronze = spark.read.table("catalog.ops.bronze_events") silver = <type standardization step> silver.write.saveAsTable("catalog.ops.silver_events") ``` Which step standardizes the data types correctly?

Options (Reading Mode) Click to filter discussion →
  1. A. silver = bronze.withColumnRenamed('event_time', 'event_time_ts').withColumnRenamed('amount', 'amount_double').withColumnRenamed('cust', 'customer')
  2. B. bronze.withColumn('event_time', col('event_time').cast('timestamp')).withColumn('amount', col('amount').cast('double'))
  3. C. silver = bronze.select(col('event_time').cast('date'), col('amount').cast('double'))
  4. D. silver = bronze.withColumn('event_time', to_date('event_time'))
Reveal answer

Correct answer: bronze.withColumn('event_time', col('event_time').cast('timestamp')).withColumn('amount', col('amount').cast('double'))

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 (B): bronze.withColumn('event_time', col('event_time').cast('timestamp')).withColumn('amount', col('amount').cast('double'))

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.