Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Spark decimal add and subtract (facebookincubator#5791)
Summary: Use Arrow Gandiva BasicDecimal128 algorithm to compute value. Arrow implementation: https://github.com/apache/arrow/blob/release-12.0.1-rc1/cpp/src/gandiva/precompiled/decimal_ops.cc#L211-L231 Spark result precision and scale maybe different with Presto, because it will use adjustPrecisionScale to change the precision and scale when precision is beyond 38. And this implement can compute data without overflow in some situation. Pull Request resolved: facebookincubator#5791 Reviewed By: kgpai, pedroerp Differential Revision: D52220210 Pulled By: Yuhta fbshipit-source-id: 96f9be2c36d37d11aa71df4308a6a0c9a3bd50a3
- Loading branch information