A scenario for a platform engineer · Junior and up
The job died with an out of memory error
Beep · On call
Tuesday, 03:10
A nightly Databricks job fails on the driver with an out of memory error. Its last step calls collect() on a table that has grown to 80 million rows.
What do you do?
Tap the one you would do. The answer opens below.
Show the best callThe best call
Stop collecting. Write the result to a table, or aggregate first and bring back only the summary.
The work stays on the workers, where the memory is, and the job passes.
Why
collect() and toPandas() pull every row to the driver, which is one machine. That works for small results and fails as data grows. Keep large data in DataFrames and tables, so the workers handle it.
Read it in the Databricks docs (opens in a new tab)The other two
- Works, at a price. Give the driver a much larger machine.
- It may pass tonight. The table keeps growing, and the same error comes back.
- A poor call. Set the job to retry three times.
- It fails four times in a row for the same reason, and the night is gone.
The words in this scenario
- Driver.
- The one machine in a cluster that plans the work and hands it to the workers. Results that are collected come back to it. In the docs (opens in a new tab)
Go deeper on brickster.ai
- Apache Spark: what changed recentlyNews, releases, videos and questions on it, gathered daily.
- Follow cost optimizationNews, releases, videos and questions on it, gathered daily.
More scenarios
- Which team spent the money? · platform engineer
- Dashboards queue at nine · platform engineer
- Cut the cost of the night jobs · platform engineer
- All 47 scenarios
Had one like this at work? Send it to us: the best tickets come from real incidents.
Checked against the Databricks documentation on . brickster.ai is independent and is not affiliated with Databricks.