From 67e5f8dd6c9516c9199b35123d3cd87e2a4e3470 Mon Sep 17 00:00:00 2001 From: Marco Gaido Date: Thu, 2 Aug 2018 12:30:51 +0200 Subject: [PATCH] [SPARK-24598][DOCS] State in the documentation the behavior when arithmetic operations cause overflow --- docs/sql-programming-guide.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/sql-programming-guide.md b/docs/sql-programming-guide.md index 5f1eee85b515..0900f8317d63 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).