avantgardnerio commented on issue #5357:
URL: 
https://github.com/apache/arrow-datafusion/issues/5357#issuecomment-1441974889

   > return TableProviderFilterPushDown::Inexact for all the filters
   
   I think this would work, but not perform optimally - the TableProvider would 
actually match exactly, but DataFusion would still have a (useless) `Filter` in 
the plan.
   
   I think I have a solution that I believe would work for all the cases. 
Simply change the existing signature of:
   
   ```
   fn supports_filter_pushdown( &self, filters: &Expr) -> 
Result<TableProviderFilterPushDown>
   ```
   
   to:
   
   ```
   fn supports_filter_pushdown( &self, filters: &[Expr]) -> 
Result<Vec<TableProviderFilterPushDown>>
   ```
   
   Then my TableProvider could see both `s_i_id` and `s_w_id` at the same time, 
find the appropriate index, and return `Exact` for both of those but 
`NotSupported` for `s_i_age`.
   
   It's barely a change from the existing signature, and we can even wrap it in 
an adapter method with a default impl that will keep existing TableProviders 
working by calling it iteratively, mark the old one `@Deprecated` and 
gracefully change it out over the next few releases.
   
   Thoughts @alamb ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to