Skip to content

Commit

Permalink
feat: remove deprecated suppors_filter_pushdown and impl supports_fil…
Browse files Browse the repository at this point in the history
…ters_pushdown

Deprecated function removed in apache/datafusion#9923
  • Loading branch information
Michael-J-Ward committed May 13, 2024
1 parent 366c092 commit f2519a0
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/dataset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,16 @@ impl TableProvider for Dataset {

/// Tests whether the table provider can make use of a filter expression
/// to optimise data retrieval.
fn supports_filter_pushdown(&self, filter: &Expr) -> DFResult<TableProviderFilterPushDown> {
match PyArrowFilterExpression::try_from(filter) {
Ok(_) => Ok(TableProviderFilterPushDown::Exact),
_ => Ok(TableProviderFilterPushDown::Unsupported),
}
fn supports_filters_pushdown(
&self,
filter: &[&Expr],
) -> DFResult<Vec<TableProviderFilterPushDown>> {
filter
.iter()
.map(|&f| match PyArrowFilterExpression::try_from(f) {
Ok(_) => Ok(TableProviderFilterPushDown::Exact),
_ => Ok(TableProviderFilterPushDown::Unsupported),
})
.collect()
}
}

0 comments on commit f2519a0

Please sign in to comment.