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<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