Skip to main content

ParquetMetaData

Struct ParquetMetaData 

Source
pub struct ParquetMetaData {
    file_metadata: Arc<FileMetaData>,
    row_groups: Arc<[RowGroupMetaData]>,
    page_index: Option<Arc<dyn PageIndexProvider>>,
    file_decryptor: Option<Arc<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:

This structure is read by the various readers in this crate or can be read directly from a file using the ParquetMetaDataReader struct.

The individual fields of this structure are stored in a way that make cloning this structure low-cost.

See PageIndexProvider for details on customizing page index handling.

See the ParquetMetaDataBuilder to create and modify this structure.

Fields§

§file_metadata: Arc<FileMetaData>

File level metadata

§row_groups: Arc<[RowGroupMetaData]>

Row group metadata

§page_index: Option<Arc<dyn PageIndexProvider>>

Page level index for each page in each column chunk

§file_decryptor: Option<Arc<FileDecryptor>>

Optional file decryptor

Implementations§

Source§

impl ParquetMetaData

Source

pub fn new( file_metadata: FileMetaData, row_groups: Vec<RowGroupMetaData>, ) -> Self

Creates Parquet metadata from file metadata and a list of row group metadata

Source

pub fn into_builder(self) -> ParquetMetaDataBuilder

Convert this ParquetMetaData into a ParquetMetaDataBuilder.

The builder initially shares any reference-counted metadata. Mutating shared fields may clone their contents using copy-on-write.

Source

pub fn file_metadata(&self) -> &FileMetaData

Returns file metadata as reference.

Source

pub(crate) fn file_decryptor(&self) -> Option<&FileDecryptor>

Returns file decryptor as reference.

Source

pub fn num_row_groups(&self) -> usize

Returns number of row groups in this file.

Source

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.

Source

pub fn row_groups(&self) -> &[RowGroupMetaData]

Returns slice of row groups in this file.

Source

pub fn column_chunk( &self, row_group_idx: usize, column_idx: usize, ) -> Result<&ColumnChunkMetaData>

Returns ColumnChunkMetaData for a row-group position and physical leaf column index.

Returns an error if either index is out of bounds.

Source

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.

Source

pub fn page_index(&self) -> Option<&Arc<dyn PageIndexProvider>>

Returns a PageIndexProvider for this file

Returns None if the parquet file lacks page indexes or ArrowReaderOptions::with_page_index_policy was set to PageIndexPolicy::Skip.

Source

pub fn page_index_for_row_group( &self, row_group_idx: usize, ) -> RowGroupPageIndex

Returns a RowGroupPageIndex for a specific row group

Source

pub fn memory_size(&self) -> usize

Estimate of the bytes allocated to store ParquetMetadata

§Notes:
  1. Includes size of self

  2. Includes heap memory for sub fields such as FileMetaData, RowGroupMetaData, and the built-in PageIndex provider.

  3. Includes memory reachable through shared pointers, such as SchemaDescPtr and the Arc-wrapped page index provider. Therefore, the same allocation may be counted by multiple metadata values or when the provider is also retained in an external cache.

  4. Does not include heap memory used by custom PageIndexProvider implementations.

  5. Does not include any allocator overheads.

Source

pub(crate) fn set_page_index( &mut self, index: Option<Arc<dyn PageIndexProvider>>, )

Override the page index

Trait Implementations§

Source§

impl Clone for ParquetMetaData

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ParquetMetaData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<ParquetMetaData> for ParquetMetaDataBuilder

Source§

fn from(meta_data: ParquetMetaData) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for ParquetMetaData

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for ParquetMetaData

§

impl !UnwindSafe for ParquetMetaData

§

impl Forget for ParquetMetaData

§

impl Freeze for ParquetMetaData

§

impl Move for ParquetMetaData

§

impl Send for ParquetMetaData

§

impl Sync for ParquetMetaData

§

impl Unpin for ParquetMetaData

§

impl UnsafeUnpin for ParquetMetaData

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Ungil for T
where T: Send,