pub struct RecordBatchPartitionSplitter { /* private fields */ }Expand description
The splitter used to split the record batch into multiple record batches by the partition spec.
- It will project and transform the input record batch based on the partition spec, get the partitioned record batch.
- Split the input record batch into multiple record batches based on the partitioned record batch.
§Partition Value Modes
The splitter supports two modes for obtaining partition values:
- Computed mode (
calculatorisSome): Computes partition values from source columns using transforms - Pre-computed mode (
calculatorisNone): Expects a_partitioncolumn in the input batch
Implementations§
Source§impl RecordBatchPartitionSplitter
impl RecordBatchPartitionSplitter
Sourcepub fn try_new(
iceberg_schema: SchemaRef,
partition_spec: PartitionSpecRef,
calculator: Option<PartitionValueCalculator>,
) -> Result<Self>
pub fn try_new( iceberg_schema: SchemaRef, partition_spec: PartitionSpecRef, calculator: Option<PartitionValueCalculator>, ) -> Result<Self>
Create a new RecordBatchPartitionSplitter.
§Arguments
iceberg_schema- The Iceberg schema referencepartition_spec- The partition specification referencecalculator- Optional calculator for computing partition values from source columns.Some(calculator): Compute partition values from source columns using transformsNone: Expect a pre-computed_partitioncolumn in the input batch
§Returns
Returns a new RecordBatchPartitionSplitter instance or an error if initialization fails.
Sourcepub fn try_new_with_computed_values(
iceberg_schema: SchemaRef,
partition_spec: PartitionSpecRef,
) -> Result<Self>
pub fn try_new_with_computed_values( iceberg_schema: SchemaRef, partition_spec: PartitionSpecRef, ) -> Result<Self>
Create a new RecordBatchPartitionSplitter with computed partition values.
This is a convenience method that creates a calculator and initializes the splitter to compute partition values from source columns.
§Arguments
iceberg_schema- The Iceberg schema referencepartition_spec- The partition specification reference
§Returns
Returns a new RecordBatchPartitionSplitter instance or an error if initialization fails.
Sourcepub fn try_new_with_precomputed_values(
iceberg_schema: SchemaRef,
partition_spec: PartitionSpecRef,
) -> Result<Self>
pub fn try_new_with_precomputed_values( iceberg_schema: SchemaRef, partition_spec: PartitionSpecRef, ) -> Result<Self>
Create a new RecordBatchPartitionSplitter expecting pre-computed partition values.
This is a convenience method that initializes the splitter to expect a _partition
column in the input batches.
§Arguments
iceberg_schema- The Iceberg schema referencepartition_spec- The partition specification reference
§Returns
Returns a new RecordBatchPartitionSplitter instance or an error if initialization fails.
Sourcepub fn split(
&self,
batch: &RecordBatch,
) -> Result<Vec<(PartitionKey, RecordBatch)>>
pub fn split( &self, batch: &RecordBatch, ) -> Result<Vec<(PartitionKey, RecordBatch)>>
Split the record batch into multiple record batches based on the partition spec.
Auto Trait Implementations§
impl !Freeze for RecordBatchPartitionSplitter
impl !RefUnwindSafe for RecordBatchPartitionSplitter
impl Send for RecordBatchPartitionSplitter
impl Sync for RecordBatchPartitionSplitter
impl Unpin for RecordBatchPartitionSplitter
impl !UnwindSafe for RecordBatchPartitionSplitter
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
§impl<T> Downcast for Twhere
T: AsAny + ?Sized,
impl<T> Downcast for Twhere
T: AsAny + ?Sized,
§fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
Any.§fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
Any.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more