zanmato1984 commented on code in PR #47445:
URL: https://github.com/apache/arrow/pull/47445#discussion_r2307128632


##########
cpp/src/arrow/compute/kernels/test_util_internal.cc:
##########
@@ -311,6 +311,18 @@ void CheckDispatchBest(std::string func_name, 
std::vector<TypeHolder> original_v
   }
 }
 
+void CheckDispatchBestWithCastedTypes(std::string func_name,

Review Comment:
   I think I explained this in my other comment.



##########
cpp/src/arrow/compute/kernels/scalar_arithmetic.cc:
##########
@@ -670,7 +670,6 @@ void AddDecimalBinaryKernels(const std::string& name, 
ScalarFunction* func) {
     out_type = OutputType(ResolveDecimalMultiplicationOutput);
   } else if (op == "divide") {
     out_type = OutputType(ResolveDecimalDivisionOutput);
-    constraint = BinaryDecimalScale1GeScale2();

Review Comment:
   That's the tricky part about decimal division - there is no "exact match" at 
all.
   
   By 
[definition](https://arrow.apache.org/docs/cpp/compute.html#arithmetic-functions)
 we ALWAYS promote the dividend no matter their (p, s) are. For example, 
`decimal(5, 1) / decimal(5, 1) = decimal(11, 6)`.
   
   As long as we allow any exact match, the promotion won't happen.



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to