Trait IndexReader

Source
pub trait IndexReader: Send + Sync {
    // Required methods
    fn read_record_batch<'life0, 'async_trait>(
        &'life0 self,
        n: u64,
        batch_size: u64,
    ) -> Pin<Box<dyn Future<Output = Result<RecordBatch>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn read_range<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        range: Range<usize>,
        projection: Option<&'life1 [&'life2 str]>,
    ) -> Pin<Box<dyn Future<Output = Result<RecordBatch>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn num_batches<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = u32> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn num_rows(&self) -> usize;
    fn schema(&self) -> &Schema;
}
Expand description

Trait for reading an index (or parts of an index) from storage

Required Methods§

Source

fn read_record_batch<'life0, 'async_trait>( &'life0 self, n: u64, batch_size: u64, ) -> Pin<Box<dyn Future<Output = Result<RecordBatch>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Read the n-th record batch from the file

Source

fn read_range<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, range: Range<usize>, projection: Option<&'life1 [&'life2 str]>, ) -> Pin<Box<dyn Future<Output = Result<RecordBatch>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Read the range of rows from the file. If projection is Some, only return the columns in the projection, nested columns like Some(&[“x.y”]) are not supported. If projection is None, return all columns.

Source

fn num_batches<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = u32> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return the number of batches in the file

Source

fn num_rows(&self) -> usize

Return the number of rows in the file

Source

fn schema(&self) -> &Schema

Return the metadata of the file

Implementations on Foreign Types§

Source§

impl IndexReader for FileReader

Source§

fn read_record_batch<'life0, 'async_trait>( &'life0 self, offset: u64, _batch_size: u64, ) -> Pin<Box<dyn Future<Output = Result<RecordBatch>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn read_range<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, range: Range<usize>, projection: Option<&'life1 [&'life2 str]>, ) -> Pin<Box<dyn Future<Output = Result<RecordBatch>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn num_batches<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = u32> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn num_rows(&self) -> usize

Source§

fn schema(&self) -> &Schema

Source§

impl IndexReader for FileReader

Source§

fn read_record_batch<'life0, 'async_trait>( &'life0 self, offset: u64, batch_size: u64, ) -> Pin<Box<dyn Future<Output = Result<RecordBatch>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn read_range<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, range: Range<usize>, projection: Option<&'life1 [&'life2 str]>, ) -> Pin<Box<dyn Future<Output = Result<RecordBatch>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn num_batches<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = u32> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn num_rows(&self) -> usize

Source§

fn schema(&self) -> &Schema

Implementors§