This is an automated email from the ASF dual-hosted git repository.
mbutrovich pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion-comet.git
The following commit(s) were added to refs/heads/main by this push:
new 82df9e7a3 feat: hyperbolic trig functions (#2784)
82df9e7a3 is described below
commit 82df9e7a3a7e2ab1476eadcaadc8d48d896654f8
Author: Vrishabh <[email protected]>
AuthorDate: Wed Nov 19 20:41:58 2025 +0530
feat: hyperbolic trig functions (#2784)
---
docs/source/user-guide/latest/expressions.md | 3 +++
fuzz-testing/src/main/scala/org/apache/comet/fuzz/Meta.scala | 3 +++
spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala | 3 +++
spark/src/test/scala/org/apache/comet/CometExpressionSuite.scala | 3 +++
4 files changed, 12 insertions(+)
diff --git a/docs/source/user-guide/latest/expressions.md
b/docs/source/user-guide/latest/expressions.md
index d58fc8a90..6bd0fada4 100644
--- a/docs/source/user-guide/latest/expressions.md
+++ b/docs/source/user-guide/latest/expressions.md
@@ -125,6 +125,7 @@ Expressions that are not Spark-compatible will fall back to
Spark by default and
| BRound | `bround` | Yes |
|
| Ceil | `ceil` | Yes |
|
| Cos | `cos` | Yes |
|
+| Cosh | `cosh` | Yes |
|
| Cot | `cot` | Yes |
|
| Divide | `/` | Yes |
|
| Exp | `exp` | Yes |
|
@@ -144,9 +145,11 @@ Expressions that are not Spark-compatible will fall back
to Spark by default and
| Round | `round` | Yes |
|
| Signum | `signum` | Yes |
|
| Sin | `sin` | Yes |
|
+| Sinh | `sinh` | Yes |
|
| Sqrt | `sqrt` | Yes |
|
| Subtract | `-` | Yes |
|
| Tan | `tan` | Yes |
|
+| Tanh | `tanh` | Yes |
|
| TryAdd | `try_add` | Yes | Only integer inputs are
supported |
| TryDivide | `try_div` | Yes | Only integer inputs are
supported |
| TryMultiply | `try_mul` | Yes | Only integer inputs are
supported |
diff --git a/fuzz-testing/src/main/scala/org/apache/comet/fuzz/Meta.scala
b/fuzz-testing/src/main/scala/org/apache/comet/fuzz/Meta.scala
index 2e29cb930..f8d591be2 100644
--- a/fuzz-testing/src/main/scala/org/apache/comet/fuzz/Meta.scala
+++ b/fuzz-testing/src/main/scala/org/apache/comet/fuzz/Meta.scala
@@ -98,6 +98,7 @@ object Meta {
createUnaryNumericFunction("atan"),
createFunctionWithInputTypes("atan2", Seq(SparkNumericType,
SparkNumericType)),
createUnaryNumericFunction("cos"),
+ createUnaryNumericFunction("cosh"),
createUnaryNumericFunction("exp"),
createUnaryNumericFunction("expm1"),
createFunctionWithInputTypes("log", Seq(SparkNumericType,
SparkNumericType)),
@@ -112,8 +113,10 @@ object Meta {
FunctionSignature(Seq(SparkNumericType, SparkIntType)))),
createUnaryNumericFunction("signum"),
createUnaryNumericFunction("sin"),
+ createUnaryNumericFunction("sinh"),
createUnaryNumericFunction("sqrt"),
createUnaryNumericFunction("tan"),
+ createUnaryNumericFunction("tanh"),
createUnaryNumericFunction("cot"),
createUnaryNumericFunction("ceil"),
createUnaryNumericFunction("floor"),
diff --git a/spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala
b/spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala
index 0bcfb42d0..54df2f168 100644
--- a/spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala
+++ b/spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala
@@ -91,6 +91,7 @@ object QueryPlanSerde extends Logging with CometExprShim {
classOf[Atan2] -> CometAtan2,
classOf[Ceil] -> CometCeil,
classOf[Cos] -> CometScalarFunction("cos"),
+ classOf[Cosh] -> CometScalarFunction("cosh"),
classOf[Divide] -> CometDivide,
classOf[Exp] -> CometScalarFunction("exp"),
classOf[Expm1] -> CometScalarFunction("expm1"),
@@ -109,9 +110,11 @@ object QueryPlanSerde extends Logging with CometExprShim {
classOf[Round] -> CometRound,
classOf[Signum] -> CometScalarFunction("signum"),
classOf[Sin] -> CometScalarFunction("sin"),
+ classOf[Sinh] -> CometScalarFunction("sinh"),
classOf[Sqrt] -> CometScalarFunction("sqrt"),
classOf[Subtract] -> CometSubtract,
classOf[Tan] -> CometScalarFunction("tan"),
+ classOf[Tanh] -> CometScalarFunction("tanh"),
classOf[Cot] -> CometScalarFunction("cot"),
classOf[UnaryMinus] -> CometUnaryMinus,
classOf[Unhex] -> CometUnhex,
diff --git a/spark/src/test/scala/org/apache/comet/CometExpressionSuite.scala
b/spark/src/test/scala/org/apache/comet/CometExpressionSuite.scala
index 0a50f1272..b0c718a2b 100644
--- a/spark/src/test/scala/org/apache/comet/CometExpressionSuite.scala
+++ b/spark/src/test/scala/org/apache/comet/CometExpressionSuite.scala
@@ -1348,13 +1348,16 @@ class CometExpressionSuite extends CometTestBase with
AdaptiveSparkPlanHelper {
"asin",
"atan",
"cos",
+ "cosh",
"exp",
"ln",
"log10",
"log2",
"sin",
+ "sinh",
"sqrt",
"tan",
+ "tanh",
"cot")) {
val (_, cometPlan) =
checkSparkAnswerAndOperatorWithTol(sql(s"SELECT $expr(_1), $expr(_2)
FROM tbl"))
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]