jcsherin commented on code in PR #17003:
URL: https://github.com/apache/datafusion/pull/17003#discussion_r2253629294
##########
datafusion/functions-aggregate/src/approx_percentile_cont_with_weight.rs:
##########
@@ -25,39 +25,66 @@ use arrow::datatypes::FieldRef;
use arrow::{array::ArrayRef, datatypes::DataType};
use datafusion_common::ScalarValue;
use datafusion_common::{not_impl_err, plan_err, Result};
+use datafusion_expr::expr::{AggregateFunction, Sort};
use datafusion_expr::function::{AccumulatorArgs, StateFieldsArgs};
-use datafusion_expr::type_coercion::aggregates::NUMERICS;
+use datafusion_expr::type_coercion::aggregates::{INTEGERS, NUMERICS};
use datafusion_expr::Volatility::Immutable;
use datafusion_expr::{
- Accumulator, AggregateUDFImpl, Documentation, Signature, TypeSignature,
-};
-use datafusion_functions_aggregate_common::tdigest::{
- Centroid, TDigest, DEFAULT_MAX_SIZE,
+ Accumulator, AggregateUDFImpl, Documentation, Expr, Signature,
TypeSignature,
};
+use datafusion_functions_aggregate_common::tdigest::{Centroid, TDigest};
use datafusion_macros::user_doc;
use crate::approx_percentile_cont::{ApproxPercentileAccumulator,
ApproxPercentileCont};
-make_udaf_expr_and_func!(
+create_func!(
ApproxPercentileContWithWeight,
- approx_percentile_cont_with_weight,
- expression weight percentile,
- "Computes the approximate percentile continuous with weight of a set of
numbers",
approx_percentile_cont_with_weight_udaf
);
+/// Computes the approximate percentile continuous with weight of a set of
numbers
+pub fn approx_percentile_cont_with_weight(
+ order_by: Sort,
Review Comment:
https://docs.rs/datafusion/latest/datafusion/functions_aggregate/approx_percentile_cont_with_weight/fn.approx_percentile_cont_with_weight.html
The first argument has changed from `Expr` in the current API to `Sort`.
```rust
pub fn approx_percentile_cont_with_weight(
expression: Expr,
weight: Expr,
percentile: Expr,
) -> Expr
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]