gengliangwang opened a new pull request, #56229:
URL: https://github.com/apache/spark/pull/56229

   ### What changes were proposed in this pull request?
   
   Add `ExpressionImplUtils.asinh(double x)` (the fdlibm `s_asinh.c` algorithm) 
and route `Asinh`'s eval and codegen paths through it. `Asinh.doGenCode` 
previously emitted a ~14-line inline five-branch if/else; it now emits a single 
`ExpressionImplUtils.asinh(...)` call via `defineCodeGen`, and the eval path 
calls the same helper instead of an inline lambda copy of the algorithm.
   
   `asinh` returns a primitive `double`, so the helper is a clean drop-in for 
both paths with no boxing and no null handling. Sibling of SPARK-57177 (Acosh).
   
   ### Why are the changes needed?
   
   Part of SPARK-56908 (umbrella). Collapsing the duplicated ~14-line algorithm 
to a single call shrinks the generated Java for every stage that uses `asinh`, 
and removes the eval/codegen duplication of the same fdlibm algorithm, helping 
with the JVM 64KB method / constant-pool limits, Janino compile time, and JIT 
work.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. The compiled behavior is identical; only the emitted Java source text 
changes.
   
   ### How was this patch tested?
   
   ```
   build/sbt "catalyst/testOnly *MathExpressionsSuite"
   ```
   
   Pass, including `asinh` and `SPARK-56089: asinh/acosh fdlibm algorithm 
coverage` (exercised both with and without whole-stage codegen).
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Opus 4.8)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to