(&mut self, values: &[ArrayRef])
| 509 | |
| 510 | impl Accumulator for AvgAccumulator { |
| 511 | fn update_batch(&mut self, values: &[ArrayRef]) -> Result<()> { |
| 512 | let values = values[0].as_primitive::<Float64Type>(); |
| 513 | self.count += (values.len() - values.null_count()) as u64; |
| 514 | if let Some(x) = sum(values) { |
| 515 | let v = self.sum.get_or_insert(0.); |
| 516 | *v += x; |
| 517 | } |
| 518 | Ok(()) |
| 519 | } |
| 520 | |
| 521 | fn evaluate(&mut self) -> Result<ScalarValue> { |
| 522 | // In sliding-window mode `retract_batch` can bring `count` back to 0 |
nothing calls this directly
no test coverage detected