pub struct PartitionWriter { /* private fields */ }
Expand description
Partition writer implementation This writer takes in table data as RecordBatches and writes it out to partitioned parquet files. It buffers data in memory until it reaches a certain size, then writes it out to optimize file sizes. When you complete writing you get back a list of Add actions that can be used to update the Delta table commit log.
Implementations§
Source§impl PartitionWriter
impl PartitionWriter
Sourcepub fn try_with_config(
object_store: ObjectStoreRef,
config: PartitionWriterConfig,
num_indexed_cols: i32,
stats_columns: Option<Vec<String>>,
) -> DeltaResult<Self>
pub fn try_with_config( object_store: ObjectStoreRef, config: PartitionWriterConfig, num_indexed_cols: i32, stats_columns: Option<Vec<String>>, ) -> DeltaResult<Self>
Create a new instance of PartitionWriter
from PartitionWriterConfig
Sourcepub async fn write(&mut self, batch: &RecordBatch) -> DeltaResult<()>
pub async fn write(&mut self, batch: &RecordBatch) -> DeltaResult<()>
Buffers record batches in-memory up to appx. target_file_size
.
Flushes data to storage once a full file can be written.
The close
method has to be invoked to write all data still buffered
and get the list of all written files.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PartitionWriter
impl !RefUnwindSafe for PartitionWriter
impl Send for PartitionWriter
impl !Sync for PartitionWriter
impl Unpin for PartitionWriter
impl !UnwindSafe for PartitionWriter
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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