Col-Waltz commented on code in PR #16066:
URL: https://github.com/apache/datafusion/pull/16066#discussion_r2223769176
##########
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:
Thanks for your comment, I tried to compact the code but it leads to
additional trait implementations in another parts of the project, so I assumed
that it will be better to fix the problem this way until `find_common_exprs()`
will be improved as it mentioned in TODO.
Please let me know if this problem was already solved or move my commit out
of `stale` label.
--
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]