Struct parquet::file::metadata::ParquetMetaData
source · pub struct ParquetMetaData { /* private fields */ }
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.
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: 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 page_indexes(&self) -> Option<&ParquetColumnIndex>
👎Deprecated: Use Self::column_index
pub fn page_indexes(&self) -> Option<&ParquetColumnIndex>
Returns page indexes 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_indexes(&self) -> Option<&ParquetOffsetIndex>
👎Deprecated: Use Self::offset_index
pub fn offset_indexes(&self) -> Option<&ParquetOffsetIndex>
Returns the offset index for this file if loaded
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
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)