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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]