Skip to content

[AURON #2126] Add native support for acosh function#2127

Closed
weimingdiit wants to merge 2 commits intoapache:masterfrom
weimingdiit:feat/add-ascii-function
Closed

[AURON #2126] Add native support for acosh function#2127
weimingdiit wants to merge 2 commits intoapache:masterfrom
weimingdiit:feat/add-ascii-function

Conversation

@weimingdiit
Copy link
Copy Markdown
Contributor

@weimingdiit weimingdiit commented Mar 28, 2026

Which issue does this PR close?

Closes # #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.

Add Spark ascii expression conversion in NativeConverters so it maps to the existing backend Ascii scalar function, and add a regression test for ascii in AuronFunctionSuite.

Signed-off-by: weimingdiit <weimingdiit@gmail.com>
@github-actions github-actions bot added the spark label Mar 28, 2026
@weimingdiit weimingdiit marked this pull request as draft March 28, 2026 14:14
@weimingdiit weimingdiit marked this pull request as ready for review March 28, 2026 17:17
@slfan1989 slfan1989 requested a review from Copilot March 29, 2026 03:17
@slfan1989 slfan1989 self-assigned this Mar 29, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Spark ascii() expression support to the Spark extension by converting Catalyst Ascii expressions into the already-existing native backend ScalarFunction::Ascii, and introduces a regression test to ensure the plan remains fully native and results match vanilla Spark.

Changes:

  • Convert Spark Ascii expressions in NativeConverters to pb.ScalarFunction.Ascii.
  • Add an ascii regression test to AuronFunctionSuite using checkSparkAnswerAndOperator.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
spark-extension/src/main/scala/org/apache/spark/sql/auron/NativeConverters.scala Maps Catalyst Ascii to the native scalar function enum so it can be planned/executed natively.
spark-extension-shims-spark/src/test/scala/org/apache/auron/AuronFunctionSuite.scala Adds a regression test validating ascii() correctness vs Spark and enforcing native operator usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…ronFunctionSuite.scala

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@weimingdiit weimingdiit changed the title [AURON #2126] Add native support for ascii function [AURON #2126] Add native support for acosh function Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants