Friede80 commented on code in PR #15135:
URL: https://github.com/apache/datafusion/pull/15135#discussion_r1994158077


##########
datafusion/expr/src/logical_plan/plan.rs:
##########
@@ -2843,13 +2845,21 @@ impl Union {
                     )?
                 };
                 let nullable = fields.iter().any(|field| field.is_nullable());
-                let mut field = Field::new(name, data_type.clone(), nullable);
+
+                // Generate unique field name
+                let name = if let Some(count) = 
name_counts.get_mut(&base_name) {
+                    *count += 1;

Review Comment:
   oh right, because the union schema is discarded during coercion. My initial 
attempt to fix this issue propagated the union schema through, but I removed it 
when I decided not to maintain qualifiers, but I think adding that back would 
resolve this.



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