QuestionQ232

VerifiedProductionizing Data Pipelines

A data engineer is troubleshooting two separate pipeline failures:

  • Pipeline A fails with a java.lang.OutOfMemoryError immediately after the command display(df.collect()) is executed on a 100GB dataset.
  • Pipeline B fails during a wide transformation (a join between two large tables) with an ExecutorLostFailure error, indicating that executor memory was exhausted during the shuffle.

What action should the data engineer take to resolve both of these issues?

Explanation

Pipeline A fails because collect() forces the entire 100GB dataset to be materialized in the driver's memory, which is a well-documented cause of driver-side OutOfMemoryErrors; increasing spark.driver.memory gives the driver enough heap to handle the collected data (though avoiding collect() on large datasets is best practice). Pipeline B's ExecutorLostFailure during a shuffle-heavy join indicates that individual shuffle partitions are too large for the available executor memory; increasing spark.sql.shuffle.partitions creates smaller, more evenly distributed partitions, and/or increasing executor memory gives each executor more headroom to process shuffle data without exhausting memory. These are the standard Spark memory-tuning remediations documented in Spark's configuration and tuning guides.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!