peter-toth commented on code in PR #10832:
URL: https://github.com/apache/datafusion/pull/10832#discussion_r1632287690
##########
datafusion/optimizer/src/common_subexpr_eliminate.rs:
##########
@@ -801,15 +814,19 @@ impl TreeNodeRewriter for CommonSubexprRewriter<'_> {
let expr_name = expr.display_name()?;
self.common_exprs.insert(expr_id.clone(), expr);
+
// Alias this `Column` expr to it original "expr name",
// `projection_push_down` optimizer use "expr name" to eliminate
useless
// projections.
// TODO: do we really need to alias here?
Review Comment:
Now that aliasing looks good, can you please remove this comment?
I'm not sure that other comment regarding `projection_push_down` is still
valid. IMO a general comment like "if there is an alias ancestor node we don't
need to alias the extracted common expression" would be better.
--
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]