lidavidm commented on a change in pull request #12378:
URL: https://github.com/apache/arrow/pull/12378#discussion_r802784096



##########
File path: cpp/src/arrow/compute/kernels/scalar_arithmetic.cc
##########
@@ -2536,12 +2536,31 @@ void RegisterScalarArithmetic(FunctionRegistry* 
registry) {
   // ----------------------------------------------------------------------
   auto add = MakeArithmeticFunction<Add>("add", &add_doc);
   AddDecimalBinaryKernels<Add>("add", add.get());
+
+  // Add add(timestamp, duration) -> timestamp
+  for (auto unit : TimeUnit::values()) {
+    InputType in_type(match::TimestampTypeUnit(unit));
+    auto exec = ScalarBinary<TimestampType, DurationType, TimestampType, 
Add>::Exec;

Review comment:
       TimestampType and DurationType are both int64_t underneath, is it 
possible to reuse the existing Exec method? (i.e. does 
`ArithmeticExecFromOp<ScalarBinary, Add>(Type::INT64)` work here?)




-- 
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]


Reply via email to