js8544 commented on code in PR #36231:
URL: https://github.com/apache/arrow/pull/36231#discussion_r1239768483
##########
cpp/src/arrow/compute/kernels/scalar_arithmetic.cc:
##########
@@ -640,6 +642,17 @@ struct ArithmeticFunction : ScalarFunction {
ReplaceTypes(type, types);
}
}
+
+ if (name_ == "multiply_checked") {
+ // MultiplyChecked requires the same type for both operands, therefore
we can't
+ // easily make kernels for integers other than int64, so we just cast
integers to
+ // int64
+ if ((*types)[0].id() == Type::DURATION &&
is_integer((*types)[1].id())) {
+ ReplaceTypes(int64(), &(*types)[1], 1);
+ } else if ((*types)[1].id() == Type::DURATION &&
is_integer((*types)[0].id())) {
+ ReplaceTypes(int64(), &(*types)[0], 1);
+ }
+ }
Review Comment:
It does make more sense considering that muliply uses type promotion
already. I've updated the code.
--
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]