phillipleblanc commented on code in PR #10707:
URL: https://github.com/apache/datafusion/pull/10707#discussion_r1618338309


##########
datafusion/expr/src/logical_plan/builder.rs:
##########
@@ -1373,33 +1373,32 @@ pub fn union(left_plan: LogicalPlan, right_plan: 
LogicalPlan) -> Result<LogicalP
     }
 
     // create union schema
-    let union_qualified_fields =
+    let union_fields =
         zip(left_plan.schema().iter(), right_plan.schema().iter())
             .map(
-                |((left_qualifier, left_field), (_right_qualifier, 
right_field))| {
+                |((_, left_field), (_, right_field))| {

Review Comment:
   There is a test that failed because of this change, and looking into the 
history the reason this was done was to avoid the following error:
   
   https://github.com/apache/datafusion/issues/5410
   
   `SchemaError(DuplicateUnqualifiedField { name: "a" })`
   
   So it seems that this is intentional 🤔 If this only affects the Unparser, I 
could try stripping the qualifier only from the `Sort` node if the input node 
is a `Union`, but that seems a bit hacky to me.



-- 
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-unsubscr...@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to