Repository: spark Updated Branches: refs/heads/master 15fc23722 -> ad2e63662
[SPARK-24598][DOCS] State in the documentation the behavior when arithmetic operations cause overflow ## What changes were proposed in this pull request? According to the discussion in https://github.com/apache/spark/pull/21599, changing the behavior of arithmetic operations so that they can check for overflow is not nice in a minor release. What we can do for 2.4 is warn users about the current behavior in the documentation, so that they are aware of the issue and can take proper actions. ## How was this patch tested? NA Author: Marco Gaido <marcogaid...@gmail.com> Closes #21967 from mgaido91/SPARK-24598_doc. Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/ad2e6366 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/ad2e6366 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/ad2e6366 Branch: refs/heads/master Commit: ad2e63662885b67b1e94030b13fdae4f7366dc4a Parents: 15fc237 Author: Marco Gaido <marcogaid...@gmail.com> Authored: Thu Aug 2 09:28:13 2018 -0700 Committer: Xiao Li <gatorsm...@gmail.com> Committed: Thu Aug 2 09:28:13 2018 -0700 ---------------------------------------------------------------------- docs/sql-programming-guide.md | 7 +++++++ 1 file changed, 7 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/ad2e6366/docs/sql-programming-guide.md ---------------------------------------------------------------------- diff --git a/docs/sql-programming-guide.md b/docs/sql-programming-guide.md index 5f1eee8..0900f83 100644 --- a/docs/sql-programming-guide.md +++ b/docs/sql-programming-guide.md @@ -3072,3 +3072,10 @@ Specifically: - In aggregations, all NaN values are grouped together. - NaN is treated as a normal value in join keys. - NaN values go last when in ascending order, larger than any other numeric value. + + ## Arithmetic operations + +Operations performed on numeric types (with the exception of `decimal`) are not checked for overflow. +This means that in case an operation causes an overflow, the result is the same that the same operation +returns in a Java/Scala program (eg. if the sum of 2 integers is higher than the maximum value representable, +the result is a negative number). --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org