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

Method to_state

datafusion/core/tests/user_defined/user_defined_aggregates.rs:738–746  ·  view source on GitHub ↗

Convert to a set of ScalarValues

(&self)

Source from the content-addressed store, hash-verified

736
737 /// Convert to a set of ScalarValues
738 fn to_state(&self) -> Result<ScalarValue> {
739 let f64arr = Arc::new(Float64Array::from(vec![self.value])) as ArrayRef;
740 let timearr =
741 Arc::new(TimestampNanosecondArray::from(vec![self.time])) as ArrayRef;
742
743 let struct_arr =
744 StructArray::try_new(Self::fields(), vec![f64arr, timearr], None)?;
745 Ok(ScalarValue::Struct(Arc::new(struct_arr)))
746 }
747}
748
749impl Accumulator for FirstSelector {

Callers 1

evaluateMethod · 0.80

Calls 2

newFunction · 0.85
StructClass · 0.50

Tested by

no test coverage detected