pub struct DeltaWriter { /* private fields */ }
Expand description
A parquet writer implementation tailored to the needs of writing data to a delta table.
Implementations§
Source§impl DeltaWriter
impl DeltaWriter
Sourcepub fn new(object_store: ObjectStoreRef, config: WriterConfig) -> Self
pub fn new(object_store: ObjectStoreRef, config: WriterConfig) -> Self
Create a new instance of DeltaWriter
Sourcepub fn with_writer_properties(self, writer_properties: WriterProperties) -> Self
pub fn with_writer_properties(self, writer_properties: WriterProperties) -> Self
Apply custom writer_properties to the underlying parquet writer
Sourcepub async fn write_partition(
&mut self,
record_batch: RecordBatch,
partition_values: &IndexMap<String, Scalar>,
) -> DeltaResult<()>
pub async fn write_partition( &mut self, record_batch: RecordBatch, partition_values: &IndexMap<String, Scalar>, ) -> DeltaResult<()>
Write a batch to the partition induced by the partition_values. The record batch is expected to be pre-partitioned and only contain rows that belong into the same partition. However, it should still contain the partition columns.
Sourcepub async fn write(&mut self, batch: &RecordBatch) -> DeltaResult<()>
pub async fn write(&mut self, batch: &RecordBatch) -> DeltaResult<()>
Buffers record batches in-memory per partition up to appx. target_file_size
for a partition.
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 DeltaWriter
impl !RefUnwindSafe for DeltaWriter
impl Send for DeltaWriter
impl !Sync for DeltaWriter
impl Unpin for DeltaWriter
impl !UnwindSafe for DeltaWriter
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