Is your feature request related to a problem or challenge?
approx_percentile_cont's fluent API currently exposes expression and percentile.
|
make_udaf_expr_and_func!( |
|
ApproxPercentileCont, |
|
approx_percentile_cont, |
|
expression percentile, |
|
"Computes the approximate percentile continuous of a set of numbers", |
|
approx_percentile_cont_udaf |
|
); |
However, as described in the datafusion docs, the UDAF accepts a 3rd optional argument, an integer number of centroids for T-Digest
|
impl ApproxPercentileCont { |
|
/// Create a new [`ApproxPercentileCont`] aggregate function. |
|
pub fn new() -> Self { |
|
let mut variants = Vec::with_capacity(NUMERICS.len() * (INTEGERS.len() + 1)); |
|
// Accept any numeric value paired with a float64 percentile |
|
for num in NUMERICS { |
|
variants.push(TypeSignature::Exact(vec![num.clone(), DataType::Float64])); |
|
// Additionally accept an integer number of centroids for T-Digest |
|
for int in INTEGERS { |
|
variants.push(TypeSignature::Exact(vec![ |
|
num.clone(), |
|
DataType::Float64, |
|
int.clone(), |
|
])) |
|
} |
|
} |
|
Self { |
|
signature: Signature::one_of(variants, Volatility::Immutable), |
|
} |
Describe the solution you'd like
Consistent with exposing optional arguments for array_slice and regexp_* fluent apis, add a 3rd optional argument to approx_percentile_cont's fluent API.
Describe alternatives you've considered
No response
Additional context
I'll have a PR for this shortly.
Is your feature request related to a problem or challenge?
approx_percentile_cont's fluent API currently exposesexpressionandpercentile.datafusion/datafusion/functions-aggregate/src/approx_percentile_cont.rs
Lines 49 to 55 in 1ecdf90
However, as described in the datafusion docs, the UDAF accepts a 3rd optional argument, an integer number of centroids for T-Digest
datafusion/datafusion/functions-aggregate/src/approx_percentile_cont.rs
Lines 76 to 94 in 1ecdf90
Describe the solution you'd like
Consistent with exposing optional arguments for array_slice and regexp_* fluent apis, add a 3rd optional argument to
approx_percentile_cont's fluent API.Describe alternatives you've considered
No response
Additional context
I'll have a PR for this shortly.