parquet::arrow::async_reader

Trait AsyncFileReader

Source
pub trait AsyncFileReader: Send {
    // Required methods
    fn get_bytes(&mut self, range: Range<usize>) -> BoxFuture<'_, Result<Bytes>>;
    fn get_metadata(&mut self) -> BoxFuture<'_, Result<Arc<ParquetMetaData>>>;

    // Provided method
    fn get_byte_ranges(
        &mut self,
        ranges: Vec<Range<usize>>,
    ) -> BoxFuture<'_, Result<Vec<Bytes>>> { ... }
}
Expand description

The asynchronous interface used by ParquetRecordBatchStream to read parquet files

Notes:

  1. There is a default implementation for types that implement [AsyncRead] and [AsyncSeek], for example tokio::fs::File.

  2. ParquetObjectReader, available when the object_store crate feature is enabled, implements this interface for ObjectStore.

Required Methods§

Source

fn get_bytes(&mut self, range: Range<usize>) -> BoxFuture<'_, Result<Bytes>>

Retrieve the bytes in range

Source

fn get_metadata(&mut self) -> BoxFuture<'_, Result<Arc<ParquetMetaData>>>

Provides asynchronous access to the ParquetMetaData of a parquet file, allowing fine-grained control over how metadata is sourced, in particular allowing for caching, pre-fetching, catalog metadata, etc…

Provided Methods§

Source

fn get_byte_ranges( &mut self, ranges: Vec<Range<usize>>, ) -> BoxFuture<'_, Result<Vec<Bytes>>>

Retrieve multiple byte ranges. The default implementation will call get_bytes sequentially

Trait Implementations§

Source§

impl AsyncFileReader for Box<dyn AsyncFileReader>

Source§

fn get_bytes(&mut self, range: Range<usize>) -> BoxFuture<'_, Result<Bytes>>

Retrieve the bytes in range
Source§

fn get_byte_ranges( &mut self, ranges: Vec<Range<usize>>, ) -> BoxFuture<'_, Result<Vec<Bytes>>>

Retrieve multiple byte ranges. The default implementation will call get_bytes sequentially
Source§

fn get_metadata(&mut self) -> BoxFuture<'_, Result<Arc<ParquetMetaData>>>

Provides asynchronous access to the ParquetMetaData of a parquet file, allowing fine-grained control over how metadata is sourced, in particular allowing for caching, pre-fetching, catalog metadata, etc…

Implementations on Foreign Types§

Source§

impl AsyncFileReader for Box<dyn AsyncFileReader>

Source§

fn get_bytes(&mut self, range: Range<usize>) -> BoxFuture<'_, Result<Bytes>>

Source§

fn get_byte_ranges( &mut self, ranges: Vec<Range<usize>>, ) -> BoxFuture<'_, Result<Vec<Bytes>>>

Source§

fn get_metadata(&mut self) -> BoxFuture<'_, Result<Arc<ParquetMetaData>>>

Implementors§

Source§

impl AsyncFileReader for ParquetObjectReader

Source§

impl<T: AsyncRead + AsyncSeek + Unpin + Send> AsyncFileReader for T