milenkovicm commented on code in PR #1374:
URL:
https://github.com/apache/datafusion-ballista/pull/1374#discussion_r2689703739
##########
ballista/core/src/execution_plans/shuffle_reader.rs:
##########
@@ -545,9 +558,19 @@ fn fetch_partition_local_inner(
BallistaError::General(format!("Failed to open partition file at
{path}: {e:?}"))
})?;
let file = BufReader::new(file);
- let reader = StreamReader::try_new(file, None).map_err(|e| {
- BallistaError::General(format!("Failed to new arrow FileReader at
{path}: {e:?}"))
- })?;
+ let arrow_ipc_reader_skip_validation =
+ ShuffleReaderExec::arrow_ipc_reader_skip_validation();
+ // Safety: setting `skip_validation` requires `unsafe`, user assures data
is valid
+ let reader = unsafe {
+ StreamReader::try_new(file, None)
+ .map_err(|e| {
+ BallistaError::General(format!(
+ "Failed to create new arrow StreamReader at {path}: {e:?}"
+ ))
+ })?
+ .with_skip_validation(arrow_ipc_reader_skip_validation)
Review Comment:
Nitpicking,
can we just do
```
.with_skip_validation(cfg!(feature = "arrow-ipc-optimizations"))
```
?
##########
ballista/executor/src/flight_service.rs:
##########
@@ -105,8 +105,12 @@ impl FlightService for BallistaFlightService {
})
.map_err(|e| from_ballista_err(&e))?;
let file = BufReader::new(file);
- let reader =
- StreamReader::try_new(file, None).map_err(|e|
from_arrow_err(&e))?;
+ // Safety: setting `skip_validation` requires `unsafe`, user
assures data is valid
+ let reader = unsafe {
+ StreamReader::try_new(file, None)
+ .map_err(|e| from_arrow_err(&e))?
+
.with_skip_validation(arrow_ipc_reader_skip_validation())
Review Comment:
Nitpicking,
can we just do
```
.with_skip_validation(cfg!(feature = "arrow-ipc-optimizations"))
```
?
--
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]