Skip to content

Commit

Permalink
Fix the fallback to the table provider for supports_filters_pushdown
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipleblanc committed Jun 18, 2024
1 parent 9b13f2e commit f299428
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion datafusion-federation/src/table_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use datafusion::{
datasource::TableProvider,
error::{DataFusionError, Result},
execution::context::SessionState,
logical_expr::{Expr, LogicalPlan, TableSource, TableType},
logical_expr::{Expr, LogicalPlan, TableProviderFilterPushDown, TableSource, TableType},
physical_plan::ExecutionPlan,
};

Expand Down Expand Up @@ -88,6 +88,19 @@ impl TableProvider for FederatedTableProviderAdaptor {

self.source.get_column_default(column)
}
fn supports_filters_pushdown(
&self,
filters: &[&Expr],
) -> Result<Vec<TableProviderFilterPushDown>> {
if let Some(table_provider) = &self.table_provider {
return table_provider.supports_filters_pushdown(filters);
}

Ok(vec![
TableProviderFilterPushDown::Unsupported;
filters.len()
])
}

// Scan is not supported; the adaptor should be replaced
// with a virtual TableProvider that provides federation for a sub-plan.
Expand Down

0 comments on commit f299428

Please sign in to comment.