Skip to content
Merged
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
14 changes: 14 additions & 0 deletions datafusion/core/src/datasource/datasource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,27 @@ pub trait TableProvider: Sync + Send {

/// Tests whether the table provider can make use of a filter expression
/// to optimise data retrieval.
#[deprecated(since = "20.0.0", note = "use supports_filters_pushdown instead")]
fn supports_filter_pushdown(
&self,
_filter: &Expr,
) -> Result<TableProviderFilterPushDown> {
Ok(TableProviderFilterPushDown::Unsupported)
}

/// Tests whether the table provider can make use of any or all filter expressions
/// to optimise data retrieval.
#[allow(deprecated)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

fn supports_filters_pushdown(
&self,
filters: &[&Expr],
) -> Result<Vec<TableProviderFilterPushDown>> {
filters
.iter()
.map(|f| self.supports_filter_pushdown(f))
.collect()
}

/// Get statistics for this table, if available
fn statistics(&self) -> Option<Statistics> {
None
Expand Down
10 changes: 5 additions & 5 deletions datafusion/core/src/datasource/default_table_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ impl TableSource for DefaultTableSource {
self.table_provider.schema()
}

/// Tests whether the table provider can make use of a filter expression
/// Tests whether the table provider can make use of any or all filter expressions
/// to optimise data retrieval.
fn supports_filter_pushdown(
fn supports_filters_pushdown(
&self,
filter: &Expr,
) -> datafusion_common::Result<TableProviderFilterPushDown> {
self.table_provider.supports_filter_pushdown(filter)
filter: &[&Expr],
) -> datafusion_common::Result<Vec<TableProviderFilterPushDown>> {
self.table_provider.supports_filters_pushdown(filter)
}

fn get_logical_plan(&self) -> Option<&datafusion_expr::LogicalPlan> {
Expand Down
3 changes: 1 addition & 2 deletions datafusion/optimizer/src/type_coercion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,7 @@ fn coerce_scalar_range_aware(
coerce_scalar(largest_type, value).map_or_else(
|_| {
Err(DataFusionError::Execution(format!(
"Cannot cast {:?} to {:?}",
value, target_type
"Cannot cast {value:?} to {target_type:?}"
)))
},
|_| ScalarValue::try_from(target_type),
Expand Down