Skip to content

[WIP] Add PageIndexBuilder and PageIndexProvider for Parquet page indexes - #10842

Draft
etseidl wants to merge 52 commits into
apache:mainfrom
etseidl:page_index_provider
Draft

[WIP] Add PageIndexBuilder and PageIndexProvider for Parquet page indexes#10842
etseidl wants to merge 52 commits into
apache:mainfrom
etseidl:page_index_provider

Conversation

@etseidl

@etseidl etseidl commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

This grew out of a discussion in #10784 and relates to apache/datafusion#24288 (comment). This PR provides a new builder for creating page index structures, and also adds a new PageIndexProvider trait to allow more performant implementations.

What changes are included in this PR?

Adds PageIndexBuilder, PageIndexProvider, implements PageIndexProvider for PageIndex, and adds RowGroupPageIndex as a helper to support fetching page indexes for a specific row group (replaces the X_index_for_rowgroup() functions on PageIndex).

Are these changes tested?

Yes, should be covered by existing tests

Are there any user-facing changes?

Yes, this changes the public API for accessing page index information

@github-actions github-actions Bot added the parquet Changes to the parquet crate label Aug 25, 2026
@etseidl

etseidl commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

@alamb @adriangb here's what Claude and I came up with. I'd still like to add an example of a custom PageIndexProvider somewhere. Let me know what you think 🙏

/// }
/// ```
#[derive(Debug)]
pub struct RowGroupPageIndex {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this struct was my solution for how to replace the functions that returned a slice of indexes for a given row group. After using it some I'm wondering if it should also carry the number of columns.

Comment thread parquet/src/file/metadata/mod.rs Outdated
}
}

pub trait PageIndexProvider: HeapSize + Send + Sync + std::fmt::Debug {

@etseidl etseidl Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This trait replicates most of the previous PageIndex interface. The ParquetMetaData now holds a Option<Arc<dyn PageIndexProvider>> so we should be able to plug in any type of optimizations we want. I kept the old PageIndex as a default implementation primarily used on the write side.

We could later add a sparse implementation like that suggested by @adriangb on the read side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

parquet Changes to the parquet crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

parquet: PageIndex cannot be constructed outside the crate

2 participants