I'm just wondering why cannot simply producing OffsetIndex instead to obtain
this? Adding a new field to the page header requires development anyway, it
might be much easier to produce the existing spec-compliant data structure?

Another concern is that we don't know if all pages have written the new
row_count before reading all of them. What if a writer fills this value
in some pages but not all?

Best,
Gang

On Tue, Nov 24, 2026 at 7:59 PM Andrew Lamb <[email protected]> wrote:

> In my opinion, adding (optional) row counts to V1 pages seems like a
> reasonable and incremental improvement to the format.
>
> Andrew
>
> On Mon, Nov 23, 2026 at 7:04 PM Alkis Evlogimenos via dev <
> [email protected]> wrote:
>
> > I agree with this proposal. This brings V1 pages closer to V2 with
> minimal
> > friction.
> >
> > Ideally we would introduce V3 pages that subsume all usecases from V1 and
> > V2 but that should be a followup. We can get Divjot's proposal in now and
> > make a proposal for V3 pages when we design it properly. We could
> consider
> > moving away from def/rep and do lengths/bitmap instead. It would take a
> bit
> > of metadata work but it doesn't seem too hard.
> >
> > On Mon, Nov 23, 2026 at 8:22 PM Divjot Arora via dev <
> > [email protected]>
> > wrote:
> >
> > > 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