This is an automated email from the ASF dual-hosted git repository.
slfan1989 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/auron.git
The following commit(s) were added to refs/heads/master by this push:
new 4b92ce31 [AURON #2126] Add native support for acosh function (#2135)
4b92ce31 is described below
commit 4b92ce3133862d835c744764065fda08215d234c
Author: Ming Wei <[email protected]>
AuthorDate: Wed Apr 1 10:25:25 2026 +0800
[AURON #2126] Add native support for acosh function (#2135)
# Which issue does this PR close?
Closes # https://github.com/apache/auron/issues/2126
# Rationale for this change
Spark Acosh expressions were not wired into Auron’s standard builtin
scalar function conversion path, so acosh(expr) could not be planned
through the native backend.
This change follows the existing ScalarFunction flow used by other
builtin math functions such as acos, asin, and atan: Spark expression
conversion in NativeConverters, protobuf enum registration in
auron.proto, and planner mapping in planner.rs. This keeps acosh aligned
with the current architecture instead of introducing a custom extension
function path.
# What changes are included in this PR?
This PR:
adds Spark Acosh expression conversion in NativeConverters
introduces ScalarFunction::Acosh in auron.proto
maps ScalarFunction::Acosh in planner.rs
enables acosh(expr) through the standard builtin ScalarFunction chain
# Are there any user-facing changes?
No.
# How was this patch tested?
CI.
---------
Signed-off-by: weimingdiit <[email protected]>
---
native-engine/auron-planner/proto/auron.proto | 1 +
native-engine/auron-planner/src/planner.rs | 1 +
.../src/test/scala/org/apache/auron/AuronFunctionSuite.scala | 8 ++++++++
.../main/scala/org/apache/spark/sql/auron/NativeConverters.scala | 1 +
4 files changed, 11 insertions(+)
diff --git a/native-engine/auron-planner/proto/auron.proto
b/native-engine/auron-planner/proto/auron.proto
index 22c9947e..b0618b97 100644
--- a/native-engine/auron-planner/proto/auron.proto
+++ b/native-engine/auron-planner/proto/auron.proto
@@ -208,6 +208,7 @@ message PhysicalCaseNode {
enum ScalarFunction {
Abs=0;
Acos=1;
+ Acosh=68;
Asin=2;
Atan=3;
Ascii=4;
diff --git a/native-engine/auron-planner/src/planner.rs
b/native-engine/auron-planner/src/planner.rs
index 254c32f0..84a62573 100644
--- a/native-engine/auron-planner/src/planner.rs
+++ b/native-engine/auron-planner/src/planner.rs
@@ -1226,6 +1226,7 @@ impl From<protobuf::ScalarFunction> for Arc<ScalarUDF> {
ScalarFunction::Tan => f::math::tan(),
ScalarFunction::Asin => f::math::asin(),
ScalarFunction::Acos => f::math::acos(),
+ ScalarFunction::Acosh => f::math::acosh(),
ScalarFunction::Atan => f::math::atan(),
ScalarFunction::Exp => f::math::exp(),
ScalarFunction::Log => f::math::log(),
diff --git
a/spark-extension-shims-spark/src/test/scala/org/apache/auron/AuronFunctionSuite.scala
b/spark-extension-shims-spark/src/test/scala/org/apache/auron/AuronFunctionSuite.scala
index 442a6f51..ef07ce3a 100644
---
a/spark-extension-shims-spark/src/test/scala/org/apache/auron/AuronFunctionSuite.scala
+++
b/spark-extension-shims-spark/src/test/scala/org/apache/auron/AuronFunctionSuite.scala
@@ -293,6 +293,14 @@ class AuronFunctionSuite extends AuronQueryTest with
BaseAuronSQLSuite {
}
}
+ test("acosh null propagation") {
+ withTable("t1") {
+ sql("create table t1(c1 double) using parquet")
+ sql("insert into t1 values(null), (0.0), (1.0), (2.0)")
+ checkSparkAnswerAndOperator("select acosh(c1) from t1")
+ }
+ }
+
test("test function least") {
withTable("test_least") {
sql(
diff --git
a/spark-extension/src/main/scala/org/apache/spark/sql/auron/NativeConverters.scala
b/spark-extension/src/main/scala/org/apache/spark/sql/auron/NativeConverters.scala
index aee252f2..68007c83 100644
---
a/spark-extension/src/main/scala/org/apache/spark/sql/auron/NativeConverters.scala
+++
b/spark-extension/src/main/scala/org/apache/spark/sql/auron/NativeConverters.scala
@@ -826,6 +826,7 @@ object NativeConverters extends Logging {
case e: Tan => buildScalarFunction(pb.ScalarFunction.Tan, e.children,
e.dataType)
case e: Asin => buildScalarFunction(pb.ScalarFunction.Asin, e.children,
e.dataType)
case e: Acos => buildScalarFunction(pb.ScalarFunction.Acos, e.children,
e.dataType)
+ case e: Acosh => buildScalarFunction(pb.ScalarFunction.Acosh,
e.children, e.dataType)
case e: Atan => buildScalarFunction(pb.ScalarFunction.Atan, e.children,
e.dataType)
case e: Exp => buildScalarFunction(pb.ScalarFunction.Exp, e.children,
e.dataType)
case e: Log =>