Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
SchemaMapper in datafusion::datasource::schema_adapter - Rust
[go: Go Back, main page]

datafusion::datasource::schema_adapter

Trait SchemaMapper

Source
pub trait SchemaMapper:
    Debug
    + Send
    + Sync {
    // Required methods
    fn map_batch(&self, batch: RecordBatch) -> Result<RecordBatch>;
    fn map_partial_batch(&self, batch: RecordBatch) -> Result<RecordBatch>;
}
Expand description

Maps, columns from a specific file schema to the table schema.

See DefaultSchemaAdapterFactory for more details and examples.

Required Methods§

Source

fn map_batch(&self, batch: RecordBatch) -> Result<RecordBatch>

Adapts a RecordBatch to match the table_schema

Source

fn map_partial_batch(&self, batch: RecordBatch) -> Result<RecordBatch>

Adapts a RecordBatch that does not have all the columns from the file schema.

This method is used, for example, when applying a filter to a subset of the columns as part of DataFusionArrowPredicate when filter_pushdown is enabled.

This method is slower than map_batch as it looks up columns by name.

Implementors§