@@ -366,22 +366,6 @@ fn pushdown_columns(
366
366
. then_some ( checker. required_columns . into_iter ( ) . collect ( ) ) )
367
367
}
368
368
369
- /// creates a PushdownChecker for a single use to check a given column with the given schemes. Used
370
- /// to check preemptively if a column name would prevent pushdowning.
371
- /// effectively does the inverse of [`pushdown_columns`] does, but with a single given column
372
- /// (instead of traversing the entire tree to determine this)
373
- fn would_column_prevent_pushdown ( column_name : & str , file_schema : & Schema ) -> bool {
374
- let mut checker = PushdownChecker :: new ( file_schema) ;
375
-
376
- // the return of this is only used for [`PushdownChecker::f_down()`], so we can safely ignore
377
- // it here. I'm just verifying we know the return type of this so nobody accidentally changes
378
- // the return type of this fn and it gets implicitly ignored here.
379
- let _: Option < TreeNodeRecursion > = checker. check_single_column ( column_name) ;
380
-
381
- // and then return a value based on the state of the checker
382
- checker. prevents_pushdown ( )
383
- }
384
-
385
369
/// Recurses through expr as a tree, finds all `column`s, and checks if any of them would prevent
386
370
/// this expression from being predicate pushed down. If any of them would, this returns false.
387
371
/// Otherwise, true.
@@ -391,21 +375,7 @@ pub(crate) fn can_expr_be_pushed_down_with_schemas(
391
375
expr : & Arc < dyn PhysicalExpr > ,
392
376
file_schema : & Schema ,
393
377
) -> bool {
394
- let mut can_be_pushed = true ;
395
- expr. apply ( |expr| {
396
- if let Some ( column) = expr. as_any ( ) . downcast_ref :: < Column > ( ) {
397
- can_be_pushed &= !would_column_prevent_pushdown ( column. name ( ) , file_schema) ;
398
- Ok ( if can_be_pushed {
399
- TreeNodeRecursion :: Jump
400
- } else {
401
- TreeNodeRecursion :: Stop
402
- } )
403
- } else {
404
- Ok ( TreeNodeRecursion :: Continue )
405
- }
406
- } )
407
- . unwrap ( ) ; // we never return an Err, so we can safely unwrap this
408
- can_be_pushed
378
+ pushdown_columns ( expr, file_schema) . is_ok ( )
409
379
}
410
380
411
381
/// Calculate the total compressed size of all `Column`'s required for
0 commit comments