From 7d07da87b7b7a1c577bb63416b5454579cbc51ad Mon Sep 17 00:00:00 2001 From: Bhargava Vadlamani Date: Wed, 13 Aug 2025 09:54:08 -0700 Subject: [PATCH 1/2] docs update to support try arithmetic functions --- docs/spark_expressions_support.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/spark_expressions_support.md b/docs/spark_expressions_support.md index ffafc8f3d7..3cf2d98f3e 100644 --- a/docs/spark_expressions_support.md +++ b/docs/spark_expressions_support.md @@ -330,9 +330,9 @@ - [x] sqrt - [x] tan - [ ] tanh - - [ ] try_add + - [x] try_add - [x] try_divide - - [ ] try_multiply + - [x] try_multiply - [x] try_subtract - [x] unhex - [ ] width_bucket From 2584c18aced253b8d927c55feca2608868a78552 Mon Sep 17 00:00:00 2001 From: Bhargava Vadlamani Date: Wed, 13 Aug 2025 12:01:20 -0700 Subject: [PATCH 2/2] docs update to support try arithmetic functions --- docs/source/user-guide/expressions.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/source/user-guide/expressions.md b/docs/source/user-guide/expressions.md index 652c986914..970b94a06e 100644 --- a/docs/source/user-guide/expressions.md +++ b/docs/source/user-guide/expressions.md @@ -44,6 +44,15 @@ The following Spark expressions are currently available. Any known compatibility | IntegralDivide (`div`) | All operands are cast to DecimalType (in case the input type is not already decima type) with precision 19 and scale 0. Please set `spark.comet.cast.allowIncompatible` to `true` to enable DataFusion’s cast operation for LongType inputs. | | Remainder (`%`) | | +## Binary Try Arithmetic + +| Expression | Notes | +|------------|----------------------------------------------------------------------------| +| `try_add` | Adds operands (IntegerTypes only) or results NULL incase of overflow | +| `try_sub` | Subtracts operands (IntegerTypes only) or results NULL incase of overflow | +| `try_mul` | Multiplies operands (IntegerTypes only) or results NULL incase of overflow | +| `try_div` | Subtracts operands (IntegerTypes only) or results NULL incase of overflow | + ## Conditional Expressions | Expression | Notes |