/// Return indices of the schema's fields of the selection columns
Return indices of the schema's fields of the selection columns
Return indices of the schema ' s fields of the selection columns
fn column_indices(selection: Selection<'_>, schema: SchemaRef) -> Vec<usize> {
    let fields = schema.fields().iter();
    match selection {
        Selection::Some(cols) => fields
            .enumerate()
            .filter_map(|(p, x)| {
                if cols.contains(&x.name().as_str()) {
                    Some(p)
                } else {
                    None
                }
            })
            .collect(),
        Selection::All => fields.enumerate().map(|(p, _)| p).collect(),
    }
}
fn column_indices ( selection : Selection < ' _ > , schema : SchemaRef ) -> Vec < usize > { let fields = schema . fields ( ) . iter ( ) ; match selection { Selection :: Some ( cols ) => fields . enumerate ( ) . filter_map ( | ( p , x ) | { if cols . contains ( & x . name ( ) . as_str ( ) ) { Some ( p ) } else { None } } ) . collect ( ) , Selection :: All => fields . enumerate ( ) . map ( | ( p , _ ) | p ) . collect ( ) , } }
Return indices of the schema's fields of the selection columns
Return indices of the schema ' s fields of the selection columns
selection
Selection<'_>
schema
SchemaRef