pub struct PartitionColumnProjector { /* private fields */ }
Expand description
A helper that projects partition columns into the file record batches.
One interesting trick is the usage of a cache for the key buffers of the partition column dictionaries. Indeed, the partition columns are constant, so the dictionaries that represent them have all their keys equal to 0. This enables us to re-use the same “all-zero” buffer across batches, which makes the space consumption of the partition columns O(batch_size) instead of O(record_count).
Implementations§
Source§impl PartitionColumnProjector
impl PartitionColumnProjector
pub fn new(projected_schema: SchemaRef, table_partition_cols: &[String]) -> Self
pub fn project( &mut self, file_batch: RecordBatch, partition_values: &[ScalarValue], ) -> Result<RecordBatch>
Auto Trait Implementations§
impl Freeze for PartitionColumnProjector
impl RefUnwindSafe for PartitionColumnProjector
impl Send for PartitionColumnProjector
impl Sync for PartitionColumnProjector
impl Unpin for PartitionColumnProjector
impl UnwindSafe for PartitionColumnProjector
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
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>
Converts
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>
Converts
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