expand_projection#

DownloadExpr.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 — UnnestExpr today, 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_schema is the schema of the operator’s input, or None when it is not known at plan time (e.g. downstream of an opaque map_batches); an implementation that cannot expand without it should raise rather than defer to runtime.