Skip to content

Take the format settings of object storage tables from the server, not the creating session - #126987

Merged
PedroTadim merged 1 commit into
ClickHouse:masterfrom
buggins:fix-object-storage-format-settings-126789
Oct 22, 2026
Merged

PedroTadim merged 1 commit into
ClickHouse:masterfrom
buggins:fix-object-storage-format-settings-126789

Conversation

@buggins

@buggins buggins commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Closes: #126789

An object storage table took its format settings from the session that created it, plus its SETTINGS clause. The definition does not keep the session's settings, so after the table was loaded again (ATTACH, server startup) it read, wrote and inferred its structure with the server's settings instead: a table created after SET format_csv_delimiter = ';' read its ;-separated file until the next restart and failed to parse it after.

As discussed in the issue, the format settings now always come from the server's settings plus the SETTINGS clause, as for File and URL. The change is in createStorageObjectStorage, so it covers every engine created there: S3, AzureBlobStorage, HDFS, GCS, COSN, OSS and the data lake engines. S3Queue and AzureQueue already used the server's settings.

The test checks S3 (MinIO) and AzureBlobStorage (Azurite): a session setting does not apply, even in the creating session, and a setting in the SETTINGS clause applies before and after DETACH / ATTACH.

Changelog category (leave one):

  • Backward Incompatible Change

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

Tables with the S3, AzureBlobStorage, HDFS and data lake engines take format settings (e.g. format_csv_delimiter) from the server's settings and the table's SETTINGS clause, as File and URL do, and no longer from the session that creates them. Before, the session's values applied only until the table was loaded again, e.g. on server restart. To keep a format setting, state it in the table's SETTINGS clause.

🤖 Generated with Claude Code


Workflow [PR]
Sync PR [sync-upstream/pr/126987]

Version info

  • Merged into: 26.11.1.518-master (included in 26.11 and later)

…t the creating session

`createStorageObjectStorage` built a table's format settings from the session that created it, plus the `SETTINGS`
clause. The definition does not keep the session's settings, so once the table was loaded again (`ATTACH`, server
startup) it read, wrote and inferred its structure with the server's settings instead. Now the format settings always
come from the server's settings plus the `SETTINGS` clause, as for `File` and `URL`. This covers every engine created
there: `S3`, `AzureBlobStorage`, `HDFS`, `GCS`, `COSN`, `OSS` and the data lake engines.

Related: ClickHouse#126789

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@clickhouse-gh clickhouse-gh Bot added comp-object-storage Object storage connectivity (S3/GCS/Azure) including credentials, retries, multipart, etc. external Author is not a member of the ClickHouse organization labels Oct 20, 2026
@buggins

buggins commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

@PedroTadim, this is the fix for #126789 that you assigned to me, done as you suggested: the format settings come from the global context plus the table's SETTINGS clause, as for File and URL, and the test covers both S3 and AzureBlobStorage. The CI workflow is waiting for approval; could you approve it, or add can be tested?

@PedroTadim PedroTadim added the can be tested Allows running workflows for external contributors label Oct 21, 2026
@clickhouse-gh

clickhouse-gh Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [ba5306b]

Summary: ✅


AI Review

Summary

PR #126987, reviewed at ba5306bc1682ed2a98996649020693b460bd0a3e, takes object storage tables' format settings from the global context plus the table's SETTINGS clause, preventing the creating session from changing behavior until the next attachment. The change matches the agreed resolution of issue #126789. The added stateless test covers session-setting isolation and explicit table settings before and after DETACH / ATTACH for S3 and AzureBlobStorage. No actionable findings.

Missing context / blind spots
  • ⚠️ The new stateless test has not been run locally because this checkout has no ClickHouse binary or build directory. The relevant CI test jobs were pending when reviewed; a passing run of 05427_object_storage_table_format_settings_from_server would confirm execution of the supplied regression coverage.
Final Verdict

Status: ✅ Approve. No code changes requested; regression-test execution remains pending in CI.

@clickhouse-gh clickhouse-gh Bot added the pr-backward-incompatible Pull request with backwards incompatible changes label Oct 21, 2026
@PedroTadim PedroTadim self-assigned this Oct 21, 2026
@PedroTadim
PedroTadim added this pull request to the merge queue Oct 22, 2026
Merged via the queue into ClickHouse:master with commit 41d5f34 Oct 22, 2026
179 checks passed
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 22, 2026
yariks5s pushed a commit to ylw510/ClickHouse that referenced this pull request Oct 23, 2026
…the `SETTINGS` clause

Object storage tables take their format settings from the server and their
`SETTINGS` clause, not from the session that creates them, so
`--output_format_parquet_row_group_size` given to the creating client no
longer applies and the files are written with a single row group. This made
`05339_iceberg_top_k_query_condition_cache` fail on master after
ClickHouse#126987, which was reverted in
ClickHouse#127378.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
clickhouse-gh Bot pushed a commit that referenced this pull request Oct 23, 2026
Edited by the nightly changelog CI job following .claude/skills/edit-changelog/SKILL.md.

Changelog-revert: 125569 116724 Revert "Verify the server certificate hostname on outbound TLS connections"
Changelog-revert: 125763 120058 Revert "Filter `PartsSplitter` layers on the key columns the sorting expression computed"
Changelog-revert: 125827 125763 Revert "Revert "Filter `PartsSplitter` layers on the key columns the sorting expression computed""
Changelog-revert: 126138 125569 Revert "Revert "Verify the server certificate hostname on outbound TLS connections""
Changelog-revert: 126955 126145 Revert "Apply primary key pruning before read-time skip indexes on parallel replicas followers"
Changelog-revert: 127378 126987 Revert "Take the format settings of object storage tables from the server, not the creating session"
Changelog-deleted-entry: 126145 [Performance Improvement] [section] * With parallel replicas and `use_skip_indexes_on_data_read` (the default), follower replicas now evaluate skip indexes only over the primary key ranges of each part instead of the whole part, so they read about as much skip index data as the initiator. Closes [#124628](#124628). [#126145](#126145) ([Groene AI](https://github.com/groeneai)).
Changelog-deleted-entry: 126987 [Backward Incompatible Change] [raw] * Tables with the `S3`, `AzureBlobStorage`, `HDFS` and data lake engines take format settings (e.g. `format_csv_delimiter`) from the server's settings and the table's `SETTINGS` clause, as `File` and `URL` do, and no longer from the session that creates them. Before, the session's values applied only until the table was loaded again, e.g. on server restart. To keep a format setting, state it in the table's `SETTINGS` clause. [#126987](#126987) ([Vadim Lopatin](https://github.com/buggins)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-object-storage Object storage connectivity (S3/GCS/Azure) including credentials, retries, multipart, etc. external Author is not a member of the ClickHouse organization pr-backward-incompatible Pull request with backwards incompatible changes pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

An S3 table reads with the format settings of the session that created it until a restart, then with the server's

3 participants