pub struct GenericDistinctBuffer<T: ArrowPrimitiveType> {
pub values: HashSet<Hashable<T::Native>, RandomState>,
/* private fields */
}Expand description
Generic way to collect distinct values for accumulators.
The intermediate state is represented as a List of scalar values updated by
merge_batch and a Vec of ArrayRef that are converted to scalar values
in the final evaluation step so that we avoid expensive conversions and
allocations during update_batch.
Fields§
§values: HashSet<Hashable<T::Native>, RandomState>Implementations§
Source§impl<T: ArrowPrimitiveType> GenericDistinctBuffer<T>
impl<T: ArrowPrimitiveType> GenericDistinctBuffer<T>
pub fn new(data_type: DataType) -> Self
Sourcepub fn state(&self) -> Result<Vec<ScalarValue>>
pub fn state(&self) -> Result<Vec<ScalarValue>>
Mirrors Accumulator::state.
Sourcepub fn update_batch(&mut self, values: &[ArrayRef]) -> Result<()>
pub fn update_batch(&mut self, values: &[ArrayRef]) -> Result<()>
Mirrors Accumulator::update_batch.
Sourcepub fn merge_batch(&mut self, states: &[ArrayRef]) -> Result<()>
pub fn merge_batch(&mut self, states: &[ArrayRef]) -> Result<()>
Mirrors Accumulator::merge_batch.
Sourcepub fn size(&self) -> usize
pub fn size(&self) -> usize
Mirrors Accumulator::size.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for GenericDistinctBuffer<T>
impl<T> RefUnwindSafe for GenericDistinctBuffer<T>
impl<T> Send for GenericDistinctBuffer<T>
impl<T> Sync for GenericDistinctBuffer<T>
impl<T> Unpin for GenericDistinctBuffer<T>
impl<T> UnwindSafe for GenericDistinctBuffer<T>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more