Skip to content

Commit

Permalink
Simplify condition
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed Jun 18, 2024
1 parent 09dba99 commit cefb7bd
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions datafusion/optimizer/src/analyzer/subquery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,18 +300,17 @@ fn can_pullup_over_aggregation(expr: &Expr) -> bool {
}) = expr
{
match (left.deref(), right.deref()) {
(Expr::Column(_), right) if !right.any_column_refs() => true,
(left, Expr::Column(_)) if !left.any_column_refs() => true,
(Expr::Column(_), right) => !right.any_column_refs(),
(left, Expr::Column(_)) => !left.any_column_refs(),
(Expr::Cast(Cast { expr, .. }), right)
if matches!(expr.deref(), Expr::Column(_))
&& !right.any_column_refs() =>
if matches!(expr.deref(), Expr::Column(_)) =>
{
true
!right.any_column_refs()
}
(left, Expr::Cast(Cast { expr, .. }))
if matches!(expr.deref(), Expr::Column(_)) && !left.any_column_refs() =>
if matches!(expr.deref(), Expr::Column(_)) =>
{
true
!left.any_column_refs()
}
(_, _) => false,
}
Expand Down

0 comments on commit cefb7bd

Please sign in to comment.