Noos
PT EN
RAN-DBDEA-00223
Ranvier · DBDEA

Exam DBDEA Topics: transformation Difficulty: medium

A bronze events table stores customer details in a nested column, declared as follows: ```sql customer STRUCT<name: STRING, address: STRUCT<city: STRING, country: STRING>> ``` The silver table must expose the customer's city as a top-level column. The engineer wants the simplest native way to read that nested field, without flattening or custom code. Which approach is correct?

Options (Reading Mode) Click to filter discussion →
  1. A. Dot notation — select customer.address.city, which resolves nested struct fields natively in SQL and PySpark; arrays use bracket indexing like items[0]
  2. B. Explode the structs first — a nested field can only be read after the entire struct has been flattened into separate rows of the DataFrame
  3. C. Rewrite the transformation in SQL — PySpark DataFrames cannot traverse fields that live inside a struct column
  4. D. Register a Python UDF — native functions cannot reach inside a struct, so the field must be parsed out in custom code
Reveal answer

Correct answer: Dot notation — select customer.address.city, which resolves nested struct fields natively in SQL and PySpark; arrays use bracket indexing like items[0]

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

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): Dot notation — select customer.address.city, which resolves nested struct fields natively in SQL and PySpark; arrays use bracket indexing like items[0]

⚓ Official Documentation Anchor: https://docs.databricks.com/aws/en/pyspark/reference
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.