alamb commented on code in PR #10077:
URL: 
https://github.com/apache/arrow-datafusion/pull/10077#discussion_r1564772922


##########
datafusion/expr/src/type_coercion/functions.rs:
##########
@@ -435,15 +437,15 @@ fn coerced_from<'a>(
         // Note that not all rules in `comparison_coercion` can be reused here.
         // For example, all numeric types can be coerced into Utf8 for 
comparison,
         // but not for function arguments.
-        _ => comparison_binary_numeric_coercion(type_into, type_from).and_then(
-            |coerced_type| {
+        _ => comparison_binary_numeric_coercion(type_into, type_from)
+            .or_else(|| dictionary_coercion(type_into, type_from, true))

Review Comment:
   I couldn't quite tell the difference. What would be the benefit? 
   
   I always get a little confused with the type coercion logic -- that there 
are different rules for certain operations I think.



##########
datafusion/expr/src/built_in_function.rs:
##########
@@ -635,4 +635,19 @@ mod tests {
             .unwrap();
         assert_eq!(return_type, DataType::Date32);
     }
+
+    #[test]
+    fn test_coalesce_return_types_dictionary() {

Review Comment:
   👍  we saw something similar in 
https://github.com/apache/arrow-datafusion/issues/9925 



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

Reply via email to