Dandandan commented on code in PR #15454:
URL: https://github.com/apache/datafusion/pull/15454#discussion_r2022366297
##########
datafusion/physical-plan/src/spill/mod.rs:
##########
@@ -35,7 +35,10 @@ use datafusion_common::{exec_datafusion_err, HashSet,
Result};
fn read_spill(sender: Sender<Result<RecordBatch>>, path: &Path) -> Result<()> {
let file = BufReader::new(File::open(path)?);
- let reader = StreamReader::try_new(file, None)?;
+ // 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 a deliberate safety-performance
tradeoff.
Review Comment:
```suggestion
// to speedup read operation. This is safe for DataFusion as input
guarenteed to be correct when written.
```
I don't think it's really a tradeoff in the sense that we are losing safety.
##########
datafusion/physical-plan/src/spill/mod.rs:
##########
@@ -35,7 +35,10 @@ use datafusion_common::{exec_datafusion_err, HashSet,
Result};
fn read_spill(sender: Sender<Result<RecordBatch>>, path: &Path) -> Result<()> {
let file = BufReader::new(File::open(path)?);
- let reader = StreamReader::try_new(file, None)?;
+ // 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 a deliberate safety-performance
tradeoff.
Review Comment:
```suggestion
// to speedup read operation. This is safe for DataFusion as input
guaranteed to be correct when written.
```
I don't think it's really a tradeoff in the sense that we are losing safety.
--
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]