jonahgao commented on code in PR #7080:
URL: https://github.com/apache/arrow-datafusion/pull/7080#discussion_r1273632011
##########
datafusion/expr/src/type_coercion/binary.rs:
##########
@@ -766,6 +767,23 @@ fn string_coercion(lhs_type: &DataType, rhs_type:
&DataType) -> Option<DataType>
}
}
+/// Coercion rules for Binaries: the type that both lhs and rhs can be
+/// casted to for the purpose of a computation
+fn binary_coercion(lhs_type: &DataType, rhs_type: &DataType) ->
Option<DataType> {
+ use arrow::datatypes::DataType::*;
+ match (lhs_type, rhs_type) {
+ (Binary, Binary) | (Utf8, Binary) | (Binary, Utf8) => Some(Binary),
+ (LargeBinary, LargeBinary)
+ | (Binary, LargeBinary)
+ | (LargeBinary, Binary)
+ | (Utf8, LargeBinary)
+ | (LargeBinary, Utf8)
+ | (LargeUtf8, LargeBinary)
+ | (LargeBinary, LargeUtf8) => Some(LargeBinary),
Review Comment:
Updated. Thank you @jackwener :heart:
--
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]