Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions datafusion/catalog-listing/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,12 +292,14 @@ impl ListingTableConfig {
/// Deprecated: Set the [`SchemaAdapterFactory`] for the [`crate::ListingTable`]
///
/// `SchemaAdapterFactory` has been removed. Use [`Self::with_expr_adapter_factory`]
/// and `PhysicalExprAdapterFactory` instead. See `upgrading.md` for more details.
/// and `PhysicalExprAdapterFactory` instead. See the [52.0.0 upgrade guide] for more details.
///
/// [52.0.0 upgrade guide]: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed
///
/// This method is a no-op and returns `self` unchanged.
#[deprecated(
since = "52.0.0",
note = "SchemaAdapterFactory has been removed. Use with_expr_adapter_factory and PhysicalExprAdapterFactory instead. See upgrading.md for more details."
note = "SchemaAdapterFactory has been removed. Use with_expr_adapter_factory and PhysicalExprAdapterFactory instead. See the 52.0.0 upgrade guide for more details: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed"
)]
#[expect(deprecated)]
pub fn with_schema_adapter_factory(
Expand Down
12 changes: 8 additions & 4 deletions datafusion/catalog-listing/src/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,14 @@ impl ListingTable {
/// Deprecated: Set the [`SchemaAdapterFactory`] for this [`ListingTable`]
///
/// `SchemaAdapterFactory` has been removed. Use [`ListingTableConfig::with_expr_adapter_factory`]
/// and `PhysicalExprAdapterFactory` instead. See `upgrading.md` for more details.
/// and `PhysicalExprAdapterFactory` instead. See the [52.0.0 upgrade guide] for more details.
///
/// [52.0.0 upgrade guide]: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed
///
/// This method is a no-op and returns `self` unchanged.
#[deprecated(
since = "52.0.0",
note = "SchemaAdapterFactory has been removed. Use ListingTableConfig::with_expr_adapter_factory and PhysicalExprAdapterFactory instead. See upgrading.md for more details."
note = "SchemaAdapterFactory has been removed. Use ListingTableConfig::with_expr_adapter_factory and PhysicalExprAdapterFactory instead. See the 52.0.0 upgrade guide for more details: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed"
)]
#[expect(deprecated)]
pub fn with_schema_adapter_factory(
Expand Down Expand Up @@ -369,12 +371,14 @@ impl ListingTable {
/// Deprecated: Returns the [`SchemaAdapterFactory`] used by this [`ListingTable`].
///
/// `SchemaAdapterFactory` has been removed. Use `PhysicalExprAdapterFactory` instead.
/// See `upgrading.md` for more details.
/// See the [52.0.0 upgrade guide] for more details.
///
/// [52.0.0 upgrade guide]: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed
///
/// Always returns `None`.
#[deprecated(
since = "52.0.0",
note = "SchemaAdapterFactory has been removed. Use PhysicalExprAdapterFactory instead. See upgrading.md for more details."
note = "SchemaAdapterFactory has been removed. Use PhysicalExprAdapterFactory instead. See the 52.0.0 upgrade guide for more details: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed"
)]
#[expect(deprecated)]
pub fn schema_adapter_factory(&self) -> Option<Arc<dyn SchemaAdapterFactory>> {
Expand Down
14 changes: 9 additions & 5 deletions datafusion/datasource/src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,28 +340,32 @@ pub trait FileSource: Any + Send + Sync {
/// Deprecated: Set optional schema adapter factory.
///
/// `SchemaAdapterFactory` has been removed. Use `PhysicalExprAdapterFactory` instead.
/// See `upgrading.md` for more details.
/// See the [52.0.0 upgrade guide] for more details.
///
/// [52.0.0 upgrade guide]: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed
#[deprecated(
since = "53.0.0",
note = "SchemaAdapterFactory has been removed. Use PhysicalExprAdapterFactory instead. See upgrading.md for more details."
note = "SchemaAdapterFactory has been removed. Use PhysicalExprAdapterFactory instead. See the 52.0.0 upgrade guide for more details: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed"
)]
#[expect(deprecated)]
fn with_schema_adapter_factory(
&self,
_factory: Arc<dyn SchemaAdapterFactory>,
) -> Result<Arc<dyn FileSource>> {
not_impl_err!(
"SchemaAdapterFactory has been removed. Use PhysicalExprAdapterFactory instead. See upgrading.md for more details."
"SchemaAdapterFactory has been removed. Use PhysicalExprAdapterFactory instead. See the 52.0.0 upgrade guide for more details: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed"
)
}

