Cert EspressoLearn. Practise. Find your flow.

A LITTLE FOCUS.
A BIG NEXT STEP.

Your pace. Your space.
Databricks · Databricks Data Engineer Professional

Logs, the Spark UI, and repairing runs

Databricks Data Engineer Professional · Lesson 19 of 21 · 2:34:56

YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗

Learning with these videos? Subscribe for new courses and exam-style questions.

In this lesson

Prepare for the Databricks Certified Data Engineer Professional exam. In this lesson: diagnosing a failed job: where to look (logs, the compute event log, and the Spark UI), reading the clues (spill, skew, and errors), and repairing a run. Includes three original practice questions.

Study notes

The text of this lesson, to read at your own pace. Information as of November 2026.

A failed night

At Quayside Eats, the nightly job failed: the silver task broke, and the gold tasks after it were skipped. The team must find the cause, and run again only what failed, with a corrected date. This lesson covers where to look, how to read the clues, and how to repair a run.

Where to look

Start with the task run details in the Jobs UI: the output, the error message, and the matrix view of past runs. On classic compute, the driver logs hold the stdout, stderr, and log4j output of notebooks and libraries, and by default, only users with can manage on the compute can see them, since secrets are not redacted there. The compute event log shows lifecycle events, like creation, termination, and configuration edits, and logs can also be delivered to a storage location. The Spark UI shows the jobs, stages, and tasks of a run, while system tables, like system.lakeflow.job_task_run_timeline and system.compute.node_timeline, show failures and utilization across many runs. And on serverless compute, there is no Spark UI: query insights and the query profile take its place.

Reading the clues

In the Spark UI, open the longest stage, and compare the summary metrics of its tasks. When the slowest task takes far longer than most of the others, the data is skewed: add a salt to the key, or let adaptive query execution split the large partitions of a join. Spill means that tasks ran out of execution memory and wrote data to disk, so process fewer rows, set shuffle partitions to auto, or give each executor more memory. Large shuffle reads and writes point to wide joins and aggregations: filter early, and broadcast small tables. And an out of memory error on the driver points to large collect calls, or too much work outside Spark, which a larger driver or less concurrency can fix.

Repairing a run

Once the cause is fixed, repair the run: a repair runs again only the failed or canceled tasks, and the tasks that depend on them, so the successful ones are not run again. Unsuccessful tasks run with the current job and task settings, so a corrected notebook path or a cluster change applies right away. In the repair job run dialog, the parameters you enter override the existing values, and on a later repair, clearing a key returns it to its original value. A repair runs each task from the beginning, so a task that appended part of its output can write the same rows twice: choose overwrite or merge where that matters. And repair needs at least two tasks: a failed single task job is started again with run now, or run now with different parameters.

Recap

Let's recap. Task run details, driver logs, the compute event log, the Spark UI, and system tables each answer a different question. Driver logs hold stdout, stderr, and log4j output, and by default, only users with can manage can see them. In the Spark UI, one very slow task means skew, spill means too little memory, and large shuffles mean wide joins. A repair runs again only the failed tasks and their dependents, with the current settings. And parameters set in the repair dialog override the existing values.

Quick checks for this lesson

The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.

  1. A notebook task on classic job compute failed with a short error message. The team wants the full Python stack trace, and the messages that the code printed. Where should the data engineer look?

    • The compute event log
    • The driver logs of the job compute
    • system.billing.usage
    • The query history of a SQL warehouse
    Show the answer

    The driver logs of the job compute

    The driver logs hold stdout and stderr, with the messages the code printed and the full stack trace. “The compute event log” shows lifecycle events of the compute, like creation and termination. “system.billing.usage” shows usage and costs, not errors. And “The query history of a SQL warehouse” only covers queries that ran on SQL warehouses.

  2. In the Spark UI, the longest stage of a job shows a median task time of 20 seconds, and a maximum of 14 minutes. What does this point to?

    • Spill to disk in every task
    • Too few workers in the cluster
    • An overloaded driver node
    • Skew: a few keys hold most of the rows
    Show the answer

    Skew: a few keys hold most of the rows

    When one task takes far longer than the median, a few keys hold most of the rows, and that task does most of the work. “Spill to disk in every task” would slow many tasks, and would show as spill in the metrics. “Too few workers in the cluster” would not help, since more workers cannot split the work of one task. And “An overloaded driver node” would slow the whole job, not a single task of one stage.

  3. The nightly job has five tasks. The silver task failed because its run_date parameter was wrong, the two gold tasks after it were skipped, and the first two tasks succeeded. What should the data engineer do?

    • Repair the run, with run_date overridden in the dialog
    • Run now with different parameters
    • Run the silver and gold notebooks by hand
    • Fix the default value, and wait for the next night
    Show the answer

    Repair the run, with run_date overridden in the dialog

    A repair runs again only the failed silver task and the two skipped gold tasks, with the run date overridden. “Run now with different parameters” would run all five tasks again, including the two that already succeeded. “Run the silver and gold notebooks by hand” would work outside the job, by hand, with no run history to follow. And “Fix the default value, and wait for the next night” would leave the gold tables late until the next night.