peter-toth commented on code in PR #10868:
URL: https://github.com/apache/datafusion/pull/10868#discussion_r1635225523


##########
datafusion/optimizer/src/common_subexpr_eliminate.rs:
##########
@@ -515,14 +522,15 @@ fn build_common_expr_project_plan(
     let mut fields_set = BTreeSet::new();
     let mut project_exprs = common_exprs
         .into_iter()
-        .map(|(expr_id, expr)| {
+        .enumerate()
+        .map(|(index, (expr_id, expr))| {

Review Comment:
   Hmm, I'm not sure I get your comment. This issue is not 
`try_optimize_aggregate` related and I don't see why `as #1` alias gets added. 
   
   But thanks, an example would be great. You can mimic the constant folding 
step by manually modifying the plan.
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to