Skip to content

GH-50457: [C++][Gandiva] Add LN alias for LOG#50458

Merged
kou merged 3 commits into
apache:mainfrom
lriggs:addLN
Jul 13, 2026
Merged

GH-50457: [C++][Gandiva] Add LN alias for LOG#50458
kou merged 3 commits into
apache:mainfrom
lriggs:addLN

Conversation

@lriggs

@lriggs lriggs commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

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.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

⚠️ GitHub issue #50457 has been automatically assigned in GitHub to PR creator.

@kou kou changed the title GH-50457 Add LN alias for LOG GH-50457: [C++][Gandiva] Add LN alias for LOG Jul 10, 2026

@dmitry-chirkov-dremio dmitry-chirkov-dremio left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ship it!

@github-actions github-actions Bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Jul 10, 2026

@kou kou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1

@kou
kou merged commit 83c185b into apache:main Jul 13, 2026
56 checks passed
@kou kou removed the awaiting committer review Awaiting committer review label Jul 13, 2026
@github-actions github-actions Bot added the awaiting merge Awaiting merge label Jul 13, 2026
@conbench-apache-arrow

Copy link
Copy Markdown

After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 83c185b.

There was 1 benchmark result indicating a performance regression:

The full Conbench report has more details. It also includes information about 2 possible false positives for unstable benchmarks that are known to sometimes produce them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants