This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new abeb8b4f8d Make DefaultSchemaAdapterFactory public (#11709)
abeb8b4f8d is described below
commit abeb8b4f8d46b1852102c1da03aeb1d6fba6377f
Author: Adrian Garcia Badaracco <[email protected]>
AuthorDate: Wed Jul 31 07:31:45 2024 -0500
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 f485c49e91..40cb40a83a 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<RecordBatch>;
}
+/// 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<dyn SchemaAdapter> {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]