Skip to content

Parquet v3: align coalesced reads to a fixed byte grid - #2978

Draft
ianton-ru wants to merge 1 commit into
antalya-26.8from
feature/antalya-26.8/parquet-align-reads-fixed-grid
Draft

ianton-ru wants to merge 1 commit into
antalya-26.8from
feature/antalya-26.8/parquet-align-reads-fixed-grid

Conversation

@ianton-ru

@ianton-ru ianton-ru commented Nov 30, 2026 •

Copy link
Copy Markdown

Part of #2181 (Parquet v3 reader): align coalesced reads to a fixed byte grid. This part works on its own. The part that takes the real part offsets of an object from the object-storage identity cache needs that cache, so it is left out and can follow later.

The prefetcher merges nearby column-chunk ranges into one read task. A merged read can straddle a boundary between two parts of a multipart-uploaded S3 object, which AWS recommends avoiding for byte-range reads. This adds two experimental settings:

  • input_format_parquet_read_alignment_bytes (default 0, off): keep every coalesced read inside one window of a fixed grid of this size, so no read straddles a multiple of it. Set it to the writer's multipart part size, for example 10Mi for delta-rs or 64Mi for Spark/S3A.
  • input_format_parquet_read_alignment_min_bytes (default 1 MiB): do not cut a read at a boundary when the aligned segment ahead of it would be smaller than this. The read then straddles the boundary instead of emitting a tiny extra request.

Only the merging is limited. A single requested range that is larger than a window is read as is, and the window is the one that contains the start of the initial range. Both settings default to the previous behavior.

New profile events: ParquetPrefetcherPartAlignedTasks counts tasks whose merging was cut at a boundary, and ParquetPrefetcherAlignmentSkippedSmall counts the skips by the minimum-size guard.

The code comes from two commits of #2181 by UnamedRus. This PR leaves out the input_format_parquet_align_reads_to_multipart_boundaries setting and the plumbing of the real part offsets, because they need ObjectMetadata.part_offsets from the identity cache. Not measured yet: the effect on S3 request counts or latency. The test checks that results are unchanged and that the alignment and the guard take effect.

Related: #2181

Changelog category (leave one):

  • Experimental Feature

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Added the experimental settings input_format_parquet_read_alignment_bytes and input_format_parquet_read_alignment_min_bytes for the Parquet v3 reader. They keep coalesced reads from straddling the boundaries of a fixed byte grid, for example the multipart part size of the writer. Both are off by default. Added the profile events ParquetPrefetcherPartAlignedTasks and ParquetPrefetcherAlignmentSkippedSmall.

Documentation entry for user-facing changes

The settings are documented in their declarations (input_format_parquet_read_alignment_bytes, input_format_parquet_read_alignment_min_bytes), and the profile events in their descriptions in ProfileEvents.cpp.

CI/CD Options

Exclude tests:

  • Fast test
  • Integration Tests
  • Stateless tests
  • Stateful tests
  • Unit tests
  • Performance tests
  • Aarch64 tests
  • All with ASAN
  • All with TSAN
  • All with MSAN
  • All with UBSAN
  • All with Coverage
  • All Regression
  • Disable CI Cache

Regression jobs to run:

  • Fast suites (mostly <1h)
  • Aggregate Functions (2h)
  • Alter (1.5h)
  • Benchmark (30m)
  • CAS (content-addressed storage; Antalya only)
  • ClickHouse Keeper (1h)
  • Iceberg (2h)
  • LDAP (1h)
  • OAuth (5m)
  • Parquet (1.5h)
  • RBAC (1.5h)
  • SSL Server (1h)
  • S3 (2h)
  • S3 Export (2h)
  • Swarms (30m)
  • Tiered Storage (2h)

Add the experimental settings `input_format_parquet_read_alignment_bytes` and
`input_format_parquet_read_alignment_min_bytes`. When the first one is greater than zero,
the `Prefetcher` keeps each coalesced read task inside one window of a fixed grid of that
size, so no read straddles a multiple of it. With the grid set to the writer's multipart part
size (10 MiB for delta-rs, 64 MiB for Spark/S3A), no read straddles two parts of a
multipart-uploaded object, which is an AWS byte-range best practice. This needs no per-file
layout and no object-storage identity cache.

Only coalescing is limited: a single requested range larger than a window is left as is.
The window is the one containing the start of the initial requested range.

`input_format_parquet_read_alignment_min_bytes` (default 1 MiB) is an anti-fragmentation
guard: when the aligned segment ahead of the initial range would be smaller than this, the
read is allowed to straddle the boundary instead of emitting a tiny extra request.

New profile events: `ParquetPrefetcherPartAlignedTasks` counts tasks whose coalescing was cut
at a boundary, and `ParquetPrefetcherAlignmentSkippedSmall` counts the skips by the guard.

Both settings default to the previous behavior, and the settings are read straight from
`FormatSettings` in `Prefetcher::init`.

Based on 8afd7bd and b2df559 from #2181,
without the part that takes the real part offsets of an object from the object-storage
identity cache.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ianton-ru ianton-ru added antalya performance Antalya Roadmap: Performance port-antalya PRs to be ported to all new Antalya releases antalya-26.8 labels Nov 30, 2026
@ianton-ru ianton-ru changed the title Parquet v3: align coalesced reads to a fixed byte grid Parquet v3: align coalesced reads to a fixed byte grid, part 1 Nov 30, 2026
@github-actions

Copy link
Copy Markdown

Workflow [PR], commit [ce9c58d]

@ianton-ru ianton-ru changed the title Parquet v3: align coalesced reads to a fixed byte grid, part 1 Parquet v3: align coalesced reads to a fixed byte grid Nov 30, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

antalya antalya-26.8 performance Antalya Roadmap: Performance port-antalya PRs to be ported to all new Antalya releases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant