Noos
PT EN
RAN-DBDEA-00134
Ranvier · DBDEA

Exam DBDEA Topics: transformation Difficulty: easy

A PySpark job reads a Delta table into a DataFrame that currently has 200 partitions spread across the cluster. Before writing the result, the team wants to end up with 8 partitions to avoid producing hundreds of tiny output files, but without paying for a full shuffle of the data. Which operation should they use?

Options (Reading Mode) Click to filter discussion →
  1. A. repartition(8), the only DataFrame operation able to reduce the number of partitions
  2. B. coalesce(8), which always preserves the current data distribution across the worker nodes
  3. C. coalesce(8), which merges existing partitions into fewer ones without a full shuffle
  4. D. either operation, because repartition and coalesce are synonyms that differ only in naming
Reveal answer

Correct answer: coalesce(8), which merges existing partitions into fewer ones without a full shuffle

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 (C): coalesce(8), which merges existing partitions into fewer ones without a full shuffle

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