Skip to content

Commit aab1d3a

Browse files
committed
remove unused classes
1 parent ccbdc5e commit aab1d3a

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed

datafusion/optimizer/src/optimize_projections/mod.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -535,10 +535,8 @@ fn merge_consecutive_projections(proj: Projection) -> Result<Transformed<Project
535535
// For details, see: https://github.com/apache/datafusion/issues/8296
536536
if column_referral_map.into_iter().any(|(col, usage)| {
537537
usage > 1
538-
&& !is_expr_trivial(
539-
&prev_projection.expr
540-
[prev_projection.schema.index_of_column(col).unwrap()],
541-
)
538+
&& !prev_projection.expr[prev_projection.schema.index_of_column(col).unwrap()]
539+
.is_trivial()
542540
}) {
543541
// no change
544542
return Projection::try_new_with_schema(expr, input, schema).map(Transformed::no);
@@ -591,11 +589,6 @@ fn merge_consecutive_projections(proj: Projection) -> Result<Transformed<Project
591589
}
592590
}
593591

594-
// Check whether `expr` is trivial; i.e. it doesn't imply any computation.
595-
fn is_expr_trivial(expr: &Expr) -> bool {
596-
expr.is_trivial()
597-
}
598-
599592
/// Rewrites a projection expression using the projection before it (i.e. its input)
600593
/// This is a subroutine to the `merge_consecutive_projections` function.
601594
///

datafusion/physical-plan/src/projection.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,7 @@ fn try_unifying_projections(
946946
// beneficial as caching mechanism for non-trivial computations.
947947
// See discussion in: https://github.com/apache/datafusion/issues/8296
948948
if column_ref_map.iter().any(|(column, count)| {
949-
*count > 1 && !is_expr_trivial(&Arc::clone(&child.expr()[column.index()].expr))
949+
*count > 1 && !&child.expr()[column.index()].expr.is_trivial()
950950
}) {
951951
return Ok(None);
952952
}
@@ -1056,12 +1056,6 @@ fn new_columns_for_join_on(
10561056
(new_columns.len() == hash_join_on.len()).then_some(new_columns)
10571057
}
10581058

1059-
/// Checks if the given expression is trivial.
1060-
/// An expression is considered trivial if it is a `Column`, `Literal`, or field accessor.
1061-
fn is_expr_trivial(expr: &Arc<dyn PhysicalExpr>) -> bool {
1062-
expr.is_trivial()
1063-
}
1064-
10651059
#[cfg(test)]
10661060
mod tests {
10671061
use super::*;

0 commit comments

Comments
 (0)