Skip to content

Add documentation example for AggregateExprBuilder #15369

Closed

Description

@alamb
          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()?

Activity

  1. Shreyaskr1409 commented on Mar 23, 2025

    @Shreyaskr1409
    Contributor

    take

  2. Shreyaskr1409 commented on Apr 1, 2025

    @Shreyaskr1409
    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

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationgood first issueGood for newcomers

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions