pub async fn stream_to_file<E>(
stream: SendableRecordBatchStream,
store: ObjectStore,
path: &str,
threshold: usize,
concurrency: usize,
compression_type: CompressionType,
encoder_factory: impl Fn(SharedBuffer) -> E,
) -> Result<usize>where
E: DfRecordBatchEncoder,Expand description
Streams [SendableRecordBatchStream] to a file with optional compression support.
Data is buffered and flushed according to the given threshold.
Ensures that writer resources are cleanly released and that an empty file is not
created if no rows are written.
Returns the total number of rows successfully written.