Skip to main content

DistinctState

Struct DistinctState 

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

Streaming distinct over TermBatch frames.

The seen-set lives on this value so later batches can drop rows that duplicated an earlier batch. Output rows are gathered from the current batch only.

Implementations§

Source§

impl DistinctState

Source

pub fn new(n_keys: usize) -> Self

Seen-set for n_keys Distinct columns (0 = empty projection).

Source

pub fn filter_batch( &mut self, batch: &TermBatch, key_cols: &[&TermColumn], ) -> Result<TermBatch, ExecError>

Keep first-seen rows of batch keyed by key_cols (same length as Self::new). Other batch columns are carried via TermColumn::gather_take.

Source

pub fn estimated_bytes(&self) -> u64

Approximate RAM for the seen-set (keys plus HashSet overhead).

Source

pub fn remember_keys( &mut self, key_cols: &[&TermColumn], ) -> Result<(), ExecError>

Insert every key in key_cols without gathering output rows.

Source

pub fn seen_key_batch(&self) -> Result<TermBatch, ExecError>

Seen keys as a TermId batch (n_keys columns). Empty projection: one zero-width row if the empty mapping was seen, else no rows.

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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,