pub struct TableWrite { /* private fields */ }Expand description
TableWrite writes Arrow RecordBatches to Paimon data files.
Each (partition, bucket) pair gets its own DataFileWriter held in a HashMap.
Batches are routed to the correct writer based on partition/bucket.
Call prepare_commit() to close all writers and collect
CommitMessages for use with TableCommit.
Reference: pypaimon BatchTableWrite
Implementations§
Source§impl TableWrite
impl TableWrite
Sourcepub async fn write_arrow_batch(&mut self, batch: &RecordBatch) -> Result<()>
pub async fn write_arrow_batch(&mut self, batch: &RecordBatch) -> Result<()>
Write an Arrow RecordBatch. Rows are routed to the correct partition and bucket.
Sourcepub async fn write_arrow(&mut self, batches: &[RecordBatch]) -> Result<()>
pub async fn write_arrow(&mut self, batches: &[RecordBatch]) -> Result<()>
Write multiple Arrow RecordBatches.
Sourcepub async fn prepare_commit(&mut self) -> Result<Vec<CommitMessage>>
pub async fn prepare_commit(&mut self) -> Result<Vec<CommitMessage>>
Close all writers and collect CommitMessages for use with TableCommit. Writers are cleared after this call, allowing the TableWrite to be reused.
Auto Trait Implementations§
impl Freeze for TableWrite
impl !RefUnwindSafe for TableWrite
impl Send for TableWrite
impl !Sync for TableWrite
impl Unpin for TableWrite
impl UnsafeUnpin for TableWrite
impl !UnwindSafe for TableWrite
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