kumarUjjawal commented on code in PR #19563:
URL: https://github.com/apache/datafusion/pull/19563#discussion_r2658988318
##########
datafusion/expr-common/src/type_coercion/binary.rs:
##########
@@ -260,7 +260,25 @@ impl<'a> BinaryTypeCoercer<'a> {
)
})
}
+ Minus if is_date_minus_date(lhs, rhs) => {
+ return Ok(Signature {
+ lhs: lhs.clone(),
+ rhs: rhs.clone(),
+ ret: Int64,
+ });
+ }
Plus | Minus | Multiply | Divide | Modulo => {
+ // Special case: Date - Date should return Int64 (days difference)
+ // This aligns with PostgreSQL, DuckDB, and MySQL behavior
+ // See:
https://www.postgresql.org/docs/current/functions-datetime.html
+ if matches!(self.op, Minus) && is_date_minus_date(lhs, rhs) {
Review Comment:
Yes, I forgot
--
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]