kumarUjjawal commented on code in PR #26790:
URL: https://github.com/apache/datafusion/pull/26790#discussion_r4398347415


##########
datafusion/physical-plan/src/union.rs:
##########
@@ -1016,31 +1016,29 @@ fn union_schema(inputs: &[Arc<dyn ExecutionPlan>]) -> 
Result<SchemaRef> {
             // which also uses the left side names.
             let base_field = first_schema.field(i).clone();
 
-            // Coerce metadata and nullability across all inputs
-
-            inputs
+            // Select the first nullable field, or the first field if none are
+            // nullable, before merging metadata. Otherwise, each non-nullable
+            // candidate would repeat the full metadata merge.
+            let (input_idx, input) = inputs

Review Comment:
   Correct!



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to