alamb commented on code in PR #9571:
URL: https://github.com/apache/arrow-datafusion/pull/9571#discussion_r1521384723


##########
datafusion/core/src/datasource/provider.rs:
##########
@@ -166,6 +166,7 @@ pub trait TableProvider: Sync + Send {
 
     /// Tests whether the table provider can make use of any or all filter 
expressions
     /// to optimise data retrieval.
+    /// the returned vector much have the same size as the filters argument.

Review Comment:
   ```suggestion
       /// Note:  the returned vector much have the same size as the filters 
argument.
   ```



##########
datafusion/optimizer/src/push_down_filter.rs:
##########
@@ -859,6 +859,15 @@ impl OptimizerRule for PushDownFilter {
                 let results = scan
                     .source
                     .supports_filters_pushdown(filter_predicates.as_slice())?;
+                if filter_predicates.len() != results.len() {
+                    return Err(DataFusionError::Internal(format!(

Review Comment:
   Can you please use the `internal_err!` macro here. So something like
   
   ```rust
   return internal_err!(
     "Vec returned length: {} from supports_filters_pushdown is not the same 
size as the filters passed, which length is: {}", 
     results.len(),  
     filter_predicates.len())
   );
   ```



-- 
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