This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new d01301d2ee Docs: Explain the usage of logical expressions for
`create_aggregate_expr` (#11458)
d01301d2ee is described below
commit d01301d2ee9ea6d8e22e002bdfb5cf7b6ff6bd75
Author: Jay Zhan <[email protected]>
AuthorDate: Tue Jul 16 01:55:49 2024 +0800
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]>
---
datafusion/physical-expr-common/src/aggregate/mod.rs | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/datafusion/physical-expr-common/src/aggregate/mod.rs
b/datafusion/physical-expr-common/src/aggregate/mod.rs
index 35666f199a..db4581a622 100644
--- a/datafusion/physical-expr-common/src/aggregate/mod.rs
+++ b/datafusion/physical-expr-common/src/aggregate/mod.rs
@@ -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,
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]