/// Deprecated: Returns the current schema adapter factory if set.
///
/// `SchemaAdapterFactory` has been removed. Use `PhysicalExprAdapterFactory` instead.
/// See `upgrading.md` for more details.
/// See the [52.0.0 upgrade guide] for more details.
///
/// [52.0.0 upgrade guide]: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed
#[deprecated(
since = "53.0.0",
note = "SchemaAdapterFactory has been removed. Use PhysicalExprAdapterFactory instead. See upgrading.md for more details."
note = "SchemaAdapterFactory has been removed. Use PhysicalExprAdapterFactory instead. See the 52.0.0 upgrade guide for more details: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed"
)]
#[expect(deprecated)]
fn schema_adapter_factory(&self) -> Option<Arc<dyn SchemaAdapterFactory>> {
Expand Down
50 changes: 32 additions & 18 deletions datafusion/datasource/src/schema_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

//! Deprecated: [`SchemaAdapter`] and [`SchemaAdapterFactory`] have been removed.
//!
//! Use [`PhysicalExprAdapterFactory`] instead. See `upgrading.md` for more details.
//! Use [`PhysicalExprAdapterFactory`] instead. See the [52.0.0 upgrade guide] for more details.
//!
//! [52.0.0 upgrade guide]: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed
//!
//! [`PhysicalExprAdapterFactory`]: datafusion_physical_expr_adapter::PhysicalExprAdapterFactory

Expand All @@ -20,12 +22,14 @@ use std::sync::Arc;
/// Deprecated: Function type for casting columns.
///
/// This type has been removed. Use [`PhysicalExprAdapterFactory`] instead.
/// See `upgrading.md` for more details.
/// See the [52.0.0 upgrade guide] for more details.
///
/// [52.0.0 upgrade guide]: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed
///
/// [`PhysicalExprAdapterFactory`]: datafusion_physical_expr_adapter::PhysicalExprAdapterFactory
#[deprecated(
since = "52.0.0",
note = "SchemaAdapter has been removed. Use PhysicalExprAdapterFactory instead. See upgrading.md for more details."
note = "SchemaAdapter has been removed. Use PhysicalExprAdapterFactory instead. See the 52.0.0 upgrade guide for more details: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed"
)]
pub type CastColumnFn = dyn Fn(&ArrayRef, &Field, &arrow::compute::CastOptions) -> Result<ArrayRef>
+ Send
Expand All @@ -34,12 +38,14 @@ pub type CastColumnFn = dyn Fn(&ArrayRef, &Field, &arrow::compute::CastOptions)
/// Deprecated: Factory for creating [`SchemaAdapter`].
///
/// This trait has been removed. Use [`PhysicalExprAdapterFactory`] instead.
/// See `upgrading.md` for more details.
/// See the [52.0.0 upgrade guide] for more details.
///
/// [52.0.0 upgrade guide]: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed
///
/// [`PhysicalExprAdapterFactory`]: datafusion_physical_expr_adapter::PhysicalExprAdapterFactory
#[deprecated(
since = "52.0.0",
note = "SchemaAdapter has been removed. Use PhysicalExprAdapterFactory instead. See upgrading.md for more details."
note = "SchemaAdapter has been removed. Use PhysicalExprAdapterFactory instead. See the 52.0.0 upgrade guide for more details: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed"
)]
pub trait SchemaAdapterFactory: Debug + Send + Sync + 'static {
/// Create a [`SchemaAdapter`]
Expand All @@ -61,12 +67,14 @@ pub trait SchemaAdapterFactory: Debug + Send + Sync + 'static {
/// Deprecated: Creates [`SchemaMapper`]s to map file-level [`RecordBatch`]es to a table schema.
///
/// This trait has been removed. Use [`PhysicalExprAdapterFactory`] instead.
/// See `upgrading.md` for more details.
/// See the [52.0.0 upgrade guide] for more details.
///
/// [52.0.0 upgrade guide]: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed
///
/// [`PhysicalExprAdapterFactory`]: datafusion_physical_expr_adapter::PhysicalExprAdapterFactory
#[deprecated(
since = "52.0.0",
note = "SchemaAdapter has been removed. Use PhysicalExprAdapterFactory instead. See upgrading.md for more details."
note = "SchemaAdapter has been removed. Use PhysicalExprAdapterFactory instead. See the 52.0.0 upgrade guide for more details: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed"
)]
pub trait SchemaAdapter: Send + Sync {
/// Map a column index in the table schema to a column index in a particular file schema.
Expand All @@ -82,12 +90,14 @@ pub trait SchemaAdapter: Send + Sync {
/// Deprecated: Maps columns from a specific file schema to the table schema.
///
/// This trait has been removed. Use [`PhysicalExprAdapterFactory`] instead.
/// See `upgrading.md` for more details.
/// See the [52.0.0 upgrade guide] for more details.
///
/// [52.0.0 upgrade guide]: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed
///
/// [`PhysicalExprAdapterFactory`]: datafusion_physical_expr_adapter::PhysicalExprAdapterFactory
#[deprecated(
since = "52.0.0",
note = "SchemaMapper has been removed. Use PhysicalExprAdapterFactory instead. See upgrading.md for more details."
note = "SchemaMapper has been removed. Use PhysicalExprAdapterFactory instead. See the 52.0.0 upgrade guide for more details: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed"
)]
pub trait SchemaMapper: Debug + Send + Sync {
/// Adapts a `RecordBatch` to match the `table_schema`.
Expand All @@ -110,15 +120,17 @@ pub trait SchemaMapper: Debug + Send + Sync {
/// Use [`BatchAdapter`] if you want to map a stream of [`RecordBatch`]es
/// between one schema and another, i.e. if you were calling [`SchemaMapper::map_batch`] manually.
///
/// See `upgrading.md` for more details.
/// See the [52.0.0 upgrade guide] for more details.
///
/// [52.0.0 upgrade guide]: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed
///
/// [`PhysicalExprAdapterFactory`]: datafusion_physical_expr_adapter::PhysicalExprAdapterFactory
/// [`FileScanConfigBuilder`]: crate::file_scan_config::FileScanConfigBuilder
/// [`ParquetSource`]: https://docs.rs/datafusion-datasource-parquet/latest/datafusion_datasource_parquet/source/struct.ParquetSource.html
/// [`BatchAdapter`]: datafusion_physical_expr_adapter::BatchAdapter
#[deprecated(
since = "52.0.0",
note = "DefaultSchemaAdapterFactory has been removed. Use PhysicalExprAdapterFactory instead. See upgrading.md for more details."
note = "DefaultSchemaAdapterFactory has been removed. Use PhysicalExprAdapterFactory instead. See the 52.0.0 upgrade guide for more details: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed"
)]
#[derive(Clone, Debug, Default)]
pub struct DefaultSchemaAdapterFactory;
Expand All @@ -139,12 +151,12 @@ impl DefaultSchemaAdapterFactory {
/// Deprecated: Create a new factory for mapping batches from a file schema to a table schema.
#[deprecated(
since = "52.0.0",
note = "DefaultSchemaAdapterFactory has been removed. Use PhysicalExprAdapterFactory instead. See upgrading.md for more details."
note = "DefaultSchemaAdapterFactory has been removed. Use PhysicalExprAdapterFactory instead. See the 52.0.0 upgrade guide for more details: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed"
)]
pub fn from_schema(table_schema: SchemaRef) -> Box<dyn SchemaAdapter> {
// Note: this method did not return an error thus the errors are raised from the returned adapter
warn!(
"DefaultSchemaAdapterFactory::from_schema is deprecated. Use PhysicalExprAdapterFactory instead. See upgrading.md for more details."
"DefaultSchemaAdapterFactory::from_schema is deprecated. Use PhysicalExprAdapterFactory instead. See the 52.0.0 upgrade guide for more details: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed"
);
Box::new(DeprecatedSchemaAdapter {
_projected_table_schema: table_schema,
Expand All @@ -168,7 +180,7 @@ impl SchemaAdapter for DeprecatedSchemaAdapter {
) -> Result<(Arc<dyn SchemaMapper>, Vec<usize>)> {
not_impl_err!(
"SchemaAdapter has been removed. Use PhysicalExprAdapterFactory instead. \
See upgrading.md for more details."
See the 52.0.0 upgrade guide for more details: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed"
)
}
}
Expand All @@ -183,15 +195,17 @@ impl SchemaAdapter for DeprecatedSchemaAdapter {
/// Use [`BatchAdapter`] if you want to map a stream of [`RecordBatch`]es
/// between one schema and another, i.e. if you were calling [`SchemaMapper::map_batch`] manually.
///
/// See `upgrading.md` for more details.
/// See the [52.0.0 upgrade guide] for more details.
///
/// [52.0.0 upgrade guide]: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed
///
/// [`PhysicalExprAdapterFactory`]: datafusion_physical_expr_adapter::PhysicalExprAdapterFactory
/// [`FileScanConfigBuilder`]: crate::file_scan_config::FileScanConfigBuilder
/// [`ParquetSource`]: https://docs.rs/datafusion-datasource-parquet/latest/datafusion_datasource_parquet/source/struct.ParquetSource.html
/// [`BatchAdapter`]: datafusion_physical_expr_adapter::BatchAdapter
#[deprecated(
since = "52.0.0",
note = "SchemaMapping has been removed. Use PhysicalExprAdapterFactory instead. See upgrading.md for more details."
note = "SchemaMapping has been removed. Use PhysicalExprAdapterFactory instead. See the 52.0.0 upgrade guide for more details: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed"
)]
#[derive(Debug)]
pub struct SchemaMapping {
Expand All @@ -203,7 +217,7 @@ impl SchemaMapper for SchemaMapping {
fn map_batch(&self, _batch: RecordBatch) -> Result<RecordBatch> {
not_impl_err!(
"SchemaMapping has been removed. Use PhysicalExprAdapterFactory instead. \
See upgrading.md for more details."
See the 52.0.0 upgrade guide for more details: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed"
)
}

Expand All @@ -213,7 +227,7 @@ impl SchemaMapper for SchemaMapping {
) -> Result<Vec<ColumnStatistics>> {
not_impl_err!(
"SchemaMapping has been removed. Use PhysicalExprAdapterFactory instead. \
See upgrading.md for more details."
See the 52.0.0 upgrade guide for more details: https://datafusion.apache.org/versions/52.0.0/library-user-guide/upgrading.html#schemaadapter-and-schemaadapterfactory-completely-removed"
)
}
}