bert-beyondloops opened a new issue, #21798:
URL: https://github.com/apache/datafusion/issues/21798

   ### Describe the bug
   
   When a function expects a `BinaryView` argument, DataFusion's type coercion 
did not allow `Binary` or `LargeBinary` values to be automatically coerced into 
`BinaryView`.
      This caused errors when calling such functions with binary columns that 
are not already stored as `BinaryView`.
   
      This is inconsistent with the existing behaviour for string types, where 
`Utf8` and `LargeUtf8` can already be coerced into `Utf8View`.
   
      ## Root Cause
   
      The `coerced_from` function in 
`datafusion/expr/src/type_coercion/functions.rs` was missing a match arm for 
`(BinaryView, Binary | LargeBinary | Null)`.
   
   
   ### To Reproduce
   
   
   Create a scalar UDF with for example a signature with 
`Signature::exact(vec![BinaryView], Volatility::Immutable)`
   
   Calling this scalar function with a Binary or LargeBinary datatype or even 
NULL was not coerced and resulted in a planning error.
   
   ### Expected behavior
   
   The coercion should take place in the same way as is foreseen already for 
the string datatypes (Utf8, LargeUtf8, Null -> Utf8View)
   
   ### 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: [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