Skip to content

Antalya 26.8, backport of #124883: read a 64 KiB Parquet footer tail for local files - #2949

Draft
ianton-ru wants to merge 3 commits into
antalya-26.8from
backport/antalya-26.8/124883
Draft

ianton-ru wants to merge 3 commits into
antalya-26.8from
backport/antalya-26.8/124883

Conversation

@ianton-ru

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

Copy link
Copy Markdown

Backport of ClickHouse#124883 to antalya-26.8. It is a prerequisite for the Parquet footer-size hint and the reuse of the footer tail, which are split out of #2181 into a separate pull request that goes on top of this one.

antalya-26.8 already reads a footer tail sized to the file (1%, clamped to [128 KiB, 2 MiB]), from the backport of ClickHouse#115686. That saves a round trip on object storage. For a local file a second read is cheap, and the larger tail only costs bytes on every open.

With this change Prefetcher records ReadBufferFromFileBase::isRegularLocalFile, and Reader::readFileMetaData reads a 64 KiB tail when input_format_parquet_footer_read_size is 0 and the file is a regular local file. Object storage, URL and HDFS reads, and an explicit non-zero setting, are unchanged. Upstream measured SELECT count() over 100 ClickBench Parquet files at 6.55 MB of footer tails instead of 140.7 MB.

It is a cherry-pick of two commits of that pull request: 5a58f229ecb0 (the change and the test) and 6fbb4e7e880b (the precise wording of the setting description and of the history reason). Compared with upstream, the history row of input_format_parquet_footer_read_size is in SettingsChangesHistory.cpp on 26.8 instead of inline in FormatFactorySettings.h, so the reason text is changed there, and the test is the 26.8 05385_parquet_footer_read_size instead of 05025_....

Tests: 05385_parquet_footer_read_size now checks that a default read of a local file reads the same number of bytes (65536) as an explicit input_format_parquet_footer_read_size = 65536. It fails on the base binary (131072 for the default) and passes with the change. All 204 stateless tests with parquet in the name pass, as do 03999_stateless_settings_history, 02326_settings_changes_system_table and 04652_system_documentation_settings_history after the second commit. This was run in the Praktika functional job on a local aarch64 build; PR CI has not run yet.

Related: ClickHouse#124883
Related: #2181

Changelog category (leave one):

  • Performance Improvement

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

Reading Parquet files from the local filesystem fetches a 64 KiB footer tail by default instead of a tail sized to the file, which cuts the bytes read when opening many files.

Documentation entry for user-facing changes

The description of input_format_parquet_footer_read_size now states the default for local files.

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)

The adaptive footer read (`clamp(file_size / 100, 128 KiB, 2 MiB)`, backported from 115686) saves a round trip on object storage, but for a local file a second read is cheap and the larger tail only costs bytes on every open. `Prefetcher` now records `ReadBufferFromFileBase::isRegularLocalFile`, and `Reader::readFileMetaData` reads 64 KiB when `input_format_parquet_footer_read_size` is 0 and the file is a regular local file. Other sources and an explicit non-zero setting are unchanged.

Cherry-picked from 5a58f22; the setting description and the test follow the 26.8 layout (`05385_parquet_footer_read_size`).

ClickHouse#124883
Related: ClickHouse#124673
Related: #2181
@ianton-ru
ianton-ru marked this pull request as draft November 23, 2026 16:06
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Workflow [PR], commit [b5cd583]

@ianton-ru ianton-ru changed the title Backport: read a 64 KiB Parquet footer tail for local files Antalya 26.8, backport of #124883: read a 64 KiB Parquet footer tail for local files Nov 23, 2026
…m master.

The setting description of `input_format_parquet_footer_read_size` now says the 64 KiB tail applies when the file is read directly from the local filesystem (the reader's buffer reports `isRegularLocalFile`). Reads through a file descriptor or a wrapping buffer keep the adaptive size. The `SettingsChangesHistory` reason no longer says that `0` keeps the adaptive behavior.

Cherry-picked from 6fbb4e7; on 26.8 the history reason is in `SettingsChangesHistory.cpp`, so it is changed there.

ClickHouse#124883
Related: #2181

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.

3 participants