Skip to content

Commit 472cb8a

Browse files
committed
remove more code
1 parent 68b14ca commit 472cb8a

File tree

1 file changed

+1
-31
lines changed

1 file changed

+1
-31
lines changed

datafusion/datasource-parquet/src/row_filter.rs

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -366,22 +366,6 @@ fn pushdown_columns(
366366
.then_some(checker.required_columns.into_iter().collect()))
367367
}
368368

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-
385369
/// Recurses through expr as a tree, finds all `column`s, and checks if any of them would prevent
386370
/// this expression from being predicate pushed down. If any of them would, this returns false.
387371
/// Otherwise, true.
@@ -391,21 +375,7 @@ pub(crate) fn can_expr_be_pushed_down_with_schemas(
391375
expr: &Arc<dyn PhysicalExpr>,
392376
file_schema: &Schema,
393377
) -> 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()
409379
}
410380

411381
/// Calculate the total compressed size of all `Column`'s required for

0 commit comments

Comments
 (0)