Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fmt
  • Loading branch information
alamb committed Sep 15, 2025
commit 5ac72b85274b2c33f61249b6b97feab4dea79ea0
19 changes: 4 additions & 15 deletions datafusion/optimizer/src/simplify_expressions/expr_simplifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1404,9 +1404,7 @@ impl<S: SimplifyInfo> TreeNodeRewriter for Simplifier<'_, S> {
expr: None,
mut when_then_expr,
else_expr: _,
}) if !when_then_expr.is_empty()
&& is_true(when_then_expr[0].0.as_ref()) =>
{
}) if !when_then_expr.is_empty() && is_true(when_then_expr[0].0.as_ref()) => {
let (_, then_) = when_then_expr.swap_remove(0);
Transformed::yes(*then_)
}
Expand Down Expand Up @@ -3570,10 +3568,7 @@ mod tests {
assert_eq!(
simplify(Expr::Case(Case::new(
None,
vec![(
Box::new(lit(true)),
Box::new(lit(1)),
)],
vec![(Box::new(lit(true)), Box::new(lit(1)),)],
Some(Box::new(col("x"))),
))),
lit(1)
Expand All @@ -3583,10 +3578,7 @@ mod tests {
assert_eq!(
simplify(Expr::Case(Case::new(
None,
vec![(
Box::new(lit(true)),
Box::new(col("a")),
)],
vec![(Box::new(lit(true)), Box::new(col("a")),)],
Some(Box::new(col("b"))),
))),
col("a")
Expand All @@ -3609,10 +3601,7 @@ mod tests {
assert_eq!(
simplify(Expr::Case(Case::new(
None,
vec![(
Box::new(lit(true)),
Box::new(col("a")),
)],
vec![(Box::new(lit(true)), Box::new(col("a")),)],
None,
))),
col("a")
Expand Down