alamb commented on code in PR #13063: URL: https://github.com/apache/datafusion/pull/13063#discussion_r1815673753
########## datafusion/core/src/datasource/schema_adapter.rs: ########## @@ -79,11 +87,17 @@ pub trait SchemaAdapter: Send + Sync { ) -> datafusion_common::Result<(Arc<dyn SchemaMapper>, Vec<usize>)>; } -/// Maps, by casting or reordering columns from the file schema to the table -/// schema. +/// Maps, columns from the file schema to the table schema. +/// +/// See [`DefaultSchemaAdapterFactory`] for more details and examples. pub trait SchemaMapper: Debug + Send + Sync { - /// Adapts a `RecordBatch` to match the `table_schema` using the stored - /// mapping and conversions. + /// Adapts a `RecordBatch` to match the `table_schema` + /// + /// # Errors: + /// + /// * If a column in the table schema is non-nullable but is not present + /// in the file schema (i.e. it is missing), this method tries to fill it + /// with nulls resulting in a schema error Review Comment: It is a good call -- tried to clarify in d966fd112 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org