Skip to content

Commit f9b1469

Browse files
authored
Remove TableSource::supports_filter_pushdown function (#12239)
It was deprecated since 20.0.0.
1 parent b691b35 commit f9b1469

File tree

3 files changed

+22
-28
lines changed

3 files changed

+22
-28
lines changed

datafusion/expr/src/table_source.rs

+3-15
Original file line numberDiff line numberDiff line change
@@ -98,27 +98,15 @@ pub trait TableSource: Sync + Send {
9898
TableType::Base
9999
}
100100

101-
/// Tests whether the table provider can make use of a filter expression
102-
/// to optimise data retrieval.
103-
#[deprecated(since = "20.0.0", note = "use supports_filters_pushdown instead")]
104-
fn supports_filter_pushdown(
105-
&self,
106-
_filter: &Expr,
107-
) -> Result<TableProviderFilterPushDown> {
108-
Ok(TableProviderFilterPushDown::Unsupported)
109-
}
110-
111101
/// Tests whether the table provider can make use of any or all filter expressions
112102
/// to optimise data retrieval.
113-
#[allow(deprecated)]
114103
fn supports_filters_pushdown(
115104
&self,
116105
filters: &[&Expr],
117106
) -> Result<Vec<TableProviderFilterPushDown>> {
118-
filters
119-
.iter()
120-
.map(|f| self.supports_filter_pushdown(f))
121-
.collect()
107+
Ok((0..filters.len())
108+
.map(|_| TableProviderFilterPushDown::Unsupported)
109+
.collect())
122110
}
123111

124112
/// Get the Logical plan of this table provider, if available.

datafusion/optimizer/src/analyzer/inline_table_scan.rs

+13-9
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ mod tests {
109109
use crate::test::assert_analyzed_plan_eq;
110110

111111
use arrow::datatypes::{DataType, Field, Schema};
112-
use datafusion_expr::{col, lit, LogicalPlan, LogicalPlanBuilder, TableSource};
112+
use datafusion_expr::{col, lit, Expr, LogicalPlan, LogicalPlanBuilder, TableSource};
113113

114114
pub struct RawTableSource {}
115115

@@ -125,12 +125,14 @@ mod tests {
125125
]))
126126
}
127127

128-
fn supports_filter_pushdown(
128+
fn supports_filters_pushdown(
129129
&self,
130-
_filter: &datafusion_expr::Expr,
131-
) -> datafusion_common::Result<datafusion_expr::TableProviderFilterPushDown>
130+
filters: &[&Expr],
131+
) -> datafusion_common::Result<Vec<datafusion_expr::TableProviderFilterPushDown>>
132132
{
133-
Ok(datafusion_expr::TableProviderFilterPushDown::Inexact)
133+
Ok((0..filters.len())
134+
.map(|_| datafusion_expr::TableProviderFilterPushDown::Inexact)
135+
.collect())
134136
}
135137
}
136138

@@ -154,12 +156,14 @@ mod tests {
154156
self
155157
}
156158

157-
fn supports_filter_pushdown(
159+
fn supports_filters_pushdown(
158160
&self,
159-
_filter: &datafusion_expr::Expr,
160-
) -> datafusion_common::Result<datafusion_expr::TableProviderFilterPushDown>
161+
filters: &[&Expr],
162+
) -> datafusion_common::Result<Vec<datafusion_expr::TableProviderFilterPushDown>>
161163
{
162-
Ok(datafusion_expr::TableProviderFilterPushDown::Exact)
164+
Ok((0..filters.len())
165+
.map(|_| datafusion_expr::TableProviderFilterPushDown::Exact)
166+
.collect())
163167
}
164168

165169
fn schema(&self) -> arrow::datatypes::SchemaRef {

datafusion/optimizer/src/push_down_filter.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -2416,11 +2416,13 @@ mod tests {
24162416
TableType::Base
24172417
}
24182418

2419-
fn supports_filter_pushdown(
2419+
fn supports_filters_pushdown(
24202420
&self,
2421-
_e: &Expr,
2422-
) -> Result<TableProviderFilterPushDown> {
2423-
Ok(self.filter_support.clone())
2421+
filters: &[&Expr],
2422+
) -> Result<Vec<TableProviderFilterPushDown>> {
2423+
Ok((0..filters.len())
2424+
.map(|_| self.filter_support.clone())
2425+
.collect())
24242426
}
24252427

24262428
fn as_any(&self) -> &dyn std::any::Any {

0 commit comments

Comments
 (0)