expand_projection#
- UnaryExpr.expand_projection(input_schema: Schema | None) List[Expr]#
Return the projection-list entries this expression stands for.
Almost every expression denotes exactly one output column and so returns
[self]. An expression that denotes several columns —UnnestExprtoday, a regex column selector tomorrow — overrides this to expand itself into ordinary named expressions.Project.__post_init__applies this once, when the plan is built, so optimizer rules and the evaluation engine only ever see single-column expressions.input_schemais the schema of the operator’s input, orNonewhen it is not known at plan time (e.g. downstream of an opaquemap_batches); an implementation that cannot expand without it should raise rather than defer to runtime.