tustvold commented on code in PR #6778:
URL: https://github.com/apache/arrow-datafusion/pull/6778#discussion_r1243813863
##########
datafusion/expr/src/type_coercion/binary.rs:
##########
@@ -1017,24 +989,27 @@ mod tests {
macro_rules! test_coercion_binary_rule {
($A_TYPE:expr, $B_TYPE:expr, $OP:expr, $C_TYPE:expr) => {{
- let result = coerce_types(&$A_TYPE, &$OP, &$B_TYPE)?;
- assert_eq!(result, $C_TYPE);
+ let (lhs, rhs) = get_input_types(&$A_TYPE, &$OP, &$B_TYPE)?;
+ assert_eq!(lhs, $C_TYPE);
+ assert_eq!(rhs, $C_TYPE);
}};
}
#[test]
fn test_date_timestamp_arithmetic_error() -> Result<()> {
- let common_type = coerce_types(
+ let (lhs, rhs) = get_input_types(
&DataType::Timestamp(TimeUnit::Nanosecond, None),
&Operator::Minus,
&DataType::Timestamp(TimeUnit::Millisecond, None),
)?;
- assert_eq!(common_type.to_string(), "Timestamp(Millisecond, None)");
+ assert_eq!(lhs.to_string(), "Timestamp(Millisecond, None)");
+ assert_eq!(rhs.to_string(), "Timestamp(Millisecond, None)");
- let err = coerce_types(&DataType::Date32, &Operator::Plus,
&DataType::Date64)
- .unwrap_err()
- .to_string();
- assert_contains!(&err, "Date32 + Date64 can't be evaluated because
there isn't a common type to coerce the types to");
+ let (lhs, rhs) =
+ get_input_types(&DataType::Date32, &Operator::Plus,
&DataType::Date64)
Review Comment:
Tbh I think it was a bug that this wasn't supported, there is no good reason
that I can see as to why we wouldn't coerce to the larger representation
--
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]