MCPcopy Create free account
hub / github.com/apache/datafusion / exprlist_to_fields

Function exprlist_to_fields

datafusion/expr/src/utils.rs:755–765  ·  view source on GitHub ↗

Create schema fields from an expression list, for use in result set schema construction This function converts a list of expressions into a list of complete schema fields, making comprehensive determinations about each field's properties including: - **Data type**: Resolved based on expression type and input schema context - **Nullability**: Determined by expression-specific nullability rules - *

(
    exprs: impl IntoIterator<Item = &'a Expr>,
    plan: &LogicalPlan,
)

Source from the content-addressed store, hash-verified

753/// where each Field contains complete schema information (type, nullability, metadata)
754/// and proper table reference scoping for the corresponding expression.
755pub fn exprlist_to_fields<'a>(
756 exprs: impl IntoIterator<Item = &'a Expr>,
757 plan: &LogicalPlan,
758) -> Result<Vec<(Option<TableReference>, Arc<Field>)>> {
759 // Look for exact match in plan's output schema
760 let input_schema = plan.schema();
761 exprs
762 .into_iter()
763 .map(|e| e.to_field(input_schema))
764 .collect()
765}
766
767/// Convert an expression into Column expression if it's already provided as input plan.
768///

Callers 3

projection_schemaFunction · 0.85
try_newMethod · 0.85

Calls 5

collectMethod · 0.80
to_fieldMethod · 0.80
schemaMethod · 0.45
mapMethod · 0.45
into_iterMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…