Skip to content

Commit d01301d

Browse files
authored
Docs: Explain the usage of logical expressions for create_aggregate_expr (#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]>
1 parent bfd8156 commit d01301d

File tree

1 file changed

+8
-0
lines changed
  • datafusion/physical-expr-common/src/aggregate

1 file changed

+8
-0
lines changed

datafusion/physical-expr-common/src/aggregate/mod.rs

+8
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ use datafusion_expr::utils::AggregateOrderSensitivity;
4343

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

0 commit comments

Comments
 (0)