alamb commented on a change in pull request #1368:
URL: https://github.com/apache/arrow-datafusion/pull/1368#discussion_r757772002



##########
File path: datafusion/src/optimizer/constant_folding.rs
##########
@@ -106,16 +106,23 @@ impl OptimizerRule for ConstantFolding {
                             .rewrite(&mut const_evaluator)?
                             .rewrite(&mut simplifier)?;
 
-                        let new_name = &new_e.name(plan.schema());
-
-                        if let (Ok(expr_name), Ok(new_expr_name)) = (name, 
new_name) {
-                            if expr_name != new_expr_name {
-                                Ok(new_e.alias(expr_name))
-                            } else {
-                                Ok(new_e)
+                        match plan {
+                            LogicalPlan::Filter { .. } => Ok(new_e),

Review comment:
       I would like to recommend adding a comment here about why we don't add 
aliases for filter.
   
   




-- 
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]


Reply via email to