Details
-
Umbrella
-
Status: Resolved
-
Major
-
Resolution: Done
-
3.2.0
-
None
-
None
Description
Create new Error-handling version SQL functions for existing SQL functions/operators, which returns NULL if overflow/error occurs. So that:
1. Users can manage to finish queries without interruptions in ANSI mode.
2. Users can get NULLs instead of unreasonable results if overflow occurs when ANSI mode is off.
For example, the behavior of the following SQL operations is unreasonable:
2147483647 + 2 => -2147483647 CAST(2147483648L AS INT) => -2147483648
With the new safe version SQL functions:
TRY_ADD(2147483647, 2) => null TRY_CAST(2147483648L AS INT) => null
Attachments
Issue Links
- relates to
-
SPARK-35030 ANSI SQL compliance
- Resolved