ovr edited a comment on pull request #9232:
URL: https://github.com/apache/arrow/pull/9232#issuecomment-792852299


   > If we want to support Decimal(i128), can't we use Rust's native i128? E.g. 
does decimal128 + decimal128 correspond to Rust's i128 + i128, or is the math 
actually different?
   
   @jorgecarleitao 
   
   It's using `i128` under the hood as expected (which generates to u64 and i64 
by LLVM). As you know, `Decimal` has precision/scale and It's not possible to 
calculate the sum of two different decimals with different scales without 
rescaling, for example: `Decimal(1,1)` and `Decimal(1,5)`.
   
   Yet another thing, it's overflowing.
   
   `DECIMAL(1) + DECIMAL(1) = DECIMAL(1)`, example `1` + `9`.
   
   I don't know how it should be done.


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

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


Reply via email to