clbarnes commented on PR #5222:
URL: https://github.com/apache/arrow-rs/pull/5222#issuecomment-1877127243
It currently works in that the server returns some bytes, but it doesn't
return the range of bytes which the user requested, and then the reported
`GetResult::range` is incorrect. So if we want the returned bytes to match the
returned `Range`, we need to change something either way. Either
- Raise an error
- Implemented here
- Pro: consistent with cases where a requested range cannot be
satisfied, e.g. 416
- Pro: consistent with cases where a user uses a `Range` to slice into a
resource that isn't as long as they thought it was
- Pro: matches the the `GetResult::Range` from the current implementation
- Con: maybe the user wanted whatever bytes are there up to a certain
maximum, rather than exactly what they requested; throws away those bytes
- Return the bytes from the response and change `GetResult::range` to
reflect the actual bytes returned
- Would be a ~1 statement change (plus test updates)
- Pro: doesn't throw away whatever bytes are actually returned
- Pro: the bytes returned matches the current implementation
- Con: users have to find the intersection between what they wanted and
what they got every time they request a range
The middle ground would be to return an error, but have it contain the
`GetResult` with the actual range. However, this might need to be represented
at the top of the `crate::Error` so it could easily be matched on.
--
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]