pub struct ParquetMetaData {
file_metadata: FileMetaData,
row_groups: Vec<RowGroupMetaData>,
page_index: Option<PageIndex>,
file_decryptor: Option<Box<FileDecryptor>>,
}Expand description
Parsed metadata for a single Parquet file
This structure is stored in the footer of Parquet files, in the format
defined by parquet.thrift.
§Overview
The fields of this structure are:
FileMetaData: Information about the overall file (such as the schema) (SeeSelf::file_metadata)RowGroupMetaData: Information about each Row Group (seeSelf::row_groups)PageIndex: Optional “Page Index” structures (seeSelf::page_index)
This structure is read by the various readers in this crate or can be read
directly from a file using the ParquetMetaDataReader struct.
See the ParquetMetaDataBuilder to create and modify this structure.
Fields§
§file_metadata: FileMetaDataFile level metadata
row_groups: Vec<RowGroupMetaData>Row group metadata
page_index: Option<PageIndex>Page level index for each page in each column chunk
file_decryptor: Option<Box<FileDecryptor>>Optional file decryptor
Implementations§
Source§impl ParquetMetaData
impl ParquetMetaData
Sourcepub fn new(
file_metadata: FileMetaData,
row_groups: Vec<RowGroupMetaData>,
) -> Self
pub fn new( file_metadata: FileMetaData, row_groups: Vec<RowGroupMetaData>, ) -> Self
Creates Parquet metadata from file metadata and a list of row group metadata
Sourcepub(crate) fn with_file_decryptor(
&mut self,
file_decryptor: Option<FileDecryptor>,
)
pub(crate) fn with_file_decryptor( &mut self, file_decryptor: Option<FileDecryptor>, )
Adds [FileDecryptor] to this metadata instance to enable decryption of
encrypted data.
Sourcepub fn into_builder(self) -> ParquetMetaDataBuilder
pub fn into_builder(self) -> ParquetMetaDataBuilder
Convert this ParquetMetaData into a ParquetMetaDataBuilder
Sourcepub fn file_metadata(&self) -> &FileMetaData
pub fn file_metadata(&self) -> &FileMetaData
Returns file metadata as reference.
Sourcepub(crate) fn file_decryptor(&self) -> Option<&FileDecryptor>
pub(crate) fn file_decryptor(&self) -> Option<&FileDecryptor>
Returns file decryptor as reference.
Sourcepub fn num_row_groups(&self) -> usize
pub fn num_row_groups(&self) -> usize
Returns number of row groups in this file.
Sourcepub fn row_group(&self, i: usize) -> &RowGroupMetaData
pub fn row_group(&self, i: usize) -> &RowGroupMetaData
Returns row group metadata for ith position.
Position should be less than number of row groups num_row_groups.
Sourcepub fn row_groups(&self) -> &[RowGroupMetaData]
pub fn row_groups(&self) -> &[RowGroupMetaData]
Returns slice of row groups in this file.
Sourcepub fn row_group_num_rows(&self, row_group_idx: usize) -> Result<usize>
pub fn row_group_num_rows(&self, row_group_idx: usize) -> Result<usize>
Returns the number of rows in row_group_idx.
Returns an error if the row group index is out of bounds or its row
count cannot be represented as a usize.
Sourcepub fn page_index(&self) -> Option<&PageIndex>
pub fn page_index(&self) -> Option<&PageIndex>
Returns the page index for this file if loaded
Returns None if the parquet file lacks page indexes or
ArrowReaderOptions::with_page_index was set to false.
Sourcepub fn memory_size(&self) -> usize
pub fn memory_size(&self) -> usize
Estimate of the bytes allocated to store ParquetMetadata
§Notes:
-
Includes size of self
-
Includes heap memory for sub fields such as
FileMetaDataandRowGroupMetaData. -
Includes memory from shared pointers (e.g.
SchemaDescPtr). This meansmemory_sizewill over estimate the memory size if such pointers are shared. -
Does not include any allocator overheads
Sourcepub(crate) fn set_page_index(&mut self, index: Option<PageIndex>)
pub(crate) fn set_page_index(&mut self, index: Option<PageIndex>)
Override the page index
Trait Implementations§
Source§impl Clone for ParquetMetaData
impl Clone for ParquetMetaData
Source§fn clone(&self) -> ParquetMetaData
fn clone(&self) -> ParquetMetaData
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more