create_field_mapping

Function create_field_mapping 

Source
pub(crate) fn create_field_mapping<F>(
    file_schema: &Schema,
    projected_table_schema: &SchemaRef,
    can_map_field: F,
) -> Result<(Vec<Option<usize>>, Vec<usize>)>
where F: Fn(&Field, &Field) -> Result<bool>,
Expand description

Helper function that creates field mappings between file schema and table schema

Maps columns from the file schema to their corresponding positions in the table schema, applying type compatibility checking via the provided predicate function.

Returns field mappings (for column reordering) and a projection (for field selection).