alamb commented on code in PR #16066:
URL: https://github.com/apache/datafusion/pull/16066#discussion_r2093568326


##########
datafusion/optimizer/src/common_subexpr_eliminate.rs:
##########
@@ -316,6 +316,19 @@ impl CommonSubexprEliminate {
                     } => {
                         let rewritten_aggr_expr = 
new_exprs_list.pop().unwrap();
                         let new_aggr_expr = original_exprs_list.pop().unwrap();
+                        let saved_names = if let Some(aggr_expr) = aggr_expr {
+                            let name_preserver = 
NamePreserver::new_for_projection();
+                            aggr_expr
+                                .iter()
+                                .map(|expr| Some(name_preserver.save(expr)))
+                                .collect::<Vec<_>>()
+                        } else {
+                            new_aggr_expr

Review Comment:
   Is this the same as a vec of all None?
   
   
   ```rust
   vec![None; new_agg_expr.len()]`
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to