spark/internals
advanced
Connecting…

Catalyst optimizer

Catalyst rewrites your query four times. Exchange in the physical plan is the shuffle you will pay for.

Lesson 21 of 29 · Spark path

Explain it at my level

  1. Unresolved
  2. Analyzed
  3. Optimized
  4. Physical
Watch the canvas:logical stagephysical planLive simulation
1. Unresolved logicalnames only, no types2. Analyzed logicalcatalog resolved, types bound3. Optimized logicalpushdown, pruning, folding4. Physical planFileScan → Exchange → HashAggregate
Catalyst is four trees. Each one is a strictly better description of the same query.