Home / DE Associate practice test / Data Ingestion and Loading / Question

Databricks Data Engineer Associate · free practice question

Incoming JSON events contain a nested `address` object with `city` and `zip` fields. A silver table needs `city` and `zip` as top-level columns for BI. Using…

Exam-style question on Data Ingestion and Loading from the free DE Associate practice test, with the answer and a full explanation below.

Updated November 10, 2026

Data Ingestion and Loading

Incoming JSON events contain a nested address object with city and zip fields. A silver table needs city and zip as top-level columns for BI. Using PySpark, which operation correctly promotes the nested fields?

  1. ACall explode(col("address")) on the struct, which unpacks the nested object and emits city and zip as separate top-level columns.
  2. BCast address to STRING and extract city and zip with regexp_extract, assigning each captured group to a new top-level column.
  3. CDrop address and re-ingest the JSON with a flat schema, as struct fields are not readable after the data is written to a Delta table.
  4. DSelect the fields with dot notation: df.select(col("address.city").alias("city"), col("address.zip").alias("zip")) on the DataFrame.
  5. EUse groupBy().pivot("address") on the DataFrame, which turns the keys of the nested object into city and zip top-level columns.
Answer & explanation

Correct answer: D

WHY D: Nested struct fields are accessed with dot notation (address.city); selecting and aliasing them promotes them to top-level columns.

WHY NOT A: explode is for arrays (and maps), not struct field access.

WHY NOT B: Regex parsing of a stringified struct is fragile and unnecessary when structured access exists.

WHY NOT C: Delta fully supports nested structs; they remain readable after the write.

WHY NOT E: pivot reshapes rows to columns by aggregation; it does not flatten a struct.

Take the full DE Associate practice test free →

Would you pass today?

This question is one of 45 in the free, timed Databricks Data Engineer Associate practice test. Take it and get a section-by-section score.

Start the free test →