shehabgamin commented on PR #14268:
URL: https://github.com/apache/datafusion/pull/14268#issuecomment-2633097400

   > This is the point, I don't quite understand why adding signature for 
`default_cast_to` logic helps. I thought you want to solve the issues for these 
datafusion functions, so I don't know what others functions you want to solve 
and they are only possible if we have `AnyNative`.
   >
   > @shehabgamin First of all, what are the issues we are solving? Are these 
functions in datafusion?
   > 
   > ```
   > ascii
   > bit_length
   > contains
   > ends_with
   > starts_with
   > octet_length
   > ```
   > 
   > Are there others issues? Why `AnyNative` helps?
   
   @jayzhan211 The regression is that all these functions before DataFusion 43 
would coerce:
   1. `Binary` -> `String`
   2. `Int` -> `String`
   
   But now they no longer do.
   
   I am trying to find some middle ground here. I am happy to implement any 
signature for the functions in this PR, but currently, `default_cast_for` is 
inaccessible for downstream users, adding `AnyNative` makes it accessible. Sail 
implements hundreds of custom UDFs, so it would be nice to have access to  
`default_cast_for`. We're not the only downstream project that has a need for 
for flexible coercion like this (see here: 
https://github.com/apache/datafusion/issues/14230#issuecomment-2631350057).
   
   > Even if there is such case that we really need AnyNative, it seems strange 
to me to add in TypeSignatureClass but should be another new TypeSignature.
   
   I'm not sure that `AnyNative` should be a new `TypeSignature` because 
`TypeSignature::Coercible` most accurately describes the behavior.
   
   > Btw, if your proposed signature doesn't used by any functions in 
datafusion. You should use TypeSignature::UserDefined it is used for any other 
customize logic for downstream.
   
   The point is that `default_cast_for` is not accessible downstream. Should we 
just make `default_cast_for` a public function?


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