beliefer opened a new pull request, #37830: URL: https://github.com/apache/spark/pull/37830
### What changes were proposed in this pull request? This PR used to improve the implementation of Spark `Decimal`. The improvement points are as follows: 1. In many places of Spark `Decimal`, `ne` is first used instead of `eq`. According to the document of `scala.AnyRef`, `ne is equivalent to !(this eq that)` 2. Use `toJavaBigDecimal` instead of `toBigDecimal.bigDecimal` 3. Extract `longVal / POW_10(_scale)` as a new method `def actualLongVal: Long` 4. Remove `BIG_DEC_ZERO` and use `decimalVal.signum` to judge whether or not equals zero. 5. Simplify some code. ### Why are the changes needed? Improve the implementation of Spark Decimal ### Does this PR introduce _any_ user-facing change? 'No'. Just update the inner implementation. ### How was this patch tested? N/A -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
