Render the logical plan as an indented tree — the root operation on
the first line, inputs two spaces deeper, expressions in their
documented Show form, and SCAN [rows×cols] leaves:
SELECT [col(region), col(adj)]
WITH_COLUMNS [(col(revenue) * 1.1) as adj]
FILTER (col(region) == "west")
SCAN [4×3]
By default this is the plan as built — a faithful mirror of the
chained verbs, which is the package's contract. Pass optimized=true
to render the plan collect actually runs instead: a sunk FILTER
appears below the stages it crossed — or disappears into the leaf as a
WHERE suffix, when the stage it reaches is a file source that can apply
it while reading — and the projection pushdown shows
up as a narrowing SELECT over an in-memory SCAN or as the column list
on a SCAN_CSV source, so printing both forms is the before/after view
of what the optimizer moved and pruned. (Polars' LazyFrame::explain(optimized) is the
namesake; plans are immutable, so the flag rewrites a copy and never
perturbs this frame.)
Total either way — the rewrite is a pure tree walk, so a plan that
would fail to collect still explains, which is the point: inspect
first, compute later.