Jefffrey commented on code in PR #21074:
URL: https://github.com/apache/datafusion/pull/21074#discussion_r3090323262
##########
datafusion/functions-aggregate/src/approx_percentile_cont.rs:
##########
@@ -132,22 +132,45 @@ impl Default for ApproxPercentileCont {
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),
- }
+ // Additionally accept an integer number of centroids for T-Digest
+ let signature = Signature::one_of(
Review Comment:
Since we're now coercing to floats, we can remove some of the implementation
code that handles integer types
--
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]