Skip to main content

RowGroupPageIndex

Struct RowGroupPageIndex 

Source
pub struct RowGroupPageIndex {
    row_group_idx: usize,
    page_index: Option<Arc<dyn PageIndexProvider>>,
}
Expand description

Provides convenient access to page index data for a specific row group

This struct wraps a PageIndexProvider and automatically applies the row group index, simplifying access to column and offset indexes for a single row group. It is primarily used by readers to avoid repeatedly passing the row group index when accessing page-level metadata.

§Example

use parquet::file::metadata::ParquetMetaData;

fn process_row_group_pages(metadata: &ParquetMetaData, row_group_idx: usize) -> Result<()> {
    // Create a row-group-specific view of the page index
    let rg_page_index = metadata.page_index_for_row_group(row_group_idx);

    // Now access column indexes without specifying row_group_idx each time
    for col_idx in 0..metadata.file_metadata().schema_descr().num_columns() {
        if let Some(col_idx_data) = rg_page_index.column_index(col_idx) {
            println!("Column {} has {} pages", col_idx, col_idx_data.num_pages());
        }
    }
    Ok(())
}

Fields§

§row_group_idx: usize§page_index: Option<Arc<dyn PageIndexProvider>>

Implementations§

Source§

impl RowGroupPageIndex

Source

pub fn new( row_group_idx: usize, page_index: Option<Arc<dyn PageIndexProvider>>, ) -> Self

Creates a new RowGroupPageIndex for the specified row group

§Arguments
  • row_group_idx - The index of the row group within the file
  • page_index - Optional page index provider containing the index data
Source

pub fn column_index(&self, column_idx: usize) -> Option<&ColumnIndexMetaData>

Returns the column index for a specific column in this row group

This is a convenience method that wraps PageIndexProvider::column_index, automatically applying the row group index stored in this struct.

§Returns
  • Some(&ColumnIndexMetaData) - Column index is available with page-level statistics
  • None - Index unavailable (no page index, column out of bounds, or no statistics)
§See Also
Source

pub fn offset_index(&self, column_idx: usize) -> Option<&OffsetIndexMetaData>

Returns the offset index for a specific column in this row group

This is a convenience method that wraps PageIndexProvider::offset_index, automatically applying the row group index stored in this struct.

§Returns
  • Some(&OffsetIndexMetaData) - Offset index is available with page locations
  • None - Index unavailable (no page index, column out of bounds)
§See Also
Source

pub fn page_locations(&self, column_idx: usize) -> Option<&Vec<PageLocation>>

Returns the physical locations of all data pages for a specific column in this row group

This is a convenience method that wraps PageIndexProvider::page_locations, automatically applying the row group index stored in this struct.

This enables direct I/O to specific pages without reading the entire column chunk.

§Returns
  • Some(&Vec<PageLocation>) - Vector of page locations if offset index exists
  • None - Offset index not available for this column
§See Also
Source

pub fn num_data_pages(&self, column_idx: usize) -> Option<usize>

Returns the expected number of data pages for a specific column in this row group

This count includes only data pages, not dictionary pages or other metadata pages.

This is a convenience method that wraps PageIndexProvider::num_data_pages, automatically applying the row group index stored in this struct.

§Returns
  • Some(usize) - Number of data pages if any index is available
  • None - No index information available for this column
§See Also

Trait Implementations§

Source§

impl Debug for RowGroupPageIndex

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> 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, 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,