kosiew commented on code in PR #20787:
URL: https://github.com/apache/datafusion/pull/20787#discussion_r2972943555
##########
datafusion/physical-expr/src/expressions/binary.rs:
##########
@@ -933,6 +933,18 @@ fn pre_selection_scatter(
}
fn concat_elements(left: &ArrayRef, right: &ArrayRef) -> Result<ArrayRef> {
+ if *left.data_type() == DataType::Binary && *right.data_type() ==
DataType::Binary {
+ // Cast Binary to Utf8 to validate UTF-8 encoding before concatenation
Review Comment:
You are right that datafusion/physical-expr should not depend on
datafusion/functions, so a helper cannot simply live in the UDF crate and be
reused from the operator.
There are still a way to "keep binary-to-UTF8 normalization semantics
aligned between the UDF and || operator." without introducing an illegal
dependency:
- Move shared normalization logic into a lower-level crate both can depend
on. The important part is that the shared code lives below both
datafusion/functions and datafusion/physical-expr, not in either one.
--
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]