Skip to content

Commit

Permalink
Do not try to uncompress pages that are not compressed
Browse files Browse the repository at this point in the history
  • Loading branch information
papanikge committed Mar 27, 2024
1 parent 0c50c9d commit 1ba8c9a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions page_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ func (dp *dataPageReaderV2) read(r io.Reader, ph *parquet.PageHeader, codec parq
}
}

if !ph.DataPageHeaderV2.IsCompressed {
return dp.valuesDecoder.init(bytes.NewReader(dataPageBlock[levelsSize:]))
}

reader, err := newBlockReader(dataPageBlock[levelsSize:], codec, ph.GetCompressedPageSize()-levelsSize, ph.GetUncompressedPageSize()-levelsSize, dp.alloc)
if err != nil {
return err
Expand Down

0 comments on commit 1ba8c9a

Please sign in to comment.