-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Parquet-java sometimes produces 0-size compressed data in data page v2 #3122
Comments
It's not an enhancement, it's a bug in Parquet-java. |
Let me take a look at this. What the compressed bytes size is written out on the C++ side for this case? |
I could try directly with Arrow C++, but Python tells me it should be a single 0 byte for Snappy: >>> snappy.compress(b"")
b'\x00' And, of course, that depends on the compression algorithm. See for example Zstd: >>> zstd.compress(b"")
b'(\xb5/\xfd \x00\x01\x00\x00'
>>> zstd.compress(b"").hex()
'28b52ffd2000010000' |
But I think that's irrelevant anyway. What you should do if there are 0 uncompressed bytes is simply to set |
@pitrou, thanks for the background information and suggestions you provided. I will fix it after the Chinese New Year holiday. |
Describe the bug
See:
V2 data pages do not compress def/rep levels, only the values. In the (not uncommon) case where all data is null, Parquet-java may write 0 compressed bytes for a 0-size decompressed data. However, a 0-size compressed buffer is not a valid input for compressors. The data page then fails decompressing in the C++ and Rust implementations.
Component(s)
Core
The text was updated successfully, but these errors were encountered: