-
Notifications
You must be signed in to change notification settings - Fork 1k
Parquet: Do not compress v2 data page when compress is bad quality #8257
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
base: main
Are you sure you want to change the base?
Conversation
cmpr.compress(&values_data.buf, &mut buffer)?; | ||
if uncompressed_size <= buffer.len() - buffer_len { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can also be a "score", like if uncompressed_size <= (buffer.len() - buffer_len) * 0.9 {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest maybe going the opposite direction. If compression doesn't give say a 10% size reduction, then don't compress...it will be faster to read. 10% might be too much...maybe we could make it configurable.
Anyway, that's probably out of scope for this PR. Let's just go with the simple test for now...it's still an improvement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I do think that would need to configurable as I think some people would treat a 10% size increase as a regression, even if they got a faster reader
A good follow on ticket for sure
This need add some test, I found a |
This is caused by another bug in user side, it's not related to this problem :-( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this makes a lot of sense, and seems like the intended use of the is_compressed
flag.
c35ae85
to
0e198e9
Compare
I've added a test for this, would you mind take a look again? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test looks good! Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cmpr.compress(&values_data.buf, &mut buffer)?; | ||
if uncompressed_size <= buffer.len() - buffer_len { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I do think that would need to configurable as I think some people would treat a 10% size increase as a regression, even if they got a faster reader
A good follow on ticket for sure
get_test_column_writer::<ByteArrayType>(Box::new(page_writer), 0, 0, Arc::new(props)); | ||
|
||
// Create small, simple data that Snappy compression will likely increase in size | ||
// due to compression overhead for very small data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Which issue does this PR close?
Rationale for this change
Do not compress v2 data page when compress is bad quality ( compressed size is greater or equal to uncompressed_size )
What changes are included in this PR?
Discard compression when it's too large
Are these changes tested?
Covered by existing
Are there any user-facing changes?
No