pub struct ParallelParquetWriter {
writer: Option<SerializedFileWriter<BufWriter<File>>>,
factory: ArrowRowGroupWriterFactory,
schema: SchemaRef,
pending: Vec<RecordBatch>,
pending_rows: usize,
row_group_rows: usize,
row_group_index: usize,
rows_written: usize,
staging_path: Option<PathBuf>,
destination: PathBuf,
overwrite: bool,
}Expand description
Parquet writer that encodes columns concurrently and commits each row group once, in order, to a single output file.
Input batches remain ordered and memory is bounded by row_group_rows plus
upstream buffering. Unlike temporary-file fan-out, encoded pages are copied
directly into the final Parquet row group without decoding or re-encoding.
Fields§
§writer: Option<SerializedFileWriter<BufWriter<File>>>§factory: ArrowRowGroupWriterFactory§schema: SchemaRef§pending: Vec<RecordBatch>§pending_rows: usize§row_group_rows: usize§row_group_index: usize§rows_written: usize§staging_path: Option<PathBuf>§destination: PathBuf§overwrite: boolImplementations§
Source§impl ParallelParquetWriter
impl ParallelParquetWriter
Sourcepub fn new(
config: WriteConfig,
schema: SchemaRef,
row_group_rows: usize,
) -> Result<Self, ReadStatError>
pub fn new( config: WriteConfig, schema: SchemaRef, row_group_rows: usize, ) -> Result<Self, ReadStatError>
Creates a native parallel Parquet writer.
§Errors
Returns an error for invalid output configuration, a zero row-group target, staging-file failures, or invalid Parquet properties.
Sourcepub fn write(&mut self, batch: &RecordBatch) -> Result<(), ReadStatError>
pub fn write(&mut self, batch: &RecordBatch) -> Result<(), ReadStatError>
Queues a batch and flushes complete row groups with parallel column encoding. Batches crossing a row-group boundary are sliced without copying their Arrow buffers.
§Errors
Returns an error for a schema mismatch, row-count overflow, or Parquet encoding/write failure.
fn flush_row_group(&mut self) -> Result<(), ReadStatError>
Trait Implementations§
Source§impl Drop for ParallelParquetWriter
Available on crate feature parquet only.
impl Drop for ParallelParquetWriter
parquet only.Auto Trait Implementations§
impl Freeze for ParallelParquetWriter
impl !RefUnwindSafe for ParallelParquetWriter
impl Send for ParallelParquetWriter
impl Sync for ParallelParquetWriter
impl Unpin for ParallelParquetWriter
impl UnsafeUnpin for ParallelParquetWriter
impl !UnwindSafe for ParallelParquetWriter
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
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