pub struct AggregateState {
pub alias: String,
pub accumulator: AggregateAccumulator,
pub override_value: Option<i64>,
}Expand description
Runtime state for an aggregate computation.
Fields§
§alias: String§accumulator: AggregateAccumulator§override_value: Option<i64>Implementations§
Source§impl AggregateState
impl AggregateState
Sourcepub fn new(
alias: String,
accumulator: AggregateAccumulator,
override_value: Option<i64>,
) -> Self
pub fn new( alias: String, accumulator: AggregateAccumulator, override_value: Option<i64>, ) -> Self
Creates a new aggregate state with the given components.
§Arguments
alias: Output column name for the aggregate resultaccumulator: The aggregator instance performing the computationoverride_value: Optional fixed value to replace the computed result
Sourcepub fn update(&mut self, batch: &RecordBatch) -> AggregateResult<()>
pub fn update(&mut self, batch: &RecordBatch) -> AggregateResult<()>
Sourcepub fn finalize(self) -> AggregateResult<(Field, ArrayRef)>
pub fn finalize(self) -> AggregateResult<(Field, ArrayRef)>
Auto Trait Implementations§
impl Freeze for AggregateState
impl RefUnwindSafe for AggregateState
impl Send for AggregateState
impl Sync for AggregateState
impl Unpin for AggregateState
impl UnwindSafe for AggregateState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more