lriggs opened a new pull request, #50458: URL: https://github.com/apache/arrow/pull/50458
### Rationale for this change `LN` is the standard SQL name for the natural logarithm, while Gandiva exposes it as `log`. Adding `ln` as an alias lets SQL engines that emit `LN(x)` route to the same precompiled `log_<type>` functions without duplicating any C code. The alias mechanism already exists in Gandiva and is used for `pow` (alias of `power`), `trunc` (alias of `truncate`), and `udfdegrees` (alias of `degrees`). ### What changes are included in this PR? `NativeFunction` accepts a `base_name` and a `std::vector<std::string> aliases`. Each alias gets its own `FunctionSignature` that points to the same precompiled (`pc_name`) function — so `ln_int32` does not need to exist; the alias `"ln"` resolves to the same IR symbol `log_int32`. The `MATH_UNARY_OPS(name, ALIASES)` macro in `function_registry_math_ops.cc` expands to six `NativeFunction` entries (int32, int64, uint32, uint64, float32, float64), all forwarding to the corresponding `log_<type>` precompiled symbols. ### Are these changes tested? New unit tests. ### Are there any user-facing changes? Yes, a new Gandiva function. -- 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]
