AdamGS commented on code in PR #628:
URL: 
https://github.com/apache/arrow-rs-object-store/pull/628#discussion_r2743228260


##########
src/local.rs:
##########
@@ -975,8 +979,8 @@ pub(crate) fn read_range(
     range: Range<u64>,
 ) -> Result<Bytes> {
     // If none of the range is satisfiable we should error, e.g. if the start 
offset is beyond the
-    // extents of the file
-    if range.start >= file_len {
+    // extents of the file, or if its at the end of the file and wants to read 
a non-empty range.
+    if range.start > file_len || (range.start == file_len && 
!range.is_empty()) {

Review Comment:
   from line 994-995:
   ```rust
   // Don't read past end of file
   let to_read = range.end.min(file_len) - range.start;
   ```
   
   I think its actually technically ok to read with a range that ends past the 
end of the file (I think HTTP RANGE headers allow that too), the only issue is 
when trying to start at the end and reading more. I'll try and figure out if 
this error is actually tested, and add a test if not.



-- 
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]

Reply via email to