On Thu, 19 Nov 2026 at 11:20, Andrew Lamb <[email protected]> wrote:

> Thanks for bringing this up -- it is definitely worth discussing
>
> > ColumnMetaData.total_uncompressed_size, covers a whole column chunk,
> which
> is too coarse to control a read page by page.
>
> If the usecase is to avoid exhausting the heap, I am trying to figure out
> how much more value page sizes add. Is the idea that there are column
> chunks that are so big they can't fit in the heap, but a subset of their
> pages can?
>

Essentially yes, though it's less about single chunks and more about a sum
of chunks read concurrently: multiple projected columns in one read,
potentially multiple reads at once in a service.

Specifically, the page index already lets a reader size each page's decoded
output (value counts, unencoded_byte_array_data_bytes). What it can't size
without fetching is each page's decompressed body, and the dictionary page
as a whole.

In Hardwood, we work with the notion of a working set of pages which are
required in memory to allow the reader to progress. For instance, we might
only process the first five out of a chunk's 20 pages if the reader is at
the beginning of the row group. Also, for a filtered read of a file with a
page index, we would only ever fetch, decompress, and decode the matching
pages of a chunk to begin with. In both cases, sizing the bound based on
the entire chunk would be unnecessarily wasteful.


> Also, are you seeing this in real world files (e.g. with huge column
> chunks) or is it more of a hardening concern at the moment?
>

The latter, hardening. I'm exploring how to guarantee that a read's memory
never exceeds a configurable threshold.

The gap between chunk and page sizes does show up in published data: in
Common Crawl's URL index [1] (written by parquet-java, page index present),
the chunks of the url column are 64–122 MiB uncompressed, while the largest
page is about 1 MiB. If a reader wanted to enforce a memory bound before
fetching, today it would have to budget a chunk's full uncompressed size,
up to about 120× what a page-based bound would need.

Best,

--Gunnar

[1] https://commoncrawl.org/url-index


> Andrew
>
> On Wed, Nov 18, 2026 at 4:06 PM Gunnar Morling via dev <
> [email protected]> wrote:
>
>> Hey all,
>>
>> Following up on the resource exhaustion point in the security posture
>> thread, I'd like to gauge interest in a small addition to the Parquet page
>> index.
>>
>> In Hardwood, we've been exploring how to bound a read's memory, so that a
>> file from an untrusted source fails cleanly instead of exhausting the
>> heap,
>> which matters in particular in shared environments. Today a reader can
>> enforce such a bound before decompressing and decoding a page, but not
>> before fetching it (or at least its header, at the cost of a round trip
>> per
>> page).
>>
>> The page index already gets us most of the way: it gives each data page's
>> value count (from first_row_index, or for repeated columns from the
>> optional level histograms) and, since 2.10, its decoded BYTE_ARRAY bytes
>> (unencoded_byte_array_data_bytes). What's missing is a data page's
>> uncompressed_page_size, which is only in its page header, and the
>> uncompressed size of a column chunk's dictionary page, which has no entry
>> in the OffsetIndex. The only up-front figure,
>> ColumnMetaData.total_uncompressed_size, covers a whole column chunk, which
>> is too coarse to control a read page by page.
>>
>> If the OffsetIndex carried those two, a reader could, together with the
>> existing optional statistics, bound what every page will allocate from
>> footer and index alone, and plan or reject a read before fetching any
>> page.
>>
>> The new fields would be optional at first. A reader enforcing a bound
>> would
>> treat them as binding and fail the read if a page needs more than it
>> declares. If a later version required writers to emit them, such a reader
>> could also reject files written to that version that lack them.
>>
>> Would this be something the community is interested in? Perhaps this could
>> also be part of the ongoing modular footer work
>> (apache/parquet-format#622)?
>>
>> Best,
>>
>> --Gunnar
>>
>

Reply via email to