rok commented on a change in pull request #12105:
URL: https://github.com/apache/arrow/pull/12105#discussion_r787013516
##########
File path: cpp/src/arrow/compute/kernels/scalar_arithmetic.cc
##########
@@ -2428,6 +2435,20 @@ void RegisterScalarArithmetic(FunctionRegistry*
registry) {
DCHECK_OK(subtract->AddKernel({in_type, in_type}, duration(unit),
std::move(exec)));
}
+ // Add subtract(time32, time32) -> duration
+ for (auto unit : {TimeUnit::SECOND, TimeUnit::MILLI}) {
+ InputType in_type(match::Time32TypeUnit(unit));
+ auto exec = ScalarBinaryEqualTypes<Int64Type, Time32Type,
SubtractTime32>::Exec;
+ DCHECK_OK(subtract->AddKernel({in_type, in_type}, duration(unit),
std::move(exec)));
+ }
+
+ // Add subtract(time64, time64) -> duration
+ for (auto unit : {TimeUnit::MICRO, TimeUnit::NANO}) {
+ InputType in_type(match::Time64TypeUnit(unit));
+ auto exec = ScalarBinaryEqualTypes<Int64Type, Time64Type, Subtract>::Exec;
+ DCHECK_OK(subtract->AddKernel({in_type, in_type}, duration(unit),
std::move(exec)));
+ }
+
DCHECK_OK(registry->AddFunction(std::move(subtract)));
// ----------------------------------------------------------------------
Review comment:
Done.
--
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]