Skip to content
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

docs: add sql examples for window functions #13551

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

spencerscott917
Copy link

Which issue does this PR close?

Closes #13399

Rationale for this change

Give users examples of how to use window functions and intuition about how these functions work

What changes are included in this PR?

Examples for each window function are now provided in documentation.

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Nov 24, 2024
@alamb
Copy link
Contributor

alamb commented Nov 24, 2024

Thank you @spencerscott917 🙏

Since the user documentation is generated, I think you will have to add these examples to get the CI to pass

Here is an example of how to do it https://github.com/apache/datafusion/pull/13390/files

Basically put the markdown you have made into rust and a .with_sql_example(r#

@spencerscott917
Copy link
Author

spencerscott917 commented Nov 25, 2024

Thank you @spencerscott917 🙏

Since the user documentation is generated, I think you will have to add these examples to get the CI to pass

Here is an example of how to do it https://github.com/apache/datafusion/pull/13390/files

Basically put the markdown you have made into rust and a .with_sql_example(r#

Sounds good, I will give that a go. Thanks for the example to follow @alamb

```sql
SELECT x, y, percent_rank() OVER (ORDER BY y) AS percent_rank FROM VALUES (1,0), (2,75), (3,100), (4,25), (5,50) t(x,y);

+---+-----+--------------+
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are nice

@alamb alamb marked this pull request as draft November 25, 2024 16:35
@alamb
Copy link
Contributor

alamb commented Nov 25, 2024

Marking as draft as I think this PR is no longer waiting on feedback. Please mark it as ready for review when it is ready for another look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add SQL examples to window functions: nth_value, etc
2 participants