-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Prepare function guidelines #23291
Prepare function guidelines #23291
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! A few minor nits.
Suggest considering where to link to this new document from - maybe add a link to FUNCTIONS.md to CONTRIBUTING.md, or to the Presto Development Guidelines.
Perhaps the contents of this document could be a new section in the Presto Development Guidelines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, except I would mention that we shouldn't be adding "core" SQL-defined functions. Those should go in optional modules.
FUNCTIONS.md
Outdated
|
||
Presto also includes extension functions that can optionally be enabled in particular deployments. | ||
|
||
Finally, Presto allows users to write user defined functions (UDFs) in either Java or SQL that are not stored in this GitHub repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally, Presto allows users to write user defined functions (UDFs) in either Java or SQL that are not stored in this GitHub repository. | |
Finally, Presto allows users to write user defined functions (UDFs) in either Java or SQL that are not stored in this GitHub repository. [This is done through the Plugin SPI.](https://prestodb.io/docs/current/develop/functions.html) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! (docs)
0f5cd8a
to
3a18c33
Compare
FUNCTIONS.md
Outdated
|
||
Presto includes a large library of built-in, core SQL functions such as AVG and CONCAT that are available in every deployment. | ||
|
||
Presto also includes extension functions that are not enabled by default but can be optionally enabled in particular deployments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be great to have an example of these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed. Anyone happen to know of any? I'll look in the code, but if anyone can point to one it would save me a bit of time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is implicit in the fact that functions are a part of the Plugin
interface. The way to "enable" functions is to add the plugins. I don't think there's really any examples of functions that are enabled via a toggle.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rewritten
3fd0b1a
to
a9f69af
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for writing this up @elharo!
One thing just occurred to me, we should probably link to this document from CONTRIBUTING. |
sure, let me figure out links work in markdown |
239c0c3
to
07b4890
Compare
FUNCTIONS.md
Outdated
|
||
Built-in functions that extend Presto into new domains should have a detailed plan and ideally an implementation for a library of functions that cover the domain. For instance, a function that only added US dollars would not be accepted. However, a general library for working with currency data along the lines of [Joda-Money](https://www.joda.org/joda-money/) could be considered. It can be helpful to prototype complex functionality like this in UDFs before writing an RFC and submitting it to the Presto project. | ||
|
||
Built-in and extension functions bundled with Presto must be freely available without fee and compatible with the Presto license. Functions using algorithms that are in any way restricted by copyright, patent, trademark, field of use, or other reasons will not be included in this repository. For instance, a patented video CODEC cannot be used. Functions that include trademarked names should be UDFs outside this repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no Presto license.
Built-in and extension functions bundled with Presto must be freely available without fee and compatible with the Presto license. Functions using algorithms that are in any way restricted by copyright, patent, trademark, field of use, or other reasons will not be included in this repository. For instance, a patented video CODEC cannot be used. Functions that include trademarked names should be UDFs outside this repository. | |
Built-in and extension functions bundled with Presto must be freely available without fee and compatible with an Apache license. Functions using algorithms that are in any way restricted by copyright, patent, trademark, field of use, or other reasons will not be included in this repository. For instance, a patented video CODEC cannot be used. Functions that include trademarked names should be UDFs outside this repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PTAL @tdcmeehan I think your comments are addressednow
Description
Elucidate what functions do and don't belong in core
Motivation and Context
Mutliple PRs have been proposing individual functions for very specific purposes without taking a holistic view of what Presto's function library should look like.
Impact
none
Test Plan
CI
Contributor checklist
Release Notes