tustvold commented on code in PR #4400:
URL: https://github.com/apache/arrow-datafusion/pull/4400#discussion_r1033355115


##########
datafusion/expr/src/type_coercion/binary.rs:
##########
@@ -287,8 +287,8 @@ fn get_wider_decimal_type(
         (DataType::Decimal128(p1, s1), DataType::Decimal128(p2, s2)) => {
             // max(s1, s2) + max(p1-s1, p2-s2), max(s1, s2)
             let s = *s1.max(s2);
-            let range = (p1 - s1).max(p2 - s2);
-            Some(create_decimal_type(range + s, s))
+            let range = (*p1 as i8 - s1).max(*p2 as i8 - s2);

Review Comment:
   Perhaps @liukun4515 you might be able to cast your eyes over this? My 
knowledge of decimals is fairly limited



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