exprlist_to_fields

Function exprlist_to_fields 

Source
pub fn exprlist_to_fields<'a>(
    exprs: impl IntoIterator<Item = &'a Expr>,
    plan: &LogicalPlan,
) -> Result<Vec<(Option<TableReference>, Arc<Field>)>>
Expand description

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
  • Metadata: Computed based on expression type (preserving, merging, or generating new metadata)
  • Table reference scoping: Establishing proper qualified field references

Each expression is converted to a field by calling Expr::to_field, which performs the complete field resolution process for all field properties.

§Returns

A Result containing a vector of (Option<TableReference>, Arc<Field>) tuples, where each Field contains complete schema information (type, nullability, metadata) and proper table reference scoping for the corresponding expression.