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
sourceimpl BatchPartitioner
impl BatchPartitioner
sourcepub fn try_new(partitioning: Partitioning, timer: Time) -> Result<Self>
pub fn try_new(partitioning: Partitioning, timer: Time) -> Result<Self>
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<()>where
F: FnMut(usize, RecordBatch) -> Result<()>,
pub fn partition<F>(&mut self, batch: RecordBatch, f: F) -> Result<()>where
F: FnMut(usize, RecordBatch) -> Result<()>,
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more