Skip to content

Introduce getSqlInvokedFunctions SPI and BuiltInPluginFunctionNamespaceManager for registering sql invoked functions #25597

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pdabre12
Copy link
Contributor

@pdabre12 pdabre12 commented Jul 22, 2025

Description

Introduces a new getSqlInvokedFunctions SPI in Presto, which only supports SQL invoked functions. This SPI enables plugins to register SQL invoked functions via a new built-in plugin function namespace manager interface: BuiltInPluginFunctionNamespaceManager.

Motivation and Context

This change is motivated by the need to safely support SQL invoked functions that may overlap with native C++ functions
pulled from the sidecar. By registering inlined SQL invoked functions through a dedicated SPI and validating them against the functions residing in the default function namespace manager, we ensure clear separate and prevent conflicts in function resolution.

Impact

No impact for now, but after this change the inlined SQL invoked functions would no longer be registered as built in functions under the BuiltInTypeAndFunctionNamespaceManager but instead be provided via a plugin.

Test Plan

CI and Unit tests

Contributor checklist

  • Please make sure your submission complies with our contributing guide, in particular code style and commit standards.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.

Release Notes

Please follow release notes guidelines and fill in the release notes below.

== RELEASE NOTES ==

SPI changes
* Add a new  `getSqlInvokedFunctions` SPI  in Presto, which only supports SQL invoked functions

General Changes
* Add a new built-in plugin function namespace manager interface: `BuiltInPluginFunctionNamespaceManager`.

@prestodb-ci prestodb-ci added the from:IBM PR from IBM label Jul 22, 2025
@pdabre12 pdabre12 changed the title Introduce getSqlFunctions SPI and BuiltInPluginFunctionNamespaceManager for plugin functions Introduce getSqlFunctions SPI and BuiltInPluginFunctionNamespaceManager for registering sql invoked functions Jul 22, 2025
@pdabre12 pdabre12 marked this pull request as ready for review July 22, 2025 21:12
@pdabre12 pdabre12 requested a review from a team as a code owner July 22, 2025 21:12
@prestodb-ci prestodb-ci requested review from a team, wanglinsong and nmahadevuni and removed request for a team July 22, 2025 21:12
@pdabre12 pdabre12 changed the title Introduce getSqlFunctions SPI and BuiltInPluginFunctionNamespaceManager for registering sql invoked functions Introduce getSqlInvokedFunctions SPI and BuiltInPluginFunctionNamespaceManager for registering sql invoked functions Jul 22, 2025
@pdabre12 pdabre12 force-pushed the sql-invoked-functions-SPI branch from 9132721 to 343f6e3 Compare July 22, 2025 22:48
@pdabre12 pdabre12 force-pushed the sql-invoked-functions-SPI branch 2 times, most recently from 6b2e35c to 6977df3 Compare July 25, 2025 18:48
@pdabre12 pdabre12 requested a review from kevintang2022 July 25, 2025 18:48
…ceManager for registering sql invoked functions
@pdabre12 pdabre12 force-pushed the sql-invoked-functions-SPI branch from 6977df3 to 8825888 Compare July 25, 2025 19:03
@pdabre12
Copy link
Contributor Author

@rschlussel @tdcmeehan Can you please have a look?

@kevintang2022
Copy link
Contributor

Hi Pratik. I have some questions:

  1. Why are we only doing this for SqlInvoked function? Is it just for the inline sql functions use case?
  2. What happens if there is a naming conflict? The server fails to start. Do you think it would be useful in the case that we do run into a conflict, then we have some logic to determine which of the two functions to keep?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
from:IBM PR from IBM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants