kmitchener commented on code in PR #3549:
URL: https://github.com/apache/arrow-datafusion/pull/3549#discussion_r975657059


##########
datafusion/expr/src/binary_rule.rs:
##########
@@ -308,25 +308,18 @@ fn mathematics_numerical_coercion(
         (Decimal128(_, _), Decimal128(_, _)) => {
             coercion_decimal_mathematics_type(mathematics_op, lhs_type, 
rhs_type)
         }
-        (Decimal128(_, _), _) => {
-            let converted_decimal_type = 
coerce_numeric_type_to_decimal(rhs_type);
-            match converted_decimal_type {
-                None => None,
-                Some(right_decimal_type) => coercion_decimal_mathematics_type(
-                    mathematics_op,
-                    lhs_type,
-                    &right_decimal_type,
-                ),
-            }
+        (Null, dec_type @ Decimal128(_, _)) | (dec_type @ Decimal128(_, _), 
Null) => {
+            Some(dec_type.clone())

Review Comment:
   this is the actual fix, the rest is some refactoring



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