Luosuu commented on issue #40981:
URL: https://github.com/apache/arrow/issues/40981#issuecomment-2037957679

   @mapleFU Thank you for reply!
   
   I checked `arrow-rs` and it seems that it can read one page by `get_bytes` 
method of `ChunkReader` trait:
   
   ```rust
   impl ChunkReader for File {
       type T = BufReader<File>;
   
       fn get_read(&self, start: u64) -> Result<Self::T> {
           let mut reader = self.try_clone()?;
           reader.seek(SeekFrom::Start(start))?;
           Ok(BufReader::new(self.try_clone()?))
       }
   
       fn get_bytes(&self, start: u64, length: usize) -> Result<Bytes> {
           let mut buffer = Vec::with_capacity(length);
           let mut reader = self.try_clone()?;
           reader.seek(SeekFrom::Start(start))?;
           let read = reader.take(length as _).read_to_end(&mut buffer)?;
   
           if read != length {
               return Err(eof_err!(
                   "Expected to read {} bytes, read only {}",
                   length,
                   read
               ));
           }
           Ok(buffer.into())
       }
   }
   ```
   
   
   in my understanding, if we have the position of a page (and also the length 
too), can we directly decode that page?
   Just like this `get_bytes` method which takes a start and length then it 
seek from the start with length.
   
   


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