Skip to content

Commit

Permalink
Docs: Explain the usage of logical expressions for `create_aggregate_…
Browse files Browse the repository at this point in the history
…expr` (apache#11458)

* doc: comment

Signed-off-by: jayzhan211 <[email protected]>

* fmt

Signed-off-by: jayzhan211 <[email protected]>

* fix

Signed-off-by: jayzhan211 <[email protected]>

---------

Signed-off-by: jayzhan211 <[email protected]>
  • Loading branch information
jayzhan211 authored and findepi committed Jul 16, 2024
1 parent fceb059 commit 1edd82b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions datafusion/physical-expr-common/src/aggregate/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ use datafusion_expr::utils::AggregateOrderSensitivity;

/// Creates a physical expression of the UDAF, that includes all necessary type coercion.
/// This function errors when `args`' can't be coerced to a valid argument type of the UDAF.
///
/// `input_exprs` and `sort_exprs` are used for customizing Accumulator
/// whose behavior depends on arguments such as the `ORDER BY`.
///
/// For example to call `ARRAY_AGG(x ORDER BY y)` would pass `y` to `sort_exprs`, `x` to `input_exprs`
///
/// `input_exprs` and `sort_exprs` are used for customizing Accumulator as the arguments in `AccumulatorArgs`,
/// if you don't need them it is fine to pass empty slice `&[]`.
#[allow(clippy::too_many_arguments)]
pub fn create_aggregate_expr(
fun: &AggregateUDF,
Expand Down

0 comments on commit 1edd82b

Please sign in to comment.