Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New SerializedPageReader when dictionary page is provided #7087

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

trungda
Copy link
Contributor

@trungda trungda commented Feb 6, 2025

Which issue does this PR close?

Rationale for this change

Our use case is that we have already iterate through all the page headers of the parquet file at the beginning so we know the location of the dictionary page so we don't want to have to pass the first data page in the page_location argument anymore.

What changes are included in this PR?

Adds a new constructor to SerializedPageReader to make sure we don't break existing callers of SerializedPageReader.

Are there any user-facing changes?

Yes in a way that there is a new constructor but existing callers should still be able to function.

@github-actions github-actions bot added the parquet Changes to the parquet crate label Feb 6, 2025
Comment on lines +530 to +531
/// Note: The first page in `page_locations` (if available)
/// must be the first data page to infer the dictionary page's location.
Copy link
Contributor Author

@trungda trungda Feb 6, 2025

Choose a reason for hiding this comment

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

Is there a way to enforce or return error early when a user doesn't follow this? I believe, currently, the reader will panic if the first page location is not the first data page.

@trungda trungda marked this pull request as ready for review February 6, 2025 19:05
@tustvold
Copy link
Contributor

tustvold commented Feb 8, 2025

Not had time to look in detail, buf I wonder if rather than continuing to add ever more constructors, if it would be better to extract a builder?

@trungda
Copy link
Contributor Author

trungda commented Feb 9, 2025

Not had time to look in detail, buf I wonder if rather than continuing to add ever more constructors, if it would be better to extract a builder?

I can give it a try :)

@tustvold tustvold marked this pull request as draft March 8, 2025 09:38
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.

Ability to pass arbitrary pages to SerializedPageReader
3 participants