From 1ba8c9abf00bbcfb95f671bd4b18d458a9e3baa2 Mon Sep 17 00:00:00 2001 From: George Papanikolaou Date: Wed, 27 Mar 2024 14:45:52 +0200 Subject: [PATCH] Do not try to uncompress pages that are not compressed --- page_v2.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/page_v2.go b/page_v2.go index ea9e73f..4a91a50 100644 --- a/page_v2.go +++ b/page_v2.go @@ -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