Skip to content

[Go][Parquet] support streaming reads for large data pages #865

Description

@joechenrh

Describe the enhancement requested

We have meet a Parquet file with extremely large data pages, making materializing the whole page expensive.

One observed page has metadata similar to:

type: DATA_PAGE
compressedSize: 1079936746
uncompressedSize: 1426870008
numValues: 233
encoding: PLAIN
definitionLevelEncoding: RLE
repetitionLevelEncoding: BIT_PACKED
hasCrc: true

Today the Parquet reader materializes the full uncompressed page buffer before decoding values, which requires allocating memory proportional to the page's uncompressed size.

It would be useful for the reader to support a streaming/lazy data page read path for large pages. For Data Page V1, the reader could parse repetition and definition levels first into small buffers, then leave the decompressed stream positioned at the encoded values and decode values on demand.

A possible first step would be an opt-in reader property or strategy that enables streaming value decoding for supported page shapes, for example:

  • Data Page V1
  • PLAIN encoding
  • BYTE_ARRAY / string-like columns
  • RLE definition levels
  • RLE or BIT_PACKED repetition levels
  • codecs that can be exposed as an io.Reader stream

Unsupported encodings/codecs/page layouts could continue to fall back to the existing materialized page path.

The goal is to allow applications to read valid Parquet files with very large pages while keeping peak reader memory closer to the requested batch size plus small level buffers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions