MCPcopy Create free account
hub / github.com/apache/datafusion / update_batch

Method update_batch

datafusion/functions-aggregate/src/sum.rs:416–423  ·  view source on GitHub ↗
(&mut self, values: &[ArrayRef])

Source from the content-addressed store, hash-verified

414 }
415
416 fn update_batch(&mut self, values: &[ArrayRef]) -> Result<()> {
417 let values = values[0].as_primitive::<T>();
418 if let Some(x) = arrow::compute::sum(values) {
419 let v = self.sum.get_or_insert_with(|| T::Native::usize_as(0));
420 *v = v.add_wrapping(x);
421 }
422 Ok(())
423 }
424
425 fn merge_batch(&mut self, states: &[ArrayRef]) -> Result<()> {
426 self.update_batch(states)

Callers 12

sliding_window_benchFunction · 0.45
count_distinct_benchmarkFunction · 0.45
sliding_window_benchFunction · 0.45
evaluate_benchFunction · 0.45
update_benchFunction · 0.45
merge_benchFunction · 0.45
trivial_update_benchFunction · 0.45
bench_min_max_bytesFunction · 0.45
count_benchmarkFunction · 0.45
merge_batchMethod · 0.45

Calls 4

sumFunction · 0.85
null_countMethod · 0.80
lenMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected