GitHub user vinodkc opened a pull request: https://github.com/apache/spark/pull/22171
[SPARK-25177][SQL] When dataframe decimal type column having scale higher than 6, 0 values are shown in scientific notation ## What changes were proposed in this pull request? If scale of decimal type is > 6 , 0 value will be shown in scientific notation and hence, when the dataframe output is saved to external database, it fails due to scientific notation on "0" values. In java.math.BigDecimal, if the scale is >6 , 0 will be show in scientific notation. In Postgrasql, 0 decimal value will be shown with non-scientific notation (plain string), this PR make spark SQL result consistent with Postgrsql. ## How was this patch tested? Added 2 unit tests You can merge this pull request into a Git repository by running: $ git pull https://github.com/vinodkc/spark br_fix_precision_zero Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/22171.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 #22171 ---- commit 1ebeae518f44439af7ceff2ce5fb80caf44f1d45 Author: Vinod KC <vinod.kc.in@...> Date: 2018-08-21T15:10:47Z Fix precision issue with zero when decimal type scale > 6 ---- --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org