Write an Arrow RecordBatch. Rows are routed to the correct partition and bucket.
(&mut self, batch: &RecordBatch)
| 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 | /// |