Definitely agreed, an incompatible change to unify the two and add
both required row count as well
as optional rep/def level compression is the right long-term step. I'm
hoping to introduce an
optional row count to V1 pages as a short-term mitigation for a real
problem we observe in our workloads.

Best,
Div

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

>
> I'm not sure either, it would probably be a forward-incompatible change.
> (perhaps it would need a "V3" data page header? sigh).
>
> Either way, I think we should try and solve the problem that V1 and V2
> data pages each have their own advantages and drawbacks, so that we stop
> trying to guess which one is best when writing Parquet files.
>
> Regards
>
> Antoine.
>
>
> Le 23/11/2026 à 19:11, Divjot Arora via dev a écrit :
> > 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