alamb opened a new issue, #10423:
URL: https://github.com/apache/datafusion/issues/10423

   ### Is your feature request related to a problem or challenge?
   
   DataFusion automatically "coerces" (see [docs 
here](https://docs.rs/datafusion/latest/datafusion/logical_expr/type_coercion/index.html))
 input argument types to match the types required of operations or functions. 
   
   For functions, this is described by a desired 
[TypeSignature](https://docs.rs/datafusion/latest/datafusion/logical_expr/enum.TypeSignature.html#)
   ```rust
   pub enum TypeSignature {
       Variadic(Vec<DataType>),
       VariadicEqual,
       VariadicAny,
       Uniform(usize, Vec<DataType>),
       Exact(Vec<DataType>),
       Any(usize),
       OneOf(Vec<TypeSignature>),
       ArraySignature(ArrayFunctionSignature),
   }
   ```
   
   However, some functions have special hard coded coercion logic such as sum 
and count (TODO link) as well as some Array functions like `make_array`. We 
started down the path of encoding the special array semantics into 
`TypeSignature` (see `ArrayFunctionSignature`))
   
   However, as we continue to find other examples of different desired rules 
(most recently in sum and count), `TypeSignature` will grow and become more and 
more specialized
   
   
   
   ### Describe the solution you'd like
   
   @jayzhan211  had a great suggestion 
https://github.com/apache/datafusion/pull/10268#discussion_r1593511241 that in 
addition to encoding common coercion behaviors in `TypeSignature`, we can also 
add a variant of `TypeSignature` that permits user defined coercion rules
   
   
   
   
   ### Describe alternatives you've considered
   
   _No response_
   
   ### Additional context
   
   _No response_


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