Skip to content

Parquet v3: fill-ratio guard for read coalescing (input_format_parquet_read_min_fill_ratio) - #2946

Draft
ianton-ru wants to merge 1 commit into
antalya-26.8from
feature/antalya-26.8/parquet-read-fill-ratio-guard
Draft

ianton-ru wants to merge 1 commit into
antalya-26.8from
feature/antalya-26.8/parquet-read-fill-ratio-guard

Conversation

@ianton-ru

Copy link
Copy Markdown

Fill-ratio guard for read coalescing in the Parquet v3 reader. This is one independent feature split out of #2181, ported onto antalya-26.8. Only the fill-ratio part of the original change is included.

Prefetcher coalesces nearby column chunk ranges into one read when the gap is below the seek threshold. With a large threshold (remote storage) many such gaps add up: a tiny, scattered column (for example a constant column) drags in the wide columns between its chunks, so a few KB of wanted data turn into hundreds of MB read.

New setting input_format_parquet_read_min_fill_ratio (Double, range 0..1, 0 = off, the default): while extending a task in either direction, Prefetcher stops when including the next range would make the wanted bytes of the task less than this fraction of its span. Gaps below 64 KiB are always bridged, so dense reads are never split. A value outside 0..1 is rejected with BAD_ARGUMENTS. New profile event ParquetPrefetcherFillRatioLimitedTasks counts how many times the guard stopped an extension.

Tests: stateless test 05831_parquet_v3_read_min_fill_ratio reads one constant column from a file with wide neighbouring columns and a large input_format_parquet_local_file_min_bytes_for_seek; it checks that the result is the same and that the profile event is non-zero only with the guard on, and that an invalid ratio is rejected. It passed in the Praktika stateless job on a local aarch64 build.

Related: #2181

Changelog category (leave one):

  • Improvement

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

Add the experimental setting input_format_parquet_read_min_fill_ratio (off by default). The Parquet reader stops coalescing reads through gaps when the resulting read would be mostly unwanted data, which avoids reading neighbouring columns when only a small scattered column is requested.

Documentation entry for user-facing changes

The setting is documented by its DECLARE description in FormatFactorySettings.h.

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)

… guard

Read coalescing bridges gaps shorter than the seek threshold to save requests, but many sub-threshold gaps can accumulate into a task that is almost entirely filler: reading a tiny, scattered column drags in its neighbouring columns and amplifies a few KB of wanted data into hundreds of MB read.

Add `input_format_parquet_read_min_fill_ratio` (0 = off, range 0..1). During coalescing, `Prefetcher` stops extending a task once bridging the next gap would drop its wanted/span fraction below the ratio. Gaps below 64 KiB are always bridged, so dense reads are never split. New profile event `ParquetPrefetcherFillRatioLimitedTasks`.

Ported from the fill-ratio part of #2181

Related: #2181
Co-authored-by: Cursor <[email protected]>
@github-actions

Copy link
Copy Markdown

Workflow [PR], commit [533ebe8]

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants