tustvold commented on code in PR #6778:
URL: https://github.com/apache/arrow-datafusion/pull/6778#discussion_r1243810635
##########
datafusion/expr/src/type_coercion/binary.rs:
##########
@@ -66,185 +193,64 @@ fn mathematics_temporal_result_type(
| (Timestamp(Nanosecond, _), Timestamp(Nanosecond, _)) => {
Some(Interval(MonthDayNano))
}
- (Timestamp(_, _), Timestamp(_, _)) => None,
// date - date
(Date32, Date32) => Some(Interval(DayTime)),
(Date64, Date64) => Some(Interval(MonthDayNano)),
- (Date32, Date64) | (Date64, Date32) => Some(Interval(MonthDayNano)),
- // date - timestamp, timestamp - date
- (Date32, Timestamp(_, _))
- | (Timestamp(_, _), Date32)
- | (Date64, Timestamp(_, _))
- | (Timestamp(_, _), Date64) => {
- // TODO: make get_result_type must after coerce type.
- // if type isn't coerced, we need get common type, and then get
result type.
- let common_type = temporal_coercion(lhs_type, rhs_type);
- common_type.and_then(|t| mathematics_temporal_result_type(&t, &t))
- }
Review Comment:
The formulation using signature avoids this, this function is only fed types
after 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]