jayzhan211 commented on code in PR #10268:
URL: https://github.com/apache/datafusion/pull/10268#discussion_r1586955192


##########
datafusion/expr/src/signature.rs:
##########
@@ -92,14 +92,22 @@ pub enum TypeSignature {
     /// A function such as `concat` is `Variadic(vec![DataType::Utf8, 
DataType::LargeUtf8])`
     Variadic(Vec<DataType>),
     /// One or more arguments of an arbitrary but equal type.
-    /// DataFusion attempts to coerce all argument types to match the first 
argument's type
+    /// DataFusion attempts to coerce all argument types to match to the 
common type with comparision coercion.
     ///
     /// # Examples
     /// Given types in signature should be coercible to the same final type.
     /// A function such as `make_array` is `VariadicEqual`.
     ///
     /// `make_array(i32, i64) -> make_array(i64, i64)`
     VariadicEqual,
+    /// One or more arguments of an arbitrary but equal type or Null.
+    /// Non-comparison coercion is attempted to match the signatures.
+    ///
+    /// Functions like `coalesce` is `VariadicEqual`.

Review Comment:
   yes. `Non-comparison coercion` is `type_union_resolution`
   
   Actually, I think `type_union_resolution` is what we really need for 
coercion. Current `comparison_coercion` may not exist in the long term because 
I think there are many `workaround` solutions included in it, and those are 
possible to pull out to their **correct places**.
   
   Ideally, we could shape `comparison_coercion` to more like 
`type_union_resolution`. But, adjusting logic inside it is error-prone if the 
test is not covered.
   
   
   At least I can tell the dict-coercion is different between these two now.



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