Skip to main content

passthrough_field_index

Function passthrough_field_index 

Source
pub fn passthrough_field_index(expr: &Expr, schema: &DFSchema) -> Option<usize>
Expand description

Returns the index of the schema field that expr passes through unchanged, or None if expr computes a new value.

Only a column reference (possibly aliased) passes a field through. Use this instead of comparing Expr::schema_name with field names: different expressions can have the same name, e.g. CAST(t.a AS INT) is named t.a.

A column is resolved like any other column reference, so an ambiguous unqualified name (e.g. id over a.id and b.id) passes nothing through.