pub trait SchemaAdapterFactory:
Debug
+ Send
+ Sync
+ 'static {
// Required method
fn create(
&self,
projected_table_schema: SchemaRef,
table_schema: SchemaRef,
) -> Box<dyn SchemaAdapter>;
// Provided method
fn create_with_projected_schema(
&self,
projected_table_schema: SchemaRef,
) -> Box<dyn SchemaAdapter> { ... }
}Expand description
Factory for creating SchemaAdapter
This interface provides a way to implement custom schema adaptation logic for DataSourceExec (for example, to fill missing columns with default value other than null).
Most users should use DefaultSchemaAdapterFactory. See that struct for
more details and examples.
Required Methods§
Sourcefn create(
&self,
projected_table_schema: SchemaRef,
table_schema: SchemaRef,
) -> Box<dyn SchemaAdapter>
fn create( &self, projected_table_schema: SchemaRef, table_schema: SchemaRef, ) -> Box<dyn SchemaAdapter>
Create a SchemaAdapter
Arguments:
-
projected_table_schema: The schema for the table, projected to include only the fields being output (projected) by the this mapping. -
table_schema: The entire table schema for the table
Provided Methods§
Sourcefn create_with_projected_schema(
&self,
projected_table_schema: SchemaRef,
) -> Box<dyn SchemaAdapter>
fn create_with_projected_schema( &self, projected_table_schema: SchemaRef, ) -> Box<dyn SchemaAdapter>
Create a SchemaAdapter using only the projected table schema.
This is a convenience method for cases where the table schema and the projected table schema are the same.