Trait parquet::file::reader::FileReader
source · pub trait FileReader: Send + Sync {
// Required methods
fn metadata(&self) -> &ParquetMetaData;
fn num_row_groups(&self) -> usize;
fn get_row_group(&self, i: usize) -> Result<Box<dyn RowGroupReader + '_>>;
fn get_row_iter(
&self,
projection: Option<SchemaType>,
) -> Result<RowIter<'_>>;
}
Expand description
Parquet file reader API. With this, user can get metadata information about the Parquet file, can get reader for each row group, and access record iterator.
Required Methods§
sourcefn metadata(&self) -> &ParquetMetaData
fn metadata(&self) -> &ParquetMetaData
Get metadata information about this file.
sourcefn num_row_groups(&self) -> usize
fn num_row_groups(&self) -> usize
Get the total number of row groups for this file.
sourcefn get_row_group(&self, i: usize) -> Result<Box<dyn RowGroupReader + '_>>
fn get_row_group(&self, i: usize) -> Result<Box<dyn RowGroupReader + '_>>
Get the i
th row group reader. Note this doesn’t do bound check.
sourcefn get_row_iter(&self, projection: Option<SchemaType>) -> Result<RowIter<'_>>
fn get_row_iter(&self, projection: Option<SchemaType>) -> Result<RowIter<'_>>
Get an iterator over the row in this file, see RowIter
for caveats.
Iterator will automatically load the next row group to advance.
Projected schema can be a subset of or equal to the file schema, when it is None, full file schema is assumed.