Struct sql_ops::partition::cpu_radix_partition::CpuRadixPartitioner
source · [−]pub struct CpuRadixPartitioner { /* private fields */ }
Expand description
A CPU radix partitioner that provides partitioning functions.
Implementations
sourceimpl CpuRadixPartitioner
impl CpuRadixPartitioner
sourcepub fn new(
prefix_sum_algorithm: CpuHistogramAlgorithm,
partition_algorithm: CpuRadixPartitionAlgorithm,
radix_bits: u32,
state_mem_type: DerefMemType
) -> Self
pub fn new(
prefix_sum_algorithm: CpuHistogramAlgorithm,
partition_algorithm: CpuRadixPartitionAlgorithm,
radix_bits: u32,
state_mem_type: DerefMemType
) -> Self
Creates a new CPU radix partitioner.
sourcepub fn prefix_sum<T: DeviceCopy + CpuRadixPartitionable>(
&mut self,
partition_attr: RadixPartitionInputChunk<'_, T>,
partition_offsets: PartitionOffsetsMutSlice<'_, Tuple<T, T>>
) -> Result<()>
pub fn prefix_sum<T: DeviceCopy + CpuRadixPartitionable>(
&mut self,
partition_attr: RadixPartitionInputChunk<'_, T>,
partition_offsets: PartitionOffsetsMutSlice<'_, Tuple<T, T>>
) -> Result<()>
Computes the prefix sum.
The prefix sum performs a scan over all partitioning keys. It first computes a histogram. The prefix sum is computed from this histogram.
The prefix sum serves two main purposes:
- The prefix sums are used in
partition
as offsets in an array for the output partitions. - The prefix sum can also be used to detect skew in the data.
Parallelism
The function is thread-safe, and meant to be externally parallelized by the caller.
sourcepub fn partition<T: DeviceCopy + CpuRadixPartitionable>(
&mut self,
partition_attr: RadixPartitionInputChunk<'_, T>,
payload_attr: RadixPartitionInputChunk<'_, T>,
partition_offsets: PartitionOffsetsMutSlice<'_, Tuple<T, T>>,
partitioned_relation: PartitionedRelationMutSlice<'_, Tuple<T, T>>
) -> Result<()>
pub fn partition<T: DeviceCopy + CpuRadixPartitionable>(
&mut self,
partition_attr: RadixPartitionInputChunk<'_, T>,
payload_attr: RadixPartitionInputChunk<'_, T>,
partition_offsets: PartitionOffsetsMutSlice<'_, Tuple<T, T>>,
partitioned_relation: PartitionedRelationMutSlice<'_, Tuple<T, T>>
) -> Result<()>
Radix-partitions a relation by its key attribute.
See the module-level documentation for details on the algorithm.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for CpuRadixPartitioner
impl Send for CpuRadixPartitioner
impl Sync for CpuRadixPartitioner
impl Unpin for CpuRadixPartitioner
impl UnwindSafe for CpuRadixPartitioner
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more