feichai0017 commented on code in PR #20945:
URL: https://github.com/apache/datafusion/pull/20945#discussion_r2937754435


##########
datafusion/expr/src/type_coercion/functions.rs:
##########
@@ -307,6 +307,34 @@ fn try_coerce_types(
     )
 }
 
+fn data_types_match(valid_types: &[DataType], current_types: &[DataType]) -> 
bool {

Review Comment:
   Yes, I locally verified that a broader `equals_datatype`-style matcher 
regresses existing SLTs.
   
   In particular:
   - `/datafusion/datafusion/sqllogictest/test_files/struct.slt`
     `select [{a: 1, b: 2}, {b: 3, a: 4}];`
   - `/datafusion/datafusion/sqllogictest/test_files/spark/array/array.slt`
     `SELECT array(arrow_cast(array(1,2), 'LargeList(Int64)'), array(3));`
   
   With the broader matching, both end up failing in array construction 
(`MutableArrayData`) because those paths still require exact runtime type 
identity. That was the main reason I kept this matcher narrower than 
`equals_datatype`, especially around `Struct`.
   
   I agree it would be useful to make that boundary explicit, so I can also add 
a focused sanity-check regression test in this PR.
   



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