dd-annarose commented on code in PR #25337:
URL: https://github.com/apache/datafusion/pull/25337#discussion_r4231613180
##########
datafusion/functions-aggregate/src/approx_percentile_cont_with_weight.rs:
##########
@@ -308,6 +308,9 @@ impl Accumulator for ApproxPercentileWithWeightAccumulator {
}
fn update_batch(&mut self, values: &[ArrayRef]) -> Result<()> {
+ self.approx_percentile_cont_accumulator
+ .resolve_percentile(&values[2])?;
Review Comment:
> values contains the arguments to this aggregate function.
The aggregate function's `accumulator()` also returns an error if there are
not 3 or 4 arguments (`approx_percentile_cont_with_weight requires three or
four arguments: value, weight, percentile[, centroids]`).
But I can add an assertion here if you'd prefer.
##########
datafusion/functions-aggregate/src/approx_percentile_cont_with_weight.rs:
##########
@@ -308,6 +308,9 @@ impl Accumulator for ApproxPercentileWithWeightAccumulator {
}
fn update_batch(&mut self, values: &[ArrayRef]) -> Result<()> {
+ self.approx_percentile_cont_accumulator
+ .resolve_percentile(&values[2])?;
Review Comment:
> values contains the arguments to this aggregate function.
The aggregate function's `accumulator()` also returns an error if there are
not 3 or 4 arguments (`approx_percentile_cont_with_weight requires three or
four arguments: value, weight, percentile[, centroids]`).
But I can add an assertion here if you'd prefer.
--
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]