Struct datafusion::physical_plan::repartition::BatchPartitioner
source · pub struct BatchPartitioner { /* private fields */ }
Expand description
A utility that can be used to partition batches based on Partitioning
Implementations§
source§impl BatchPartitioner
impl BatchPartitioner
sourcepub fn try_new(
partitioning: Partitioning,
timer: Time
) -> Result<BatchPartitioner, DataFusionError>
pub fn try_new( partitioning: Partitioning, timer: Time ) -> Result<BatchPartitioner, DataFusionError>
Create a new BatchPartitioner
with the provided Partitioning
The time spent repartitioning will be recorded to timer
sourcepub fn partition<F>(
&mut self,
batch: RecordBatch,
f: F
) -> Result<(), DataFusionError>where
F: FnMut(usize, RecordBatch) -> Result<(), DataFusionError>,
pub fn partition<F>( &mut self, batch: RecordBatch, f: F ) -> Result<(), DataFusionError>where F: FnMut(usize, RecordBatch) -> Result<(), DataFusionError>,
Partition the provided RecordBatch
into one or more partitioned RecordBatch
based on the Partitioning
specified on construction
f
will be called for each partitioned RecordBatch
with the corresponding
partition index. Any error returned by f
will be immediately returned by this
function without attempting to publish further RecordBatch
The time spent repartitioning, not including time spent in f
will be recorded
to the metrics::Time
provided on construction
Auto Trait Implementations§
impl !RefUnwindSafe for BatchPartitioner
impl Send for BatchPartitioner
impl Sync for BatchPartitioner
impl Unpin for BatchPartitioner
impl !UnwindSafe for BatchPartitioner
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