Write a batch directly to the writer for the given (partition, bucket).
(
&mut self,
partition_bytes: Vec<u8>,
bucket: i32,
batch: RecordBatch,
)
| 494 | |
| 495 | /// Write a batch directly to the writer for the given (partition, bucket). |
| 496 | async fn write_bucket( |
| 497 | &mut self, |
| 498 | partition_bytes: Vec<u8>, |
| 499 | bucket: i32, |
| 500 | batch: RecordBatch, |
| 501 | ) -> Result<()> { |
| 502 | let key = (partition_bytes, bucket); |
| 503 | if !self.partition_writers.contains_key(&key) { |
| 504 | self.create_writer(key.0.clone(), key.1).await?; |
| 505 | } |
| 506 | let writer = self.partition_writers.get_mut(&key).unwrap(); |
| 507 | writer.write(&batch).await |
| 508 | } |
| 509 | |
| 510 | /// Write multiple Arrow RecordBatches. |
| 511 | pub async fn write_arrow(&mut self, batches: &[RecordBatch]) -> Result<()> { |
no test coverage detected