tustvold commented on code in PR #4677:
URL: https://github.com/apache/arrow-rs/pull/4677#discussion_r1291262548
##########
object_store/src/local.rs:
##########
@@ -863,7 +866,56 @@ impl AsyncWrite for LocalUpload {
}
}
-pub(crate) fn read_range(file: &mut File, path: &PathBuf, range: Range<usize>)
-> Result<Bytes> {
+pub(crate) fn chunked_stream(
+ mut file: File,
+ path: PathBuf,
+ range: Range<usize>,
+ chunk_size: usize,
+) -> BoxStream<'static, Result<Bytes, super::Error>> {
+ futures::stream::once(async move {
+ let (file, path) = maybe_spawn_blocking(move || {
+ file.seek(SeekFrom::Start(range.start as _))
+ .map_err(|source| Error::Seek {
+ source,
+ path: path.clone(),
+ })?;
+ Ok((file, path))
+ })
+ .await?;
+
+ let stream = futures::stream::try_unfold(
Review Comment:
The chunked store tests should provide good coverage of this and make use of
various chunk sizes smaller than 8KB -
https://github.com/apache/arrow-rs/blob/master/object_store/src/chunked.rs#L210
--
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]