You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "bert-beyondloops (via GitHub)" <gi...@apache.org> on 2026/04/23 10:18:57 UTC

[I] Allow coercion from Binary and LargeBinary into BinaryView [datafusion]

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: github-unsubscribe@datafusion.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Allow coercion from Binary and LargeBinary into BinaryView [datafusion]

Posted by "BootstrapperSBL (via GitHub)" <gi...@apache.org>.
BootstrapperSBL commented on issue #21798:
URL: https://github.com/apache/datafusion/issues/21798#issuecomment-4306884583

   Looked at `coerced_from` in `datafusion/expr/src/type_coercion/functions.rs` — confirmed the `(BinaryView, Binary | LargeBinary | Null)` arm is missing while the Utf8View side already handles its equivalents. I'll send a PR mirroring that pattern, with a scalar-UDF signature test to pin the coercion.


-- 
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-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Allow coercion from Binary and LargeBinary into BinaryView [datafusion]

Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey closed issue #21798: Allow coercion from Binary and LargeBinary into BinaryView
URL: https://github.com/apache/datafusion/issues/21798


-- 
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-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org