-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-14098: [C++] subtract(time, time) -> duration kernel #12105
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
Conversation
|
|
edponce
left a comment
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.
LGTM!
|
Thanks for the review @edponce! I'm doubting myself a bit here - the Jira is asking for interval return type while this returns time at the moment. |
|
Oops! Good that you noticed. |
|
Although returning time is kind of semantically wrong. Duration is already covered so intervals it is. |
Agreed that returning "time" is wrong. How is duration already covered? |
Ah, I was thinking of |
|
So if And it seems that for subtracting time values to get an interval, we actually already have this covered with the |
|
Switched to duration output. |
a5ed967 to
9c2140c
Compare
pitrou
left a comment
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.
Thank you. Can you also update docs/source/cpp/compute.rst for the newly supported types (or do you do that in another related PR)?
0fdfd55 to
d5f2ddc
Compare
|
Didn't yet look at the code, but if we having type casting for temporal types during execution, best to add some tests where casting would be unsafe (eg a value in seconds resolution that would not fit in nanosecond resolution) |
b175d89 to
4dc443a
Compare
|
@rok Are you done with this? I see you're still pushing changes. |
|
@pitrou It's done, I just noticed the kernel output type was off. Please proceed :). |
|
Hmm, can you look at the test failures? |
9dde52d to
1829f69
Compare
|
@pitrou I think this is ready for review. |
pitrou
left a comment
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.
Thanks for the update @rok. Here are some more comments.
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'm not sure I understand what it means to cast from a point in time to a duration. Does it make sense?
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.
Turns out we can just subtract times so this is not really needed anymore.
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.
If these are basically the same checks, why not factor them out?
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.
Done.
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 don't see any tests for this, do we need to add some?
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.
Because subtraction can be done directly on times I removed this.
18b0f87 to
3c1de4d
Compare
|
@pitrou Thanks for review! I removed most of the things :). Could you do another pass? |
pitrou
left a comment
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.
+1, thanks for the updates @rok
|
Benchmark runs are scheduled for baseline = d78967e and contender = 75bcece. 75bcece is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
This is to resolve ARROW-14098.