cyberbeam524 commented on code in PR #27788:
URL: https://github.com/apache/datafusion/pull/27788#discussion_r4731177383


##########
datafusion/optimizer/src/analyzer/type_coercion.rs:
##########
@@ -1721,11 +1729,48 @@ fn coerce_union_schema_with_schema(
         .iter()
         .enumerate()
         .map(|(i, field)| {
+            let input_fields: Vec<&Field> = inputs
+                .iter()
+                .map(|plan| plan.schema().field(i).as_ref())
+                .collect();
+
+            // Validate extension type compatibility across non-Null inputs.

Review Comment:
   Thanks @jayzhan211 for the thorough analysis and diff!
   
   I've applied the narrower `check_union_extension_type` check suggestion 
using `coerced_fields_metadata` (that reuses the same rule as `CASE` and 
`COALESCE`), removed the previous extension_types_equal and updated both the 
unit test and `sql_extension_types.slt` so all 56.0.0 working shapes stay 
intact. Local `datafusion-optimizer` tests, `sql_extension_types.slt`, and 
clippy are all passing.
   
   Ready for another look!



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