Remove TableSource::supports_filter_pushdown function (#12239)
It was deprecated since 20.0.0.
diff --git a/datafusion/expr/src/table_source.rs b/datafusion/expr/src/table_source.rs
index 8b8d2df..bdb602d 100644
--- a/datafusion/expr/src/table_source.rs
+++ b/datafusion/expr/src/table_source.rs
@@ -98,27 +98,15 @@
TableType::Base
}
- /// 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)]
fn supports_filters_pushdown(
&self,
filters: &[&Expr],
) -> Result<Vec<TableProviderFilterPushDown>> {
- filters
- .iter()
- .map(|f| self.supports_filter_pushdown(f))
- .collect()
+ Ok((0..filters.len())
+ .map(|_| TableProviderFilterPushDown::Unsupported)
+ .collect())
}
/// Get the Logical plan of this table provider, if available.
diff --git a/datafusion/optimizer/src/analyzer/inline_table_scan.rs b/datafusion/optimizer/src/analyzer/inline_table_scan.rs
index d5b3648..2fc9b91 100644
--- a/datafusion/optimizer/src/analyzer/inline_table_scan.rs
+++ b/datafusion/optimizer/src/analyzer/inline_table_scan.rs
@@ -109,7 +109,7 @@
use crate::test::assert_analyzed_plan_eq;
use arrow::datatypes::{DataType, Field, Schema};
- use datafusion_expr::{col, lit, LogicalPlan, LogicalPlanBuilder, TableSource};
+ use datafusion_expr::{col, lit, Expr, LogicalPlan, LogicalPlanBuilder, TableSource};
pub struct RawTableSource {}
@@ -125,12 +125,14 @@
]))
}
- fn supports_filter_pushdown(
+ fn supports_filters_pushdown(
&self,
- _filter: &datafusion_expr::Expr,
- ) -> datafusion_common::Result<datafusion_expr::TableProviderFilterPushDown>
+ filters: &[&Expr],
+ ) -> datafusion_common::Result<Vec<datafusion_expr::TableProviderFilterPushDown>>
{
- Ok(datafusion_expr::TableProviderFilterPushDown::Inexact)
+ Ok((0..filters.len())
+ .map(|_| datafusion_expr::TableProviderFilterPushDown::Inexact)
+ .collect())
}
}
@@ -154,12 +156,14 @@
self
}
- fn supports_filter_pushdown(
+ fn supports_filters_pushdown(
&self,
- _filter: &datafusion_expr::Expr,
- ) -> datafusion_common::Result<datafusion_expr::TableProviderFilterPushDown>
+ filters: &[&Expr],
+ ) -> datafusion_common::Result<Vec<datafusion_expr::TableProviderFilterPushDown>>
{
- Ok(datafusion_expr::TableProviderFilterPushDown::Exact)
+ Ok((0..filters.len())
+ .map(|_| datafusion_expr::TableProviderFilterPushDown::Exact)
+ .collect())
}
fn schema(&self) -> arrow::datatypes::SchemaRef {
diff --git a/datafusion/optimizer/src/push_down_filter.rs b/datafusion/optimizer/src/push_down_filter.rs
index 33a58a8..0625652 100644
--- a/datafusion/optimizer/src/push_down_filter.rs
+++ b/datafusion/optimizer/src/push_down_filter.rs
@@ -2416,11 +2416,13 @@
TableType::Base
}
- fn supports_filter_pushdown(
+ fn supports_filters_pushdown(
&self,
- _e: &Expr,
- ) -> Result<TableProviderFilterPushDown> {
- Ok(self.filter_support.clone())
+ filters: &[&Expr],
+ ) -> Result<Vec<TableProviderFilterPushDown>> {
+ Ok((0..filters.len())
+ .map(|_| self.filter_support.clone())
+ .collect())
}
fn as_any(&self) -> &dyn std::any::Any {