GitHub user davies opened a pull request: https://github.com/apache/spark/pull/15154
[SPARK-17494] [SQL] changePrecision() on compact decimal should respect rounding mode ## What changes were proposed in this pull request? Floor()/Ceil() of decimal is implemented using changePrecision() by passing a rounding mode, but the rounding mode is not respected when the decimal is in compact mode (could fit within a Long). This Update the changePrecision() to respect rounding mode, which could be ROUND_FLOOR, ROUND_CEIL, ROUND_HALF_UP, ROUND_HALF_EVEN. ## How was this patch tested? Added regression tests. You can merge this pull request into a Git repository by running: $ git pull https://github.com/davies/spark decimal_round Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/15154.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #15154 ---- commit cf0e445b600baad201062e77651bee3d907b42fd Author: Davies Liu <dav...@databricks.com> Date: 2016-09-19T21:47:23Z changePrecision() on compact decimal should respect rounding mode ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org