Skip to content

Commit 6b0d5d6

Browse files
committed
Fix
1 parent a8681de commit 6b0d5d6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/sql-ref-ansi-compliance.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ The following subsections present behaviour changes in arithmetic operations, ty
2929

3030
### Arithmetic Operations
3131

32-
In Spark SQL, arithmetic operations performed on numeric types (with the exception of decimal) are not checked for overflow by default.
33-
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 (e.g., if the sum of 2 integers is higher than the maximum value representable, the result is a negative number).
34-
On the other hand, Spark SQL returns null for decimal overflow.
35-
When `spark.sql.ansi.enabled` is set to `true` and overflow occurs in numeric and interval arithmetic operations, it throws an arithmetic exception at runtime.
32+
In Spark SQL, arithmetic operations performed on numeric types (with the exception of decimal) are not checked for overflows by default.
33+
This means that in case an operation causes overflows, the result is the same that the same operation returns in a Java/Scala program (e.g., if the sum of 2 integers is higher than the maximum value representable, the result is a negative number).
34+
On the other hand, Spark SQL returns null for decimal overflows.
35+
When `spark.sql.ansi.enabled` is set to `true` and an overflow occurs in numeric and interval arithmetic operations, it throws an arithmetic exception at runtime.
3636

3737
{% highlight sql %}
3838
-- `spark.sql.ansi.enabled=true`
@@ -54,7 +54,7 @@ SELECT 2147483647 + 1;
5454
### Type Conversion
5555

5656
Spark SQL has three kinds of type conversions: explicit casting, type coercion, and store assignment casting.
57-
When `spark.sql.ansi.enabled` is set to `true`, explicit castings by `CAST` syntax throws a number-format exception at runtime for illegal cast patterns defined in the standard, e.g. casts from a string to an integer.
57+
When `spark.sql.ansi.enabled` is set to `true`, explicit casting by `CAST` syntax throws a number-format exception at runtime for illegal cast patterns defined in the standard, e.g. casts from a string to an integer.
5858
On the other hand, `INSERT INTO` syntax throws an analysis exception when the ANSI mode enabled via `spark.sql.storeAssignmentPolicy=ANSI`.
5959

6060
Currently, the ANSI mode affects explicit casting and assignment casting only.
@@ -68,7 +68,7 @@ SELECT CAST('a' AS INT);
6868

6969
java.lang.NumberFormatException: invalid input syntax for type numeric: a
7070

71-
-- `spark.sql.ansi.enabled=false` (This is a legacy behaviour until Spark 2.x)
71+
-- `spark.sql.ansi.enabled=false` (This is a default behaviour)
7272
SELECT CAST('a' AS INT);
7373

7474
+--------------+

0 commit comments

Comments
 (0)