pub struct ParquetStreamingSink<T: ToParquetBatch + Send> { /* private fields */ }Expand description
Parquet streaming sink that buffers items and writes in row groups.
Items are buffered until a row group is full, then written to the Parquet file. This approach provides efficient compression while supporting streaming input.
§Type Parameters
T- The type of items to write. Must implementToParquetBatch.
§Note
For custom types, implement the ToParquetBatch trait to define how your
data maps to Arrow schema and batches.
Implementations§
Source§impl<T: ToParquetBatch + Send> ParquetStreamingSink<T>
impl<T: ToParquetBatch + Send> ParquetStreamingSink<T>
Sourcepub fn new(path: PathBuf, row_group_size: usize) -> SynthResult<Self>
pub fn new(path: PathBuf, row_group_size: usize) -> SynthResult<Self>
Sourcepub fn with_defaults(path: PathBuf) -> SynthResult<Self>
pub fn with_defaults(path: PathBuf) -> SynthResult<Self>
Creates a Parquet streaming sink with default row group size (10000).
Trait Implementations§
Source§impl<T: ToParquetBatch + Send> StreamingSink<T> for ParquetStreamingSink<T>
impl<T: ToParquetBatch + Send> StreamingSink<T> for ParquetStreamingSink<T>
Source§fn process(&mut self, event: StreamEvent<T>) -> SynthResult<()>
fn process(&mut self, event: StreamEvent<T>) -> SynthResult<()>
Processes a stream event.
Source§fn flush(&mut self) -> SynthResult<()>
fn flush(&mut self) -> SynthResult<()>
Flushes any buffered data.
Source§fn close(self) -> SynthResult<()>
fn close(self) -> SynthResult<()>
Closes the sink and releases resources.
Source§fn items_processed(&self) -> u64
fn items_processed(&self) -> u64
Returns the number of items processed.
Auto Trait Implementations§
impl<T> Freeze for ParquetStreamingSink<T>
impl<T> !RefUnwindSafe for ParquetStreamingSink<T>
impl<T> Send for ParquetStreamingSink<T>
impl<T> !Sync for ParquetStreamingSink<T>
impl<T> Unpin for ParquetStreamingSink<T>where
T: Unpin,
impl<T> UnsafeUnpin for ParquetStreamingSink<T>
impl<T> !UnwindSafe for ParquetStreamingSink<T>
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