pitrou commented on code in PR #47297: URL: https://github.com/apache/arrow/pull/47297#discussion_r2284730503
########## cpp/src/arrow/compute/kernels/scalar_arithmetic.cc: ########## @@ -669,13 +669,16 @@ void AddDecimalUnaryKernels(ScalarFunction* func) { template <typename Op> void AddDecimalBinaryKernels(const std::string& name, ScalarFunction* func) { OutputType out_type(null()); + std::shared_ptr<MatchConstraint> constraint = nullptr; const std::string op = name.substr(0, name.find("_")); if (op == "add" || op == "subtract") { out_type = OutputType(ResolveDecimalAdditionOrSubtractionOutput); + constraint = DecimalsHaveSameScale(); } else if (op == "multiply") { out_type = OutputType(ResolveDecimalMultiplicationOutput); } else if (op == "divide") { out_type = OutputType(ResolveDecimalDivisionOutput); + constraint = BinaryDecimalScaleComparisonGE(); Review Comment: Since we add some constraints here, does it mean that we can remove some error return paths from the various `ResolveDecimal` functions? -- 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