comphead commented on code in PR #19611:
URL: https://github.com/apache/datafusion/pull/19611#discussion_r2658733010
##########
datafusion/functions-aggregate/src/percentile_cont.rs:
##########
@@ -297,76 +212,71 @@ impl AggregateUDFImpl for PercentileCont {
])
}
- fn accumulator(&self, acc_args: AccumulatorArgs) -> Result<Box<dyn
Accumulator>> {
- self.create_accumulator(&acc_args)
+ fn accumulator(&self, args: AccumulatorArgs) -> Result<Box<dyn
Accumulator>> {
+ let percentile = get_percentile(&args)?;
+
+ let input_dt = args.expr_fields[0].data_type();
+ if input_dt.is_null() {
+ return
Ok(Box::new(NoopAccumulator::new(ScalarValue::Float64(None))));
+ }
Review Comment:
Oh I see now, `validate` is part of `get_percentile`, makes sense, we can
prob optimize it in future so function will do mandatory validation however
calc percentile for non null dtypes.
--
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]