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
impl RowGroupPageIndex
Sourcepub fn new(
row_group_idx: usize,
page_index: Option<Arc<dyn PageIndexProvider>>,
) -> Self
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 filepage_index- Optional page index provider containing the index data
Sourcepub fn column_index(&self, column_idx: usize) -> Option<&ColumnIndexMetaData>
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 statisticsNone- Index unavailable (no page index, column out of bounds, or no statistics)
§See Also
PageIndexProvider::column_indexfor more details on column indexes
Sourcepub fn offset_index(&self, column_idx: usize) -> Option<&OffsetIndexMetaData>
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 locationsNone- Index unavailable (no page index, column out of bounds)
§See Also
PageIndexProvider::offset_indexfor more details on offset indexes
Sourcepub fn page_locations(&self, column_idx: usize) -> Option<&Vec<PageLocation>>
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 existsNone- Offset index not available for this column
§See Also
PageIndexProvider::page_locationsfor more details on page locations
Sourcepub fn num_data_pages(&self, column_idx: usize) -> Option<usize>
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 availableNone- No index information available for this column
§See Also
PageIndexProvider::num_data_pagesfor more details