Skip to content

Add documentation example for AggregateExprBuilder #15504

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

Merged
merged 7 commits into from
Apr 2, 2025

Conversation

Shreyaskr1409
Copy link
Contributor

Which issue does this PR close?

Rationale for this change

Adding a documentation example for AggregateExprBuilder making it easier for users to follow along while creating an AggregateExpr.

What changes are included in this PR?

Changes to physical-expr/src/aggregate.rs
These changes are majorly documentation additions to aggregate.rs

Are these changes tested?

AggregateUDF creation example is tested.
AggregateFunctionExpr creation example is not tested. (I will be adding the issue I am facing in comments below)

I really appreciate any help, even regarding making the documentation more detailed.

Are there any user-facing changes?

Yes they are. They can see documentation example for AggregateExprBuilder in rust docs.

image

@github-actions github-actions bot added the physical-expr Changes to the physical-expr crates label Mar 31, 2025
@Shreyaskr1409
Copy link
Contributor Author

The problems I am facing are:

  1. i can not use datafusion crate inside the examples. i could not test the portion where I am building from AggregateExprBuilder.
    image
  2. the examples I will be writing will be isolated from each other. I could not find a way to write these examples separately.

@berkaysynnada
Copy link
Contributor

Very nice example, thank you @Shreyaskr1409. Perhaps we can make this in datafusion-examples as well?

@Shreyaskr1409
Copy link
Contributor Author

@berkaysynnada thank you, actually I did use the datafusion-examples as reference.

Perhaps we can make this in datafusion-examples as well

Yeah that could also be done with maybe a few minor adjustments. If you want, I can do that as well once I have the active conversations reviewed and resolved.

@alamb
Copy link
Contributor

alamb commented Apr 1, 2025

@berkaysynnada thank you, actually I did use the datafusion-examples as reference.

Perhaps we can make this in datafusion-examples as well

Yeah that could also be done with maybe a few minor adjustments. If you want, I can do that as well once I have the active conversations reviewed and resolved.

I think it would be good to avoid having duplicated content in datafusion-examples and the normal documentation. I personally think the documentation site is more accessable (more chance of someone reading / finding it via search) than rust examples in the repository

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you so much @Shreyaskr1409 -- this is a great start. I left a suggestion on how to make a doc example without dependency -- let me know if it makes sense

@alamb alamb added the documentation Improvements or additions to documentation label Apr 1, 2025
@Shreyaskr1409
Copy link
Contributor Author

Shreyaskr1409 commented Apr 1, 2025

@alamb Thank you so much, I have resolved all the conversations. Everything is working and tested, and even I got to learn new stuff from this.

This will be visible in the documentation:
image

@github-actions github-actions bot removed the documentation Improvements or additions to documentation label Apr 1, 2025
@Shreyaskr1409 Shreyaskr1409 requested a review from alamb April 1, 2025 16:55
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you @Shreyaskr1409 -- I think this PR looks pretty good now, though the example could be shortened significantly.

We could also do that as a follow on PR

@alamb
Copy link
Contributor

alamb commented Apr 1, 2025

I also merged up from main to fix the CO

@Shreyaskr1409
Copy link
Contributor Author

@alamb thank you

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Love it @Shreyaskr1409 ❤️

@alamb alamb merged commit 50c6241 into apache:main Apr 2, 2025
27 checks passed
@alamb alamb added the documentation Improvements or additions to documentation label Apr 2, 2025
nirnayroy pushed a commit to nirnayroy/datafusion that referenced this pull request May 2, 2025
* Add formatting changes and fix the merge issue

* Fix formatting

* Fixed a faulty statement

* Folded irrelevant sections from example

* Fix formatting

* Add unimplemented!()

---------

Co-authored-by: Andrew Lamb <[email protected]>
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 physical-expr Changes to the physical-expr crates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add documentation example for AggregateExprBuilder
3 participants