nerdexam
Microsoft

DP-203 · Question #427

You have an Azure subscription that contains an Azure Data Lake Storage Gen2 container named Container1 and an Azure Synapse Analytics workspace named Workspace1. Workspace1 contains multiple Apache S

The correct answer is B. Cache the dataset.. When multiple Spark jobs repeatedly read the same large dataset from ADLS Gen2, persisting that dataset in memory via caching eliminates redundant storage I/O and significantly reduces job run times.

Submitted by akirajp· Mar 30, 2026Secure, monitor, and optimize data storage and data processing

Question

You have an Azure subscription that contains an Azure Data Lake Storage Gen2 container named Container1 and an Azure Synapse Analytics workspace named Workspace1. Workspace1 contains multiple Apache Spark jobs that reference a large dataset in Container1. You need to optimize the run times of the jobs. What should you do?

Options

  • AFor Container1, disable hierarchical namespaces.
  • BCache the dataset.
  • CIncrease the spark.sql.autoBroadcastJoinThreshold value.
  • DUse Resilient Distributed Datasets (RDDs).

How the community answered

(42 responses)
  • A
    2% (1)
  • B
    79% (33)
  • C
    14% (6)
  • D
    5% (2)

Why each option

When multiple Spark jobs repeatedly read the same large dataset from ADLS Gen2, persisting that dataset in memory via caching eliminates redundant storage I/O and significantly reduces job run times.

AFor Container1, disable hierarchical namespaces.

Disabling hierarchical namespaces on an ADLS Gen2 container removes directory-level operations and would degrade, not improve, performance for workloads that rely on directory semantics.

BCache the dataset.Correct

Spark's DataFrame.cache() (or persist()) stores the dataset in executor memory after the first read, so subsequent jobs or actions access in-memory data instead of re-reading from ADLS Gen2, directly reducing the I/O bottleneck that slows repeated reads of a large shared dataset.

CIncrease the spark.sql.autoBroadcastJoinThreshold value.

Increasing spark.sql.autoBroadcastJoinThreshold allows larger tables to be broadcast in join operations, which optimizes join performance but does not address repeated full reads of a large shared dataset.

DUse Resilient Distributed Datasets (RDDs).

Using RDDs instead of DataFrames bypasses Spark's Catalyst optimizer and Tungsten execution engine, which typically results in worse, not better, performance for large datasets.

Concept tested: Caching shared datasets to optimize Spark job performance

Source: https://learn.microsoft.com/en-us/azure/synapse-analytics/spark/apache-spark-performance

Topics

#Spark optimization#dataset caching#Apache Spark#performance tuning

Community Discussion

No community discussion yet for this question.

Full DP-203 Practice