Skip to content
Gold 6 min read 2 practice problems ↓

Catalyst and physical plans

Read explain() output: parsed, analyzed and optimized plans, and the physical plan Spark runs.

Step 2 · Spark internals · Gold · Under the hood, lesson 1 of 5

Read first: Transformations vs actions · Narrow vs wide transformations (skip if you know them)

In plain words first

You tell a taxi driverdriver: The process that runs your program, plans the work and sends tasks to executors. Learn more → the address, not the turns. The driver works out a route, improves it (skip the road works, take the bypass) and then drives it. You can ask to see the route before you set off.

Catalyst is that driver: your code is the address, the optimised plan is the route, and explain() shows it to you.

Unlock the full lesson

You have read the free part. The rest of this advanced lesson:

  • From code to plan
  • What the optimiser does
  • Using explain
  • Reading a physical plan
  • Whole-stage code generation
  • Try it yourself
  • Common mistakes
  • Key takeaways
  • Interview prep with 3 follow-up questions
  • Check yourself: 3 questions

Unlock it with the Complete pass (every advanced problem and lesson) or on its own.

Practise this

Interview problems on spark performance, graded on hidden tests

Keep going

Up next · Under the hood · lesson 2 of 5 · 7 min read
The memory model
Execution vs storage memory, overhead, and what really causes spills and out-of-memory errors.

Related lessons

Previous: AQE skew-join handling

Primary sources: EXPLAIN · Performance tuning