pub trait Grouper:
Any
+ Send
+ Sync {
// Required methods
fn new_empty(&self) -> Box<dyn Grouper>;
fn reserve(&mut self, additional: usize);
fn num_groups(&self) -> IdxSize;
unsafe fn insert_keys_subset(
&mut self,
keys: &HashKeys,
subset: &[IdxSize],
group_idxs: Option<&mut Vec<IdxSize>>,
);
fn get_keys_in_group_order(&self, schema: &Schema) -> DataFrame;
unsafe fn probe_partitioned_groupers(
&self,
groupers: &[Box<dyn Grouper>],
keys: &HashKeys,
partitioner: &HashPartitioner,
invert: bool,
probe_matches: &mut Vec<IdxSize>,
);
unsafe fn contains_key_partitioned_groupers(
&self,
groupers: &[Box<dyn Grouper>],
keys: &HashKeys,
partitioner: &HashPartitioner,
invert: bool,
contains_key: &mut BitmapBuilder,
);
fn as_any(&self) -> &dyn Any;
}Expand description
A Grouper maps keys to groups, such that duplicate keys map to the same group.
Required Methods§
Sourcefn reserve(&mut self, additional: usize)
fn reserve(&mut self, additional: usize)
Reserves space for the given number additional groups.
Sourcefn num_groups(&self) -> IdxSize
fn num_groups(&self) -> IdxSize
Returns the number of groups in this Grouper.
Sourceunsafe fn insert_keys_subset(
&mut self,
keys: &HashKeys,
subset: &[IdxSize],
group_idxs: Option<&mut Vec<IdxSize>>,
)
unsafe fn insert_keys_subset( &mut self, keys: &HashKeys, subset: &[IdxSize], group_idxs: Option<&mut Vec<IdxSize>>, )
Inserts the given subset of keys into this Grouper. If groups_idxs is passed it is extended such with the group index of keys[subset[i]].
§Safety
The subset indexes must be in-bounds.
Sourcefn get_keys_in_group_order(&self, schema: &Schema) -> DataFrame
fn get_keys_in_group_order(&self, schema: &Schema) -> DataFrame
Returns the keys in this Grouper in group order, that is the key for group i is returned in row i.
Sourceunsafe fn probe_partitioned_groupers(
&self,
groupers: &[Box<dyn Grouper>],
keys: &HashKeys,
partitioner: &HashPartitioner,
invert: bool,
probe_matches: &mut Vec<IdxSize>,
)
unsafe fn probe_partitioned_groupers( &self, groupers: &[Box<dyn Grouper>], keys: &HashKeys, partitioner: &HashPartitioner, invert: bool, probe_matches: &mut Vec<IdxSize>, )
Returns the (indices of the) keys found in the groupers. If invert is true it instead returns the keys not found in the groupers.
§Safety
All groupers must have the same schema.
Sourceunsafe fn contains_key_partitioned_groupers(
&self,
groupers: &[Box<dyn Grouper>],
keys: &HashKeys,
partitioner: &HashPartitioner,
invert: bool,
contains_key: &mut BitmapBuilder,
)
unsafe fn contains_key_partitioned_groupers( &self, groupers: &[Box<dyn Grouper>], keys: &HashKeys, partitioner: &HashPartitioner, invert: bool, contains_key: &mut BitmapBuilder, )
Returns for each key if it is found in the groupers. If invert is true it returns true if it isn’t found.
§Safety
All groupers must have the same schema.