You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Add ANSI mode support for Spark arithmetic operations
Add ANSI mode support for arithmetic operations (add, subtract, multiply,
divide, unary minus) and interval arithmetic in Spark dialect.
In ANSI mode:
- Overflow throws errors instead of wrapping around
- Division by zero throws errors instead of returning NULL
- MIN_VALUE / -1 overflow throws errors
In non-ANSI mode (default):
- Overflow wraps around (two's complement)
- Division by zero returns NULL
- MIN_VALUE / -1 returns MIN_VALUE
Key changes:
- Add IntegerDivideFunction with ANSI overflow and division-by-zero checks
- Update DivideFunction to support both float and double
- Add ANSI overflow checks to Add, Subtract, Multiply functions
- Add ANSI support for interval arithmetic (IntervalDayTime, IntervalYearMonth)
- Add comprehensive tests for all arithmetic operations
- Update documentation with ANSI behavior examples
Addresses: apache/gluten#10134
0 commit comments