Skip to content

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

Open
lriggs wants to merge 3 commits into
apache:mainfrom
lriggs:addLN
Open

GH-50457: [C++][Gandiva] Add LN alias for LOG#50458
lriggs wants to merge 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
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.

2 participants