Thanks for the input, Antoine. I agree, but I wasn't sure how to make this
forward compatible
as readers currently assume that V2 data pages mean uncompressed rep/def
levels and
compressed values. Adding the levels to the compressed stream would yield
data that existing
readers can't process. Let me know if you have thoughts on how to address
this.

Best,
Div

On Mon, Nov 23, 2026 at 6:30 PM Antoine Pitrou <[email protected]> wrote:

>
> Hi Divjot,
>
> I think this is ok on the face of it, but I would find it more useful if
> we could find ways for V2 data pages to be generally beneficial. For
> example by adding optional compression of levels there.
>
> ("V2" should never be worse than "V1" IMHO)
>
> Regards
>
> Antoine.
>
>
> Le 23/11/2026 à 18:13, Divjot Arora via dev a écrit :
> > Hi everyone,
> >
> > I'd like to propose adding row count to V1 data pages (DataPageHeader in
> > parquet.thrift [1]). This header only has value count today,
> > which differs from row count for repeated columns. Comparatively, V2 data
> > page headers contain both row and value counts. The row
> > count is specifically helpful when seeking to a pre-determined row number
> > in the file, especially when an offset index is not present. I
> > considered instead switching to V2 data pages, but this is not ideal as
> > this additionally requires not compressing rep/def levels and we've
> > observed cases in our fleet where these compress very well, causing
> storage
> > size to increase over 20% when V2 pages are used. I believe
> > having the row count is useful on its own and getting it should not be
> > coupled with other changes.
> >
> > Concrete proposal: add `optional i32 num_rows` to DataPageHeader. If set,
> > rows must not span page boundaries (e.g. one row of an array
> > column with 10k values cannot have 5k values on one page and the next 5k
> on
> > another page). When not set, readers cannot assume row/page
> > boundaries line up and must decode the page's rep levels to get an
> accurate
> > row count (same rules as today).
> >
> > Best,
> > Div
> >
> > [1]
> >
> https://github.com/apache/parquet-format/blob/6f879257c76e61f05fb4d97da952fae452cb858a/src/main/thrift/parquet.thrift#L713
> > [2]
> >
> https://github.com/apache/parquet-format/blob/6f879257c76e61f05fb4d97da952fae452cb858a/src/main/thrift/parquet.thrift#L766
>
>
>

Reply via email to