Skip to content

Register missing TAN function for analytics engine - #5717

Merged
dai-chen merged 1 commit into
opensearch-project:mainfrom
dai-chen:register-tan-calcite-operator
Aug 25, 2026
Merged

Register missing TAN function for analytics engine#5717
dai-chen merged 1 commit into
opensearch-project:mainfrom
dai-chen:register-tan-calcite-operator

Conversation

@dai-chen

@dai-chen dai-chen commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Description

TAN was already declared in both the SQL and PPL grammars, and it works on the V2 engine, but PPLFuncImpTable registered every other trigonometric function and omitted this one. On the PPL V3 and analytics engine path, the resolution therefore failed with IllegalStateException: Cannot resolve function: TAN. This PR registers the operator against SqlStdOperatorTable.TAN, fixing both SQL and PPL path.

Related Issues

Part of #5248

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • New functionality has javadoc added.
  • New functionality has a user manual doc added.
  • New PPL command checklist all confirmed.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff or -s.
  • Public documentation issue/PR created.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

TAN was already declared in BuiltinFunctionName and tokenized in the
SQL and PPL grammars, but was never registered in PPLFuncImpTable. On
the Calcite path resolving it threw "Cannot resolve function: TAN",
which surfaced to SQL callers as "Failed to plan query: unexpected
error". The other trigonometric functions were registered, so the gap
affected TAN only.

Also document TAN in the PPL math function reference, which listed the
other trigonometric functions but omitted it.

Signed-off-by: Chen Dai <daichen@amazon.com>
@dai-chen dai-chen self-assigned this Aug 24, 2026
@dai-chen dai-chen added the enhancement New feature or request label Aug 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🧪 PR contains tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ No major issues detected

@dai-chen dai-chen changed the title Register TAN as a Calcite operator Register missing TAN function for analytics engine Aug 24, 2026
@dai-chen
dai-chen marked this pull request as ready for review August 24, 2026 21:58
@dai-chen
dai-chen merged commit 6472b59 into opensearch-project:main Aug 25, 2026
47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants