-
Notifications
You must be signed in to change notification settings - Fork 807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Arrow Arithmetic: Subtract timestamps #4244
Conversation
Some thoughts:
|
@@ -4649,4 +4731,144 @@ mod tests { | |||
]); | |||
assert_eq!(&expected, result); | |||
} | |||
|
|||
#[test] | |||
fn test_timestamp_second_subtract_timestamp() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we could extract a generic function typed on the timestamp and duration types, this would avoid the duplication?
I think this is fine, we don't provide arithmetic between different integer precisions either - I think the responsibility is on the query engine to add type coercion logic where necessary 👍 |
Which issue does this PR close?
Closes #3964
Rationale for this change
See #3964
What changes are included in this PR?
subtract_dyn
andsubtract_dyn_checked
now support subtracting timestamps of the same resolution. The result is a duration of the same resolution as the timestamp operands.Are there any user-facing changes?
Expanded timestamp support for
subtract_dyn
andsubtract_dyn_checked
.