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:
-
There is a default implementation for types that implement [
AsyncRead
] and [AsyncSeek
], for exampletokio::fs::File
. -
ParquetObjectReader
, available when theobject_store
crate feature is enabled, implements this interface forObjectStore
.
Required Methods§
Sourcefn get_bytes(&mut self, range: Range<usize>) -> BoxFuture<'_, Result<Bytes>>
fn get_bytes(&mut self, range: Range<usize>) -> BoxFuture<'_, Result<Bytes>>
Retrieve the bytes in range
Sourcefn get_metadata(&mut self) -> BoxFuture<'_, Result<Arc<ParquetMetaData>>>
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§
Trait Implementations§
Source§impl AsyncFileReader for Box<dyn AsyncFileReader>
impl AsyncFileReader for Box<dyn AsyncFileReader>
Source§fn get_bytes(&mut self, range: Range<usize>) -> BoxFuture<'_, Result<Bytes>>
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>>>
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
sequentiallySource§fn get_metadata(&mut self) -> BoxFuture<'_, Result<Arc<ParquetMetaData>>>
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…