pub enum HashKeys {
RowEncoded(RowEncodedKeys),
Binview(BinviewKeys),
Single(SingleKeys),
}
Expand description
Represents a DataFrame plus a hash per row, intended for keys in grouping or joining. The hashes may or may not actually be physically pre-computed, this depends per type.
Variants§
Implementations§
Source§impl HashKeys
impl HashKeys
pub fn from_df( df: &DataFrame, random_state: PlRandomState, null_is_valid: bool, force_row_encoding: bool, ) -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn validity(&self) -> Option<&Bitmap>
pub fn null_is_valid(&self) -> bool
Sourcepub fn for_each_hash<F: FnMut(IdxSize, Option<u64>)>(&self, f: F)
pub fn for_each_hash<F: FnMut(IdxSize, Option<u64>)>(&self, f: F)
Calls f with the index of and hash of each element in this HashKeys.
If the element is null and null_is_valid is false the respective hash will be None.
Sourcepub unsafe fn for_each_hash_subset<F: FnMut(IdxSize, Option<u64>)>(
&self,
subset: &[IdxSize],
f: F,
)
pub unsafe fn for_each_hash_subset<F: FnMut(IdxSize, Option<u64>)>( &self, subset: &[IdxSize], f: F, )
Calls f with the index of and hash of each element in the given subset of indices of the HashKeys.
If the element is null and null_is_valid is false the respective hash will be None.
§Safety
The indices in the subset must be in-bounds.
Sourcepub fn gen_partitions(
&self,
partitioner: &HashPartitioner,
partitions: &mut Vec<IdxSize>,
partition_nulls: bool,
)
pub fn gen_partitions( &self, partitioner: &HashPartitioner, partitions: &mut Vec<IdxSize>, partition_nulls: bool, )
After this call partitions will be extended with the partition for each hash. Nulls are assigned IdxSize::MAX or a specific partition depending on whether partition_nulls is true.
Sourcepub fn gen_idxs_per_partition(
&self,
partitioner: &HashPartitioner,
partition_idxs: &mut [Vec<IdxSize>],
sketches: &mut [CardinalitySketch],
partition_nulls: bool,
)
pub fn gen_idxs_per_partition( &self, partitioner: &HashPartitioner, partition_idxs: &mut [Vec<IdxSize>], sketches: &mut [CardinalitySketch], partition_nulls: bool, )
After this call partition_idxs[p] will be extended with the indices of hashes that belong to partition p, and the cardinality sketches are updated accordingly.
pub fn sketch_cardinality(&self, sketch: &mut CardinalitySketch)
Sourcepub unsafe fn gather_unchecked(&self, idxs: &[IdxSize]) -> Self
pub unsafe fn gather_unchecked(&self, idxs: &[IdxSize]) -> Self
§Safety
The indices must be in-bounds.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for HashKeys
impl !RefUnwindSafe for HashKeys
impl Send for HashKeys
impl Sync for HashKeys
impl Unpin for HashKeys
impl !UnwindSafe for HashKeys
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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