berkaysynnada commented on code in PR #21520:
URL: https://github.com/apache/datafusion/pull/21520#discussion_r3097270784
##########
datafusion/common/src/scalar/mod.rs:
##########
@@ -2526,6 +2526,23 @@ impl ScalarValue {
(Self::Float64(Some(l)), Self::Float64(Some(r))) => {
Some((l - r).abs().round() as _)
}
+ (Self::Date32(Some(l)), Self::Date32(Some(r))) =>
Some(l.abs_diff(*r) as _),
+ (Self::Date64(Some(l)), Self::Date64(Some(r))) =>
Some(l.abs_diff(*r) as _),
+ (Self::TimestampSecond(Some(l), _), Self::TimestampSecond(Some(r),
_)) => {
+ Some(l.abs_diff(*r) as _)
Review Comment:
The pattern `(Self::TimestampSecond(Some(l), _),
Self::TimestampSecond(Some(r), _))` ignores the timezone field on both sides.
Is that intentional? I want to make sure two timestamps with different tz
strings produce a meaningful distance. If so, a short comment on one of the
arms explaining the reasoning would be helpful.
--
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]