Helper for row count demuxer
(
base_output_path: &ListingTableUrl,
write_id: &str,
part_idx: usize,
file_extension: &str,
single_file_output: bool,
max_buffered_batches: usize,
tx: &mut UnboundedSender
| 269 | |
| 270 | /// Helper for row count demuxer |
| 271 | fn create_new_file_stream( |
| 272 | base_output_path: &ListingTableUrl, |
| 273 | write_id: &str, |
| 274 | part_idx: usize, |
| 275 | file_extension: &str, |
| 276 | single_file_output: bool, |
| 277 | max_buffered_batches: usize, |
| 278 | tx: &mut UnboundedSender<(Path, Receiver<RecordBatch>)>, |
| 279 | ) -> Result<Sender<RecordBatch>> { |
| 280 | let file_path = generate_file_path( |
| 281 | base_output_path, |
| 282 | write_id, |
| 283 | part_idx, |
| 284 | file_extension, |
| 285 | single_file_output, |
| 286 | ); |
| 287 | let (tx_file, rx_file) = mpsc::channel(max_buffered_batches / 2); |
| 288 | tx.send((file_path, rx_file)) |
| 289 | .map_err(|_| exec_datafusion_err!("Error sending RecordBatch to file stream!"))?; |
| 290 | Ok(tx_file) |
| 291 | } |
| 292 | |
| 293 | /// Splits an input stream based on the distinct values of a set of columns |
| 294 | /// Assumes standard hive style partition paths such as |
no test coverage detected
searching dependent graphs…