scovich commented on code in PR #8602:
URL: https://github.com/apache/arrow-rs/pull/8602#discussion_r2430318840
##########
parquet/src/file/reader.rs:
##########
@@ -124,11 +124,26 @@ impl ChunkReader for Bytes {
fn get_read(&self, start: u64) -> Result<Self::T> {
let start = start as usize;
+ if start > self.len() {
+ return Err(eof_err!(
+ "Expected to read at offset {}, while file has length {}",
+ start,
+ self.len()
+ ));
+ }
Ok(self.slice(start..).reader())
}
fn get_bytes(&self, start: u64, length: usize) -> Result<Bytes> {
let start = start as usize;
+ if start > self.len() || start + length > self.len() {
+ return Err(eof_err!(
+ "Expected to read {} bytes at offset {}, while file has length
{}",
+ length,
+ start,
Review Comment:
ah, ok
--
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]