pub fn with_new_schema(
    expr: Arc<dyn PhysicalExpr>,
    schema: &SchemaRef,
) -> Result<Arc<dyn PhysicalExpr>>
Expand description

Rewrites an expression according to new schema; i.e. changes the columns it refers to with the column at corresponding index in the new schema. Returns an error if the given schema has fewer columns than the original schema. Note that the resulting expression may not be valid if data types in the new schema is incompatible with expression nodes.