viirya commented on code in PR #7538:
URL: https://github.com/apache/arrow-datafusion/pull/7538#discussion_r1324743130
##########
datafusion/execution/src/disk_manager.rs:
##########
@@ -131,18 +134,41 @@ impl DiskManager {
request_description,
);
- local_dirs.push(tempdir);
+ local_dirs.push(Arc::new(tempdir));
}
let dir_index = thread_rng().gen_range(0..local_dirs.len());
- Builder::new()
- .tempfile_in(&local_dirs[dir_index])
- .map_err(DataFusionError::IoError)
+ Ok(RefCountedTempFile {
+ parent_temp_dir: local_dirs[dir_index].clone(),
+ tempfile: Builder::new()
+ .tempfile_in(local_dirs[dir_index].as_ref())
+ .map_err(DataFusionError::IoError)?,
+ })
+ }
+}
+
+/// A wrapper around a [`NamedTempFile`] that also contains a reference
Review Comment:
```suggestion
/// A wrapper around a [`NamedTempFile`] that also contains a reference to
its parent temporary directory
```
--
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]