diff --git a/datafusion/optimizer/src/common_subexpr_eliminate.rs b/datafusion/optimizer/src/common_subexpr_eliminate.rs index c6d3a0b5aadd..7f4093ba110e 100644 --- a/datafusion/optimizer/src/common_subexpr_eliminate.rs +++ b/datafusion/optimizer/src/common_subexpr_eliminate.rs @@ -197,8 +197,8 @@ impl CommonSubexprEliminate { let mut new_input = new_input.data; if !common_exprs.is_empty() { + assert!(transformed); new_input = build_common_expr_project_plan(new_input, common_exprs)?; - transformed = true; } // return the transformed information