From abeb8b4f8d46b1852102c1da03aeb1d6fba6377f Mon Sep 17 00:00:00 2001 From: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com> Date: Wed, 31 Jul 2024 07:31:45 -0500 Subject: [PATCH] Make DefaultSchemaAdapterFactory public (#11709) This seems like a nice self-contained API that would be useful for downstream consumers of DataFusion --- datafusion/core/src/datasource/schema_adapter.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/datafusion/core/src/datasource/schema_adapter.rs b/datafusion/core/src/datasource/schema_adapter.rs index f485c49e9109..40cb40a83af2 100644 --- a/datafusion/core/src/datasource/schema_adapter.rs +++ b/datafusion/core/src/datasource/schema_adapter.rs @@ -92,8 +92,10 @@ pub trait SchemaMapper: Debug + Send + Sync { ) -> datafusion_common::Result; } +/// Basic implementation of [`SchemaAdapterFactory`] that maps columns by name +/// and casts columns to the expected type. #[derive(Clone, Debug, Default)] -pub(crate) struct DefaultSchemaAdapterFactory {} +pub struct DefaultSchemaAdapterFactory {} impl SchemaAdapterFactory for DefaultSchemaAdapterFactory { fn create(&self, table_schema: SchemaRef) -> Box {