Noos
PT EN
RAN-DBDEA-00224
Ranvier · DBDEA

Exam DBDEA Topics: transformation Difficulty: medium

A data engineer builds an intermediate DataFrame in her notebook: a read of a large Parquet dataset from cloud storage, a join with a 5 GB dimension, a filter to active regions, and a deduplication pass. Five cells later in the same notebook reuse that DataFrame, and each one currently re-runs the whole lineage, taking about six minutes per cell. She wants the reuse to be fast and the memory released when the notebook ends. Which approach fits?

Options (Reading Mode) Click to filter discussion →
  1. A. Call cache() before the first action runs, so that even the initial computation that materializes the DataFrame becomes faster
  2. B. Call cache() in the very first cell and rely on the cached data surviving cluster termination, so that tomorrow's job run reuses it
  3. C. Do nothing, because Spark automatically caches every DataFrame in memory after its first action and reuses it for free
  4. D. Call cache() on the DataFrame, materialize it with an action once, and call unpersist() when the last consuming cell finishes
Reveal answer

Correct answer: Call cache() on the DataFrame, materialize it with an action once, and call unpersist() when the last consuming cell finishes

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 (D): Call cache() on the DataFrame, materialize it with an action once, and call unpersist() when the last consuming cell finishes

⚓ 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.