Repository navigation
GH-47752: [C++][Python][Parquet] Add minimum compression savings for V2 pages - #52579
Closed
MashrafeeAryan wants to merge 2 commits into
Closed
MashrafeeAryan wants to merge 2 commits into
MashrafeeAryan wants to merge 2 commits into
Conversation
Add min_space_savings to control how much space compression must save. V2 pages below the threshold are written uncompressed. Keep the default behavior and V1 pages unchanged.
Add an option to choose how much space compression must save when writing Parquet files from Python. Add tests as well.
MashrafeeAryan
requested review from
AlenkaF,
HuaHuaY,
pitrou,
raulcd,
rok and
wgtmac
as code owners
October 9, 2026 17:25
MashrafeeAryan
marked this pull request as draft
October 9, 2026 17:25
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title: GH-47752: [C++][Python][Parquet] Add minimum compression savings for V2 pages
Fixes #47752.
Rationale for this change
Parquet's V2 pages currently keep compression whenever the compressed values are smaller than the original values. Even if it saves very little space, it still does it. For instance, it can compress 100 KB to 99 KB and save it. Even though that's 1% storage efficient, it might not be worth the decompression overhead while reading the file.
What changes are included in this PR?
In the PR, I added an optional
min_space_savingssetting between0.0and1.0. It gives users an option to select the minimum threshold to compress V2 page data values. For instance, if the original file is100 KBand the user hasmin_space_savings = 0.1, it means the compressed file needs to save at least 10% space. As a result, unless the file is<= 90 KB, it won't get saved.I keep the current behavior when the user does not set
min_space_savings.Added C++ and Python implementation.
Are these changes tested?
This is a draft PR. Will do more tests.
Are there any user-facing changes?
C++ and Python users can set
min_space_savingswhen writing V2 pages. For example,0.1requires at least 10% space savings before keeping compression.Was AI used for this PR?
Codex helped navigate and suggest changes for tests and compression behavior. Claude helped to review changes and point out any critical bugs.
PR code and description written by:
Reviewed before submission by: