zanmato1984 commented on issue #47698:
URL: https://github.com/apache/arrow/issues/47698#issuecomment-3686233765

   Hi @fxeqxmulfx , I think this is an expected behavior. When doing decimal 
addition/subtraction, we promote the result precision to `max(p1 - s1, p2 - s2) 
+ s1 + 1` (for your case, `39`) to prevent overflow, which exceeds the max 
precision of `decimal128` `38`. Further implicit promoting the result type to 
`decimal256` wouldn't be desired as well because this may cause more surprises 
and overhead than benefits.
   
   If this causes any trouble for your real use case, you can probably use, or 
explicit cast it to, `decimal256`.
   
   Thanks.


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