You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/05/06 00:22:27 UTC

[GitHub] [arrow-datafusion] andygrove commented on a diff in pull request #2464: MINOR: Partial fix for SQL aggregate queries with aliases

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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org