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
