Do not try to uncompress pages that are not compressed #103
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.
[This is a sync of a fix already done and tested in a fork]
Relates to #102
Context
Panther is running fraugster/parguet-go in production for some months now ingesting TBs of data.
Some customers reported that they got the following error:
After some investigation we can see that in the
read
function of the the V2 DataPage, the flag (already present inDataPageHeaderV2
) was not checked.More context: Parquet files - when compressed - are so in the page layer. Parquet supports compression per page, (as shown from the
DataPageHeaderV2
IsCompressed
field, which comes directly from the thrift definition). The library detects the compression type (calledCompressionCodec
) and passes that down to thenewBlockReader
level. However it still needs to check if that specific page is indeed compressed, and that was missing.Checks
FWIW, I doubled check this with parquet-go/parquet-goparquet-go/parquet-go and confirmed that they don't try to decompress that.
Ran all the tests with https://github.com/apache/parquet-testing
[Note: I can try adding a file into https://github.com/apache/parquet-testing before trying merging this into upstream]
Ran all unit tests with the race detector on
Added a unit tests
... that passes with false, but breaks if I do
IsCompressed
=>true
because the input is not snappy