-
Notifications
You must be signed in to change notification settings - Fork 1.8k
docs: Update HOWTOs for adding new functions #18089
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
Conversation
| ## How to add/edit documentation for UDFs | ||
|
|
||
| Documentations for the UDF documentations are generated from code (related [github issue]). To generate markdown run `./update_function_docs.sh`. | ||
|
|
||
| This is necessary after adding new UDF implementation or modifying existing implementation which requires to update documentation. | ||
|
|
||
| ```bash | ||
| ./dev/update_function_docs.sh | ||
| ``` | ||
|
|
||
| [github issue]: https://github.com/apache/datafusion/issues/12740 |
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.
Decided to consolidate with the Adding new functions section above as it has same steps
| - Scalar functions are further grouped into modules for families of functions (e.g. string, math, datetime). | ||
| Functions should be added to the relevant module; if a new module needs to be created then a new [Rust feature] | ||
| should also be added to allow DataFusion users to conditionally compile the modules as needed | ||
| - Aggregate functions can optionally implement a [`GroupsAccumulator`] for better performance |
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 nice to add what exactly needed to implement from GroupsAccumulator to achieve performance
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 prefer to keep this to high level steps; ideally such details would be present in the GroupsAccumulator doc itself in my opinion
| markdown document [here][fn-doc-home] (see the documents for [scalar][fn-doc-scalar], | ||
| [aggregate][fn-doc-aggregate] and [window][fn-doc-window] functions) | ||
|
|
||
| - You _should not_ manually update the markdown document after running the script as those manual |
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.
In fact the CI will also complain :)
| ## How to update protobuf/gen dependencies | ||
|
|
||
| The prost/tonic code can be generated by running `./regen.sh`, which in turn invokes the Rust binary located in `./gen` | ||
| For the `proto` and `proto-common` crates, the prost/tonic code is generated by running their respective `./regen.sh` scripts, |
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 nice to provide relative path
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.
Updated the sh block below 👍
comphead
left a comment
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 @Jefffrey
Co-authored-by: Oleks V <comphead@users.noreply.github.com>
Co-authored-by: Oleks V <comphead@users.noreply.github.com>
comphead
left a comment
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 @Jefffrey
## Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes apache#123` indicates that this PR will close issue apache#123. --> - Closes apache#12220 ## Rationale for this change <!-- Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed. Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes. --> Updating documentation on adding new functions; aggregate instructions were old, and adding in other types too (window, table) ## What changes are included in this PR? <!-- There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR. --> Updated instructions for adding new functions to DataFusion. Also did some other touchups on the docs. ## Are these changes tested? Doc changes only. <!-- We typically require tests for all PRs in order to: 1. Prevent the code from being accidentally broken by subsequent changes 2. Serve as another way to document the expected behavior of the code If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? --> ## Are there any user-facing changes? Doc changes only. <!-- If there are user-facing changes then we may require documentation to be updated before approving the PR. --> <!-- If there are any breaking changes to public APIs, please add the `api change` label. --> --------- Co-authored-by: Oleks V <comphead@users.noreply.github.com>
Which issue does this PR close?
Rationale for this change
Updating documentation on adding new functions; aggregate instructions were old, and adding in other types too (window, table)
What changes are included in this PR?
Updated instructions for adding new functions to DataFusion. Also did some other touchups on the docs.
Are these changes tested?
Doc changes only.
Are there any user-facing changes?
Doc changes only.