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

   ## Description
   
   When a function expects a `BinaryView` argument, DataFusion's type coercion 
does not allow `Binary` or `LargeBinary` values to be automatically coerced 
into `BinaryView`. This causes 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` is missing a match arm for 
`(BinaryView, Binary | LargeBinary | Null)`.
   
   ## Proposed Fix
   
   Add the missing coercion rule:
   
   ```rust
   (BinaryView, Binary | LargeBinary | Null) => Some(type_into.clone()),
   ```
   
   This mirrors the existing rule for `Utf8View`:
   
   ```rust
   (Utf8View, Utf8 | LargeUtf8 | Null) => Some(type_into.clone()),
   ```
   
   ## Related
   
   - The `Utf8View` equivalent was already present — the `BinaryView` case was 
simply overlooked.


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