You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "jackwener (via GitHub)" <gi...@apache.org> on 2023/05/23 08:36:28 UTC

[GitHub] [arrow-datafusion] jackwener commented on a diff in pull request #6417: Fix UNION ALL aliasing with more complex queries

jackwener commented on code in PR #6417:
URL: https://github.com/apache/arrow-datafusion/pull/6417#discussion_r1201806236


##########
datafusion/expr/src/logical_plan/builder.rs:
##########
@@ -1133,16 +1133,20 @@ pub fn project_with_column_index(
         .into_iter()
         .enumerate()
         .map(|(i, e)| match e {
-            alias @ Expr::Alias { .. }
-                if &alias.display_name().unwrap() != schema.field(i).name() =>
-            {
-                alias.unalias().alias(schema.field(i).name())
+            Expr::Alias(_, ref name) if name != schema.field(i).name() => {
+                e.unalias().alias(schema.field(i).name())
+            }
+            Expr::Column(Column {
+                relation: _,
+                ref name,
+            }) if name != schema.field(i).name() => {
+                e.unalias().alias(schema.field(i).name())

Review Comment:
   I think `unalias()` is redundant, because it's `Column`



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