pub struct PartitionColumnProjector {
key_buffer_cache: ZeroBufferGenerators,
projected_partition_indexes: Vec<(usize, usize)>,
projected_schema: SchemaRef,
}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).
Fields§
§key_buffer_cache: ZeroBufferGeneratorsAn Arrow buffer initialized to zeros that represents the key array of all partition columns (partition columns are materialized by dictionary arrays with only one value in the dictionary, thus all the keys are equal to zero).
projected_partition_indexes: Vec<(usize, usize)>Mapping between the indexes in the list of partition columns and the target schema. Sorted by index in the target schema so that we can iterate on it to insert the partition columns in the target record batch.
projected_schema: SchemaRefThe schema of the table once the projection was applied.
Implementations§
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
§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