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

Method state

datafusion/spark/src/function/aggregate/avg.rs:161–166  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

159
160impl Accumulator for AvgAccumulator {
161 fn state(&mut self) -> Result<Vec<ScalarValue>> {
162 Ok(vec![
163 ScalarValue::Float64(self.sum),
164 ScalarValue::from(self.count),
165 ])
166 }
167
168 fn update_batch(&mut self, values: &[ArrayRef]) -> Result<()> {
169 let values = values[0].as_primitive::<Float64Type>();

Calls 5

newFunction · 0.85
take_neededMethod · 0.80
with_data_typeMethod · 0.80
intoMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected