pub fn projection_schema(
input: &LogicalPlan,
exprs: &[Expr],
) -> Result<Arc<DFSchema>>Expand description
Computes the schema of the result produced by applying a projection to the input logical plan.
§Arguments
input: A reference to the inputLogicalPlanfor which the projection schema will be computed.exprs: A slice ofExprexpressions representing the projection operation to apply.
§Metadata Handling
- Schema-level metadata: Passed through unchanged from the input schema
- Field-level metadata: Determined by each expression via
exprlist_to_fields, which callsExpr::to_fieldto handle expression-specific metadata (literals, aliases, etc.)
§Returns
A Result containing an Arc<DFSchema> representing the schema of the result
produced by the projection operation. If the schema computation is successful,
the Result will contain the schema; otherwise, it will contain an error.