andygrove commented on code in PR #2464:
URL: https://github.com/apache/arrow-datafusion/pull/2464#discussion_r866409571


##########
datafusion/core/src/sql/planner.rs:
##########
@@ -1009,6 +1009,11 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
             .map(|e| {
                 let group_by_expr =
                     self.sql_expr_to_logical_expr(e, &combined_schema, ctes)?;
+                // aliases from the projection can conflict with same-named 
expressions in the input
+                let mut alias_map = alias_map.clone();
+                for f in plan.schema().fields() {
+                    alias_map.remove(f.name());
+                }

Review Comment:
   This is the first part of the fix



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