MCPcopy Create free account
hub / github.com/apache/paimon-rust / write_arrow_batch

Method write_arrow_batch

crates/paimon/src/table/table_write.rs:363–374  ·  view source on GitHub ↗

Write an Arrow RecordBatch. Rows are routed to the correct partition and bucket.

(&mut self, batch: &RecordBatch)

Source from the content-addressed store, hash-verified

361
362 /// Write an Arrow RecordBatch. Rows are routed to the correct partition and bucket.
363 pub async fn write_arrow_batch(&mut self, batch: &RecordBatch) -> Result<()> {
364 if batch.num_rows() == 0 {
365 return Ok(());
366 }
367
368 let grouped = self.divide_by_partition_bucket(batch).await?;
369 for ((partition_bytes, bucket), sub_batch) in grouped {
370 self.write_bucket(partition_bytes, bucket, sub_batch)
371 .await?;
372 }
373 Ok(())
374 }
375
376 /// Group rows by (partition_bytes, bucket) and return sub-batches.
377 ///

Calls 3

num_rowsMethod · 0.80
write_bucketMethod · 0.80