pub struct ParquetMetaData {
file_metadata: FileMetaData,
row_groups: Vec<RowGroupMetaData>,
column_index: Option<ParquetColumnIndex>,
offset_index: Option<ParquetOffsetIndex>,
}
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
)ParquetColumnIndex
andParquetOffsetIndex
: Optional “Page Index” structures (seeSelf::column_index
andSelf::offset_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: FileMetaData
File level metadata
row_groups: Vec<RowGroupMetaData>
Row group metadata
column_index: Option<ParquetColumnIndex>
Page level index for each page in each column chunk
offset_index: Option<ParquetOffsetIndex>
Offset index for each page in each column chunk
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 fn new_with_page_index(
file_metadata: FileMetaData,
row_groups: Vec<RowGroupMetaData>,
column_index: Option<ParquetColumnIndex>,
offset_index: Option<ParquetOffsetIndex>,
) -> Self
👎Deprecated since 53.1.0: Use ParquetMetaDataBuilder
pub fn new_with_page_index( file_metadata: FileMetaData, row_groups: Vec<RowGroupMetaData>, column_index: Option<ParquetColumnIndex>, offset_index: Option<ParquetOffsetIndex>, ) -> Self
Creates Parquet metadata from file metadata, a list of row group metadata, and the column index structures.
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 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 i
th 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 column_index(&self) -> Option<&ParquetColumnIndex>
pub fn column_index(&self) -> Option<&ParquetColumnIndex>
Returns the column index for this file if loaded
Returns None
if the parquet file does not have a ColumnIndex
or
ArrowReaderOptions::with_page_index was set to false.
Sourcepub fn offset_index(&self) -> Option<&ParquetOffsetIndex>
pub fn offset_index(&self) -> Option<&ParquetOffsetIndex>
Returns offset indexes in this file, if loaded
Returns None
if the parquet file does not have a OffsetIndex
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
FileMetaData
andRowGroupMetaData
. -
Includes memory from shared pointers (e.g.
SchemaDescPtr
). This meansmemory_size
will over estimate the memory size if such pointers are shared. -
Does not include any allocator overheads
Sourcepub(crate) fn set_column_index(&mut self, index: Option<ParquetColumnIndex>)
pub(crate) fn set_column_index(&mut self, index: Option<ParquetColumnIndex>)
Override the column index
Sourcepub(crate) fn set_offset_index(&mut self, index: Option<ParquetOffsetIndex>)
pub(crate) fn set_offset_index(&mut self, index: Option<ParquetOffsetIndex>)
Override the offset index
Trait Implementations§
Source§impl Clone for ParquetMetaData
impl Clone for ParquetMetaData
Source§fn clone(&self) -> ParquetMetaData
fn clone(&self) -> ParquetMetaData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ParquetMetaData
impl Debug for ParquetMetaData
Source§impl From<ParquetMetaData> for ParquetMetaDataBuilder
impl From<ParquetMetaData> for ParquetMetaDataBuilder
Source§fn from(meta_data: ParquetMetaData) -> Self
fn from(meta_data: ParquetMetaData) -> Self
Source§impl PartialEq for ParquetMetaData
impl PartialEq for ParquetMetaData
impl StructuralPartialEq for ParquetMetaData
Auto Trait Implementations§
impl Freeze for ParquetMetaData
impl RefUnwindSafe for ParquetMetaData
impl Send for ParquetMetaData
impl Sync for ParquetMetaData
impl Unpin for ParquetMetaData
impl UnwindSafe for ParquetMetaData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more