Trait parquet::file::reader::ChunkReader

source ·
pub trait ChunkReader:
    Length
    + Send
    + Sync {
    type T: Read;

    // Required methods
    fn get_read(&self, start: u64) -> Result<Self::T>;
    fn get_bytes(&self, start: u64, length: usize) -> Result<Bytes>;
}
Expand description

Generates Readers to read chunks of a Parquet data source.

The Parquet reader uses ChunkReader to access Parquet data, allowing multiple decoders to read concurrently from different locations in the same file.

The trait provides:

§Provided Implementations

  • File for reading from local file system
  • Bytes for reading from an in-memory buffer

User provided implementations can implement more sophisticated behaviors such as on-demand buffering or scan sharing.

Required Associated Types§

source

type T: Read

The concrete type of reader returned by this trait

Required Methods§

source

fn get_read(&self, start: u64) -> Result<Self::T>

Get a Read instance starting at the provided file offset

Returned readers follow the model of File::try_clone where mutations of one reader affect all readers. Thus subsequent or concurrent calls to Self::get_read or Self::get_bytes may cause side-effects on previously returned readers. Callers of get_read should take care to avoid race conditions.

source

fn get_bytes(&self, start: u64, length: usize) -> Result<Bytes>

Get a range of data in memory as Bytes

Similarly to Self::get_read, this method may have side-effects on previously returned readers.

Implementations on Foreign Types§

source§

impl ChunkReader for Bytes

§

type T = Reader<Bytes>

source§

fn get_read(&self, start: u64) -> Result<Self::T>

source§

fn get_bytes(&self, start: u64, length: usize) -> Result<Bytes>

source§

impl ChunkReader for File

§

type T = BufReader<File>

source§

fn get_read(&self, start: u64) -> Result<Self::T>

source§

fn get_bytes(&self, start: u64, length: usize) -> Result<Bytes>

Implementors§