Skip to main content

GroupBy

Struct GroupBy 

Source
pub struct GroupBy { /* private fields */ }
Expand description

Groups its input by columns and reduces each group, as GROUP BY does: one row per combination of the columns’ values, {...columns, _0_key, _0_value}, with a sum or average’s components. A distinct is a GroupBy with a count, whose value a view doesn’t show.

The input is sorted by the group columns first, so a fetch folds each run of a group in one pass. Every group’s state is kept: a push adds a group with its first row, removes it with its last, and otherwise edits it when its value changes. A min or max whose extreme leaves is read again in reconcile, as in Aggregate.

Implementations§

Source§

impl GroupBy

Source

pub fn new( input: Rc<dyn Input>, ordering: &[OrderPart], table_name: impl Into<String>, aggregate: AggregateSpec, ) -> Result<Rc<Self>, PipelineError>

ordering names each group column once; the input must be sorted by it first.

Trait Implementations§

Source§

impl Input for GroupBy

Source§

fn set_output(&self, output: Weak<dyn Output>)

Source§

fn fetch(&self, req: &FetchRequest) -> NodeStream

Source§

impl InputBase for GroupBy

Source§

impl Output for GroupBy

Source§

fn push(&self, change: Change, _pusher: &dyn InputBase)

Source§

fn reconcile(&self, _pusher: &dyn InputBase)

Phase two. Sinks can ignore it; operators must forward it.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Operator for T
where T: Input + Output,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.