MCPcopy Create free account
hub / github.com/apache/datafusion / create_new_file_stream

Function create_new_file_stream

datafusion/datasource/src/write/demux.rs:271–291  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

269
270/// Helper for row count demuxer
271fn 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

Callers 1

row_count_demuxerFunction · 0.85

Calls 3

generate_file_pathFunction · 0.85
channelFunction · 0.50
sendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…