Skip to content

Add documentation example for AggregateExprBuilder #15369

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

Closed
alamb opened this issue Mar 23, 2025 · 2 comments · Fixed by #15504
Closed

Add documentation example for AggregateExprBuilder #15369

alamb opened this issue Mar 23, 2025 · 2 comments · Fixed by #15504
Assignees
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@alamb
Copy link
Contributor

alamb commented Mar 23, 2025

          This looks very similar to https://docs.rs/datafusion/latest/datafusion/physical_expr/aggregate/struct.AggregateExprBuilder.html#method.distinct

Though it seems like that structure has no good example, perhaps you could make a PR to add an doc example of how to use it

Originally posted by @alamb in #14413 (comment)

The idea is to add some examples in the rust API documentation showing how to create expressions like

first_value(a ORDER BY x)

Using the AggregateExprBuilder

Something like this (not quite the actual syntax)

let agg_expr = AggregateExprBuilder::new(first_value_udf())
  .args(col("a")
  .order_by(..)
  .build()?
@alamb alamb added documentation Improvements or additions to documentation good first issue Good for newcomers labels Mar 23, 2025
@Shreyaskr1409
Copy link
Contributor

take

@Shreyaskr1409
Copy link
Contributor

@alamb should I add this example to datafusion-examples as well? as per #15504 (comment)

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 good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants