zebsme commented on issue #15321: URL: https://github.com/apache/datafusion/issues/15321#issuecomment-2786507752
StreamReader with mmap enabled: ``` fn read_spill(sender: Sender<Result<RecordBatch>>, path: &Path) -> Result<()> { let file = File::open(path)?; let mmap = unsafe { memmap2::Mmap::map(&file)? }; // SAFETY: DataFusion's spill writer strictly follows Arrow IPC specifications // with validated schemas and buffers. Skip redundant validation during read // to speedup read operation. This is safe for DataFusion as input guaranteed to be correct when written. let reader = unsafe { StreamReader::try_new(Cursor::new(mmap), None)?.with_skip_validation(true) }; for batch in reader { sender .blocking_send(batch.map_err(Into::into)) .map_err(|e| exec_datafusion_err!("{e}"))?; } Ok(()) } ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org