Skip to content

Add system.engine_settings - #123041

Open
buggins wants to merge 37 commits into
ClickHouse:masterfrom
buggins:system-engine-settings-59913
Open

buggins wants to merge 37 commits into
ClickHouse:masterfrom
buggins:system-engine-settings-59913

Conversation

@buggins

@buggins buggins commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Closes: #59913
Related: #113269

Adds system.engine_settings: the engine-specific settings of table engines, one row per engine and setting, with the same columns as system.merge_tree_settings plus engine_name and inherited. Until now only the MergeTree family had such a table (system.s3_queue_settings and system.azure_queue_settings show the settings of existing tables, not of the engine); for Kafka, Memory, Distributed and the rest, the documentation was the only source.

SELECT name, value, default, type FROM system.engine_settings WHERE engine_name = 'Memory';

value is the engine's own value: what a new table of the engine starts from on this server, before its definition is applied, whoever reads the table, unless inherited is 1:

  • For most engines, the compiled-in default.
  • For the MergeTree family and the replicated family, exactly the rows of system.merge_tree_settings and system.replicated_merge_tree_settings: the <merge_tree> / <replicated_merge_tree> config sections, compatibility of the default profile, and the current user's constraints. The constraint handling moved from dumpToSystemMergeTreeSettingsColumns into a function both tables use; their output is unchanged.
  • For Distributed, Remote and RemoteSecure, the <distributed> config section, with the background_insert_* settings filled from the server's distributed_background_insert_* settings, as a new table fills them.

changed is 1 for a setting the server configuration sets, that the engine itself sets (see below), or, for the MergeTree family, that compatibility changes; the Distributed fill-in does not set it.

Settings a table takes from elsewhere are listed with inherited = 1. Unless a definition states them, a table takes the format settings from the query or server settings, the connection pool settings of PostgreSQL and mysql_datatypes_support_level of MySQL from the session creating it, the NATS / RabbitMQ credentials from the server configuration, the block size, poll and flush settings of Kafka, FileLog, NATS and RabbitMQ from the server's max_insert_block_size, max_block_size, stream_poll_timeout_ms and stream_flush_interval_ms, the security and compression settings of Kafka from the kafka section of the server configuration, and keeper_path of S3Queue and AzureQueue from the server's s3queue_default_zookeeper_path and the table. For these rows value is the engine's own value, which such a table does not use; WHERE NOT inherited leaves only the settings whose value a new table uses. So every engine with a SETTINGS clause and a settings class is listed, including S3, AzureBlobStorage, HDFS, COSN, OSS, GCS and PostgreSQL, and the settings that control an engine can be found in one place. The table has about 15,400 rows for 59 engines, about 7,000 of them not inherited.

Settings the engine sets itself are listed with the engine's value and inherited = 0. When a table does not state them, Kafka uses input_format_skip_unknown_fields = 1, input_format_allow_errors_ratio = 0 and input_format_allow_errors_num = kafka_skip_broken_messages; the rows take these values from createSettingsAdjustments, the function a table uses. Kafka, FileLog, NATS and RabbitMQ always disable the header detection of the CSV, TSV and CustomSeparated formats, whatever a table states, so input_format_csv_detect_header, input_format_tsv_detect_header and input_format_custom_detect_header show 0, with readonly = 1.

A setting whose empty or default value makes the engine generate or detect one, such as kafka_client_id, kafka_aws_region, nats_queue_group, processing_threads_num or materialized_postgresql_replication_slot, is listed with the value the definition stores; the documentation says so. Two values are still not what a new table uses in every configuration, and the documentation names both: ExecutablePool lowers max_command_execution_time to the server's max_execution_time when that is smaller, and RabbitMQ prefers the vhost of the server configuration to rabbitmq_vhost.

Settings that have no effect on a new table are not listed. MaterializedPostgreSQL shares its settings class with the database engine of the same name: a table rejects materialized_postgresql_use_extended_date_and_time_types and materialized_postgresql_schema_list, and overwrites materialized_postgresql_tables_list with its remote table. The data lake engines reject the deprecated storage_catalog_type, storage_catalog_url and storage_aws_access_key_id. Set and Hive accept the format settings their settings classes declare, but never read them. These engines enumerate their settings with enumerateCompiledDefaultsExcept, which leaves them out. A setting a new table must state stays listed with its compiled-in default, and the documentation says that a new table cannot rely on it: mode of S3Queue and AzureQueue, required since ClickHouse 24.6, whose default ordered applies only to S3Queue tables created by earlier releases, and the broker, topic, group and format settings of Kafka, NATS and RabbitMQ.

The issue also proposes turning system.merge_tree_settings into a view over this table. That is left out, since it changes a table a lot of tooling reads; as the MergeTree rows already match it exactly (checked both ways by 05293_engine_settings_match_merge_tree_settings), the view would be a plain WHERE engine_name = 'MergeTree' projection whenever it is wanted. The column definitions are those of system.merge_tree_settings, copied verbatim, plus engine_name and inherited (always 0 for the MergeTree rows); sharing them is a small follow-up, or goes away with the view.

This builds on the original work by @kaijaytu in #113269, whose three commits are kept as they are, followed by a fix-up for current master and a refactoring that lets an engine describe its settings without knowing the system table's column layout.

Access. For the MergeTree engines the table shows the server's configuration, the same data as system.merge_tree_settings, and for Distributed, Remote and RemoteSecure it is the only system table showing the <distributed> section. So it should be granted like system.merge_tree_settings, not like system.table_engines; its documentation says so. No setting of these engines holds a secret.

Not covered yet, planned as follow-ups (#123041 (comment)):

  1. a required column, and readonly for the engines other than MergeTree (whether ALTER ... MODIFY SETTING can change the setting);
  2. File, URL, Join and the Log family (Log, StripeLog, TinyLog), which accept a SETTINGS clause but have no settings class of their own;
  3. the data lake engines listing only the settings of their table format.

DatabaseDataLakeCatalogType::NONE, the default of catalog_type / storage_catalog_type, gets the name none: system.engine_settings renders every setting of the data lake engines, including storage_catalog_type, before it leaves out the ones a new table cannot use, and rendering a default without a name throws. Writing catalog_type = 'none' now fails with the same "Unspecified catalog type" as leaving it out.

DeltaLakeLocal is now registered with DataLakeStorageSettings, the settings class its creator reads, as DeltaLake, DeltaLakeS3 and DeltaLakeAzure are, instead of StorageObjectStorageSettings. So system.engine_settings lists its 37 data lake settings (disk, allow_dynamic_metadata_for_data_lakes, …). The registration also decides which names of a CREATE query's SETTINGS clause are query settings: for DeltaLakeLocal, a name that is both a data lake setting and a query setting now stays with the table, as for DeltaLake, instead of being applied to the CREATE query. These are the iceberg_* compaction settings, which DeltaLakeLocal ignores, and allow_experimental_delta_kernel_rs, which is obsolete as a table setting; to disable the Delta kernel for the query, use allow_delta_kernel_rs. 05318 checks that SHOW CREATE TABLE keeps such a setting.

Changelog category (leave one):

  • New Feature

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

Added the system.engine_settings system table, which lists the engine-specific settings of table engines such as Kafka, S3Queue, Memory and Distributed, with their values, defaults, descriptions and types. The inherited column marks the settings a table takes from the query or server settings, the server configuration or the creating session when its definition does not state them. For the MergeTree family it shows the same server-level values and constraints as system.merge_tree_settings and system.replicated_merge_tree_settings.

🤖 Generated with Claude Code


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

kaijaytu and others added 10 commits September 29, 2026 22:19
Add a new system table that exposes settings for all table engines,
not just MergeTree. Introduces FillEngineSettingsFn in StorageFactory
and the StorageSystemEngineSettings class. Engines with no registered
fill function are skipped, so the table is empty until engines wire in.
Register fillEngineSettingsColumns for 18 engine settings classes
(MergeTree, Memory, Distributed, Kafka, RabbitMQ, NATS, MySQL,
PostgreSQL, RocksDB, ObjectStorage, etc.) so they appear in
system.engine_settings.
Basic stateless test verifying the table exists, has the engine_name
column, and returns settings for known engines.

Also wire DataLakeStorageSettings which was missed in the previous commit.
…aster

Master added a `show_secrets` argument to `getValueString` and
`getDefaultValueString`; pass `true`, as `system.merge_tree_settings` and
`system.server_settings` do - the flag matters only for custom settings,
which no engine settings struct has. `DatabaseDataLakeCatalogType::NONE`, the
default of the data lake engines' `storage_catalog_type`, had no name, so
reading `system.engine_settings` threw `Unexpected value of
DatabaseDataLakeCatalogType:0`; it is now `none`.

The test's reference had two lines that never matched a real run - the
`tier` enum type and a `Bool` default printed as `false` - and is now recorded
from one.

Not needed to pass the test: the column definitions are re-synced with
`system.merge_tree_settings`, whose `tier` description gained a
`PRIVATE PREVIEW` line after they were copied; they are now identical.

Related: ClickHouse#59913
Related: ClickHouse#113269

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
`fill_engine_settings_fn(MutableColumns &)` becomes `enumerate_engine_settings_fn`, which
returns `SettingDescriptions`; `system.engine_settings` writes its rows from them. Settings
structs no longer need to know the system table's column layout, and `fillData` no longer
fills temporary columns to copy them row by row.

Every settings struct gets `enumerateSettings`, defined with `IMPLEMENT_SETTINGS_ENUMERATION`,
and registers `enumerateCompiledDefaults<XSettings>`.

The output of `system.engine_settings` is unchanged: a full dump
(`ORDER BY engine_name, name`) and its column list are byte-identical to the previous
commit's.

Related: ClickHouse#59913
Related: ClickHouse#113269

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A new `MergeTree` table starts from the server's instance of `MergeTreeSettings`,
not from the compiled defaults: `compatibility` from the default profile and the
`<merge_tree>` config section are applied to it, and `<replicated_merge_tree>` on top
for the replicated engines. `system.engine_settings` now reports that instance for
every engine of the two families, with the current user's constraints and
`isReadonlySetting`, as `system.merge_tree_settings` and
`system.replicated_merge_tree_settings` do.

The constraint handling moves out of `dumpToSystemMergeTreeSettingsColumns` into
`MergeTreeSettings::enumerateSettingsWithConstraints`, which both tables now use.
The output of `system.merge_tree_settings` and `system.replicated_merge_tree_settings`
is unchanged (full dumps compared byte-for-byte).

`enumerate_engine_settings_fn` now takes the query context, and `SettingDescription`
gets the constraint fields (`min_value`, `max_value`, `disallowed_values`,
`readonly`); the other engines still report compiled defaults.

The new test checks that every engine of each family reports exactly the rows of the
matching table, both ways. In `04695`, `index_granularity` is now `readonly`.

Related: ClickHouse#59913
Related: ClickHouse#113269

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A new `Distributed`, `Remote` or `RemoteSecure` table starts from the server's
`DistributedSettings` (the `<distributed>` config section) and fills the
`background_insert_*` settings its definition leaves out from the global context's
`distributed_background_insert_*` settings. `system.engine_settings` now reports the
same for these engines, instead of the compiled defaults; a `SET` in the session does
not change the rows.

The fill-in moves from `finalizeDistributedSettings` into
`DistributedSettings::applyBackgroundInsertDefaults`, which both the engines' creators
and `DistributedSettings::enumerateEngineSettings` call; table creation is unchanged.

`default` stays the compiled default. `changed` is what a new table gets: the two
`Milliseconds` settings take the `changed` flag of the core setting along with its value,
so they show `changed = 0` with a value of 100 / 30000, while the other two show
`changed = 1`. The new test therefore checks each of the four as `changed` or different
from `default`.

Related: ClickHouse#59913
Related: ClickHouse#113269

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Replaces the one-line description with a `DOCS_MD` block like the other system tables
have: what `value` means for each group of engines (compiled defaults, the server-level
`MergeTree` instances, the `Distributed` fill-in), what the constraint columns mean,
examples, and links to the related tables.

It also says that for the `MergeTree` family and `Distributed`, `Remote` and
`RemoteSecure` the table shows the server's configuration, so `SELECT` on it should be
granted as on `system.merge_tree_settings`.

The page under `docs/reference/system-tables/` is generated from this by the
documentation pipeline.

Related: ClickHouse#59913
Related: ClickHouse#113269

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
`Hudi` was listed with all the data lake settings although it rejects a `SETTINGS`
clause (`supports_settings = false`). `YTsaurus` and `GenerateRandom` declare their
settings in settings classes but were not listed.

`04695` now checks that every listed engine accepts `SETTINGS`; it runs in fast test too,
as none of its queries needs an optional library. The documentation no longer claims to
cover every engine and names the ones not listed yet: `Join` and the `Log` family.

Related: ClickHouse#59913
Related: ClickHouse#113269

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The class comment of `StorageSystemEngineSettings` still said the table shows all
settings of all table engines, which is no longer true since `Join` and the `Log`
family are not listed. The comment on the constraint fields of `SettingDescription`
did not mention that `readonly` is also set by `MergeTreeSettings::isReadonlySetting`.

Related: ClickHouse#59913

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@clickhouse-gh clickhouse-gh Bot added the comp-system-table system.* tables (introspection, system metadata, performance visibility). label Sep 30, 2026
@clickhouse-gh clickhouse-gh Bot added the external Author is not a member of the ClickHouse organization label Oct 1, 2026
@buggins buggins mentioned this pull request Oct 1, 2026
@clickhouse-gh

clickhouse-gh Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [66379fe]

Summary: ❌

job_name test_name status info comment
Finish Workflow FAIL
python3 ./ci/jobs/scripts/workflow_hooks/can_be_merged.py --review-threads FAIL

AI Review

Summary

Adds system.engine_settings with engine-specific values, defaults, constraints and inheritance metadata. Review of head 66379fec89eec2d49e372e3229d73c620289dccb, including all prior discussion, found no actionable blockers or majors. Earlier concerns are addressed or covered by the documented contract and scope. Fast-test CI passes 04695_system_engine_settings, 05293_engine_settings_match_merge_tree_settings and 05294_engine_settings_distributed_background_insert_defaults. No local builds or tests were run.

Final Verdict

✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-feature Pull request with new product feature label Oct 1, 2026
buggins and others added 3 commits October 2, 2026 10:04
The `DeltaLakeLocal` creator reads its `SETTINGS` clause as `DataLakeStorageSettings` (`disk` picks the local disk),
but the engine was registered with `StorageObjectStorageSettings::hasBuiltin`, and `system.engine_settings` copied
that class. So the table listed 325 settings where `DeltaLake` lists 365: the 40 data lake settings, `disk`
included, were missing. It is now registered with `DataLakeStorageSettings` for both, as `DeltaLake`, `DeltaLakeS3`
and `DeltaLakeAzure` are. `04695` checks that `DeltaLakeLocal` and `DeltaLake` list the same settings.

The registration also decides which names of a `CREATE` query's `SETTINGS` clause are query settings. For
`DeltaLakeLocal`, a name that is both a data lake setting and a query setting now stays with the table, as for
`DeltaLake`, instead of being applied to the `CREATE` query. These are the `iceberg_*` compaction settings, which
`DeltaLakeLocal` ignores, and `allow_experimental_delta_kernel_rs`, which is obsolete as a table setting; to disable
the Delta kernel for the query, `allow_delta_kernel_rs` is still applied to it.

Related: ClickHouse#59913

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
.supports_schema_inference = true,
.source_access_type = AccessTypeObjects::Source::FILE,
.has_builtin_setting_fn = StorageObjectStorageSettings::hasBuiltin,
.has_builtin_setting_fn = DataLakeStorageSettings::hasBuiltin,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switching DeltaLakeLocal to DataLakeStorageSettings::hasBuiltin makes SETTINGS disk = ... work for the first time, and nothing tests it.

Before this change, checkStorageSettingNames rejected with UNKNOWN_SETTINGany name that was not in StorageObjectStorageSettings (or a query setting). So CREATE TABLE … ENGINE = DeltaLakeLocal(…) SETTINGS disk = '…' failed.

I'm not sure if it is a desired or intended behavior change, but the creator's disk branch was unreachable for a fresh CREATE. If intended, then maybe this can be added as a previous independent fix?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can see, SETTINGS disk = ... already worked for DeltaLakeLocal before this change: checkStorageSettingNames is called only by the S3, Azure and HDFS creators (lines 134, 759 and 804), not by DeltaLakeLocal. On the official master build 26.10.1.1568, without this PR:

CREATE TABLE t (a Int) ENGINE = DeltaLakeLocal('/path') SETTINGS disk = 'no_such_disk_xyz';
-- Code: 479. DB::Exception: Unknown disk no_such_disk_xyz. (UNKNOWN_DISK)
CREATE TABLE t (a Int) ENGINE = DeltaLakeLocal('/path') SETTINGS allow_dynamic_metadata_for_data_lakes = 1;
-- created

So the creator already read disk. What the switch does change is how CREATE sorts the clause's names (InterpreterSetQuery::applySettingsFromQuery): a name that is a data lake setting and also a query setting now stays with the table, as for DeltaLake, instead of being applied to the CREATE query. Those are the iceberg_* compaction settings, which DeltaLakeLocal ignores, and allow_experimental_delta_kernel_rs, which is obsolete as a table setting (allow_delta_kernel_rs still goes to the query). The PR description says so.

I changed the hasBuiltin line together with the listing so that system.engine_settings lists each engine with the same class it registers, as for every other engine; otherwise DeltaLakeLocal would list the data lake settings while hasBuiltin still knew only the object storage ones. If you prefer, I can move the hasBuiltin line into a separate PR, or add a test that a stated data lake setting stays in the DeltaLakeLocal definition.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh you are right ;) DeltaLakeLocal never calls checkStorageSettingNames, so disk already worked, and my comment was wrong ;p

Please:

  • Keep the change here.
  • Add the test you proposed: a DeltaLakeLocal CREATE with SETTINGS iceberg_compaction_commit_batch_size = … (or any name that is both a data lake setting and a query setting), checking that SHOW CREATE TABLE keeps it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Added 05318_deltalake_local_keeps_data_lake_settings in 05747ed: a DeltaLakeLocal table created with SETTINGS iceberg_compaction_commit_batch_size = 7, allow_dynamic_metadata_for_data_lakes = 1, checking that SHOW CREATE TABLE keeps both. On the master build the first one is missing from the definition.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @Ergus ! Your finding is resolved as you suggested. Could you please resolve this thread?

/// `none` is the default of `catalog_type` / `storage_catalog_type`. It needs a name of its own:
/// without one, rendering a setting that still holds the default - as `system.engine_settings`
/// does - throws `Unexpected value of DatabaseDataLakeCatalogType:0`.
{{"none", DatabaseDataLakeCatalogType::NONE},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

catalog_type = 'none' used to fail with an unknown-enum-value error and now fails later with Unspecified catalog type. If intended, we need a test for it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, intended: none needs a name so that system.engine_settings can show the default of storage_catalog_type. Added 05317_datalake_catalog_type_none in ada524f: it checks that system.engine_settings shows none as the value and default, and that catalog_type = 'none' fails exactly as leaving the setting out does (Unspecified catalog type, once warehouse is set). On the master build it fails with Unexpected value of DatabaseDataLakeCatalogType: 'none', so the test covers the change.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @Ergus !
This your finding is fixed as you suggested. Could you please resolve this thread?

@Ergus Ergus added the can be tested Allows running workflows for external contributors label Oct 5, 2026
buggins and others added 4 commits October 5, 2026 18:47
Two spaces after the comma in the `engine_name` column definition, not aligned with the lines below, fail the
`whitespace_check` of the style check.

https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=123041&sha=17a23d924391ce05bdd545ce0db7405ac31cab24&name_0=PR&name_1=Style%20check
Related: ClickHouse#123041
Related: ClickHouse#59913

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…figuration only

For `Distributed`, `Remote` and `RemoteSecure`, `system.engine_settings` reported `changed` of the instance after the
`background_insert_*` fill-in, so it showed how the fill-in assigns a value rather than whether anyone configured the
setting: `background_insert_batch` and `background_insert_split_batch_on_failure` were `changed = 1` on a server
that sets nothing, the two `Milliseconds` settings `0`. `changed` now comes from the instance the `distributed` section
of the server configuration loads, and only the values from the filled-in copy. `05294` checks that the values are the
server's `distributed_background_insert_*` settings and `changed` is `0`; the documentation example is updated.

Related: ClickHouse#123041
Related: ClickHouse#59913

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The documentation named only `Join` and the `Log` family. `File` and `URL` also accept a `SETTINGS` clause without a
settings class of their own, so they are not listed either; `StripeLog` and `TinyLog` are named with `Log`.

Related: ClickHouse#123041
Related: ClickHouse#59913

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
`DatabaseDataLakeCatalogType::NONE` got the name `none` so that `system.engine_settings` can show the default of
`storage_catalog_type`. As a result `catalog_type = 'none'` is no longer rejected as an unknown value: it behaves as
leaving the setting out, failing with `Unspecified catalog type`. `05317` checks both.

Related: ClickHouse#123041
Related: ClickHouse#59913

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@buggins

buggins commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

Also fixed the style check failure (9e05b04, a double space in a column definition). Thanks for the review and for the can be tested label.

buggins and others added 2 commits October 8, 2026 10:08
…uery setting

`DeltaLakeLocal` is registered with `DataLakeStorageSettings` since 17a23d9, so `CREATE` keeps a name that is
both a data lake setting and a query setting with the table, as for the other `DeltaLake` engines, instead of applying
it to the query and dropping it from the definition. `05318` creates a table with
`SETTINGS iceberg_compaction_commit_batch_size = 7` and checks that `SHOW CREATE TABLE` keeps it; on master the setting
is missing from the definition.

Related: ClickHouse#123041
Related: ClickHouse#59913

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… elsewhere

Some settings have no value of their own for a new table: unless the definition states them, a table takes them from
the query or server settings, or from the server configuration. `system.engine_settings` listed them with the
compiled default, which a table does not necessarily use:
- the format settings, which every engine accepting them takes from the query settings of the session creating the
  table (`S3` and the other object storage and data lake engines), of the server (`S3Queue`, `AzureQueue`, `FileLog`),
  or of the context reading it (`Kafka`, `NATS`, `RabbitMQ`, `Hive`); `Set` does not use them;
- the connection pool settings of `PostgreSQL` and `mysql_datatypes_support_level` of `MySQL`, from the session
  creating the table;
- the credentials of `NATS` and `RabbitMQ`, from the server configuration.

They are left out now: `StorageFactory::isInheritedSetting` treats every format setting so (`isFormatFactorySetting`)
and asks the engine about the others (`is_inherited_setting_fn`). `S3`, `AzureBlobStorage`, `HDFS`, `COSN`, `OSS`,
`GCS` and `PostgreSQL` have no other settings and are no longer listed, like `File` and `URL`; the table goes from
about 15,900 rows to about 6,800. The documentation states what `value` and `changed` mean and names the two values
that are still not what a new table uses in every configuration (`ExecutablePool`'s cap by `max_execution_time` and
`RabbitMQ`'s `vhost` from the server configuration). `04695` checks that no such setting is listed.

Related: ClickHouse#123041
Related: ClickHouse#59913

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
buggins added a commit to buggins/ClickHouse that referenced this pull request Oct 9, 2026
Brings in the merge of master. The conflict in `src/Parsers/ASTSetQuery.cpp` is resolved by taking master's version:
master moved the secret engine settings into each engine's `SecretArgumentsSpec` and exposes
`renderSecretChangeValue`, so this branch's own extraction of the list into `src/Parsers/engineSettingsToHide.h` is
dropped. `system.table_settings` now asks `renderSecretChangeValue` how a value is shown in `SHOW CREATE TABLE`, and
shows `[HIDDEN]` when that differs from the plain value: some rules (`nats_url`, `rabbitmq_address`, the connection
string of the queue engines) render a value without a secret unchanged. A value equal to the default is still shown
as it is; a value only a part of which is secret is hidden as a whole, which the documentation now says. `05296`
gains a connection string with and without a key.

Related: ClickHouse#116543
Related: ClickHouse#123041

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
`MaterializedPostgreSQL` shares its settings class with the database engine of the same name, and a table rejects
`materialized_postgresql_use_extended_date_and_time_types` and `materialized_postgresql_schema_list` and overwrites
`materialized_postgresql_tables_list`. The data lake engines reject the deprecated `storage_catalog_type`,
`storage_catalog_url` and `storage_aws_access_key_id`. Listing them advertised settings no table of the engine can
use. These engines now enumerate their settings with `enumerateCompiledDefaultsExcept`, which leaves them out, so
they are not settings of the engine for any consumer of `enumerate_engine_settings_fn`.

Settings a new table must state - `mode` of `S3Queue` and `AzureQueue`, the broker, topic, group and format settings
of `Kafka`, `NATS` and `RabbitMQ` - stay listed with their compiled-in default, and the documentation now says a new
table cannot rely on it: `mode = 'ordered'` is still what an `S3Queue` table created before 24.6, when `mode` became
required, loads with.

The settings are left out after they are rendered, so `storage_catalog_type` still needs the name `none` for its
default. `05317` no longer reads it from `system.engine_settings`.

Related: ClickHouse#123041
Related: ClickHouse#59913

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Comment thread src/Storages/StorageExecutable.cpp Resolved
buggins and others added 2 commits October 9, 2026 20:53
…ccepts but does not use

A setting is left out when a new table of the engine cannot use it because the table rejects it or overwrites it, as
the documentation says. The comment on `enumerateCompiledDefaultsExcept` said "fails or has no effect", which also
reads as "the engine ignores it"; it now matches the documentation. A setting the engine accepts and ignores stays
listed, since a table can state it, as `system.merge_tree_settings` lists the replicated-only settings for `MergeTree`.
The documentation now says so, and names the engines that share a settings class: `Executable` and `ExecutablePool`
(`pool_size` and `max_command_execution_time` only with a pool, `check_exit_code` only without one), and the data lake
engines (the `iceberg_*` and compaction settings only for `Iceberg`, the `paimon_*` ones only for `Paimon`, and
`object_storage_endpoint` and the `storage_*` catalog settings that are not deprecated for none of them).

Related: ClickHouse#123041
Related: ClickHouse#59913

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… settings an engine does not use

`b340f48eccc` said that the compaction settings of `DataLakeStorageSettings` are used only by the `Iceberg` engines.
No data lake table reads them: `IcebergMetadata` reads the query-level settings of the same names, and only
`allow_experimental_iceberg_compaction` is read from the table, for the tables of a `DataLakeCatalog` database. Several
of them also start with `iceberg_`, so "the `iceberg_*` settings" overclaimed too. The documentation now names only
what holds: the data lake engines list the settings of every table format, such as the `paimon_*` settings, which only
the `Paimon` engines use, and settings that none of them reads, such as `object_storage_endpoint` and the `storage_*`
catalog settings that are not deprecated.

It also said that engines sharing a settings class list all of its settings, and the comment on
`enumerateCompiledDefaultsExcept` that an engine lists every setting it accepts. Neither holds for the settings a
table takes from elsewhere, nor for `Set`, which leaves out the format settings of its class. Both now say only that a
setting the engine accepts but does not use is not left out for that reason. So does the paragraph that `b340f48eccc`
added, whose first sentence, like that commit's title, said such a setting is always listed: `Set` does not list the
format settings it accepts but does not use, since they are left out for another reason.

Related: ClickHouse#123041
Related: ClickHouse#59913

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Comment thread src/Storages/StorageFactory.cpp Resolved
@buggins

buggins commented Oct 13, 2026

Copy link
Copy Markdown
Contributor Author

@Ergus, a question about the contract of value before I change it, cc @nikitamikhaylov since it touches the shape asked for in #59913.

To keep value = "what a new table gets", the PR now leaves out every setting that a table takes from elsewhere when its definition does not state it: from the session, the server settings or the server configuration. That turned out to hurt the main use case of #59913, finding an engine's tunable settings in a system table:

  • 9,100 format-setting rows and 31 engine settings are gone, among them kafka_max_block_size, kafka_poll_timeout_ms, kafka_flush_interval_ms, kafka_security_protocol and all PostgreSQL pool settings;
  • 7 engines that accept a SETTINGS clause disappear completely: S3, AzureBlobStorage, GCS, COSN, OSS, HDFS and PostgreSQL.

Proposal for this PR: list these settings again, with value meaning the engine's own value (the compiled default, or the server-level instance for MergeTree and Distributed), plus one more column, inherited UInt8: 1 if a table that does not state the setting takes it from the session, the server settings or the server configuration. Settings a table rejects stay hidden. Settings the engine always overrides (materialized_postgresql_tables_list, and the format settings Kafka, NATS and RabbitMQ force, such as input_format_skip_unknown_fields) are hidden for now; they come back in follow-up 1 with their forced value and readonly = 1, except materialized_postgresql_tables_list, whose value is per table. The MergeTree rows stay equal to system.merge_tree_settings, so the view from #59913 remains a projection. It also gives system.table_settings (#124001) a simple rule: for a table, it has exactly the rows system.engine_settings has for its engine, and the table's definition only changes their values (today a stated inherited setting adds a row there). The code change is small: the existing per-engine predicates set the flag instead of filtering.

Planned follow-ups, each a small separate PR after this one:

  1. required (the CREATE fails without the setting, e.g. kafka_broker_list, mode of S3Queue), and readonly for engines other than MergeTree: 1 if ALTER ... MODIFY SETTING cannot change the setting, as system.merge_tree_settings already reports for index_granularity. Today it is 0 for every non-MergeTree row, even for Kafka, which supports no setting changes at all. The settings an engine always overrides come back here, with their forced value and readonly = 1.
  2. The engines that accept settings without a settings class: Join, Log, StripeLog, TinyLog, File, URL.
  3. The data lake engines list only the settings of their family (iceberg_* for Iceberg, and so on) instead of all 40.

Questions:

  1. Is one more column (inherited) acceptable, given that Implement system.engine_settings #59913 asked for "the same structure plus engine_name"? If not, I would list the settings anyway and say where the value comes from in description.
  2. Does this split into follow-ups work for you, or would you rather have some of it in this PR?

buggins and others added 2 commits October 16, 2026 09:25
…tings-59913

Conflict in `TimeSeriesSettings.cpp`: master moved `TimeSeriesVersion.h` (now included via
`checkTimeSeriesVersion.h`) and added methods next to `IMPLEMENT_SETTINGS_ENUMERATION`; both sides kept.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ings`

`system.engine_settings` left out every setting that a table takes from the
query or server settings, the server configuration or the creating session when
its definition does not state it. That hid the format settings, 31 engine
settings such as `kafka_max_block_size` and the `PostgreSQL` pool settings, and
whole engines (`S3`, `AzureBlobStorage`, `HDFS`, `COSN`, `OSS`, `GCS`,
`PostgreSQL`), although their settings control the engine.

They are listed again, with a new column `inherited` = 1; `value` is the
engine's own value. The format settings an engine sets itself are listed with
the engine's value and `inherited` = 0: `Kafka`'s defaults for
`input_format_skip_unknown_fields`, `input_format_allow_errors_ratio` and
`input_format_allow_errors_num` (from `createSettingsAdjustments`), and the
header detection that `Kafka`, `FileLog`, `NATS` and `RabbitMQ` always disable,
shown as `0` with `readonly` = 1. Only settings without effect stay hidden:
those a table rejects, and the format settings that `Set` and `Hive` accept but
never read. The `MergeTree` rows are unchanged, with `inherited` = 0.

Also: `PostgreSQLSettings::isLoadedFromQueryContext` is `hasBuiltin`, since every
setting of the class is a pool setting.

Related: ClickHouse#59913
Related: ClickHouse#123041 (comment)

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Comment thread src/Storages/FileLog/StorageFileLog.cpp Resolved
buggins and others added 2 commits October 16, 2026 16:34
…tings-59913

Takes c14207b, which fixes the build of `gtest_functions_stress.cpp` that broke `Build (arm_tidy, 3/4)`
of the previous run.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…usable `YTsaurus` and `FileLog` rows

`system.engine_settings`:
- `NATS` and `RabbitMQ`, as `Kafka`, set `input_format_skip_unknown_fields`, `input_format_allow_errors_ratio` and
  `input_format_allow_errors_num` themselves when a table does not state them (`addSettings`); these rows now show the
  values the engine uses, with `inherited` = 0.
- `YTsaurus` no longer lists `lookup_throttler_max_requests_per_second` and `lookup_max_rows_per_query`, which only the
  YTsaurus dictionary sources take and the table engine rejects (`YTsaurusSettings::isDictionaryOnlySetting`).
- `FileLog` no longer lists the format settings it never applies, except the header detection it always disables.

Related: ClickHouse#59913
Related: ClickHouse#124738

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
buggins and others added 2 commits October 17, 2026 09:29
…n `system.engine_settings`

- `S3Queue` and `AzureQueue`: `min_insert_block_size_rows_for_materialized_views` and
  `min_insert_block_size_bytes_for_materialized_views`, since `streamToViews` overrides the query settings of the same
  names only for a nonzero table value. The predicate moves out of `#if USE_AWS_S3`, as `AzureQueue` uses it too.
- `ExecutablePool`: `max_command_execution_time`, which a table that does not state it caps by the creating session's
  `max_execution_time`. `Executable` does not, so it gets no predicate.
- `RabbitMQ`: `rabbitmq_vhost`, which the `rabbitmq.vhost` of the server configuration replaces.
- The `Iceberg` engines: the ten compaction settings whose descriptions say they fall back to the query-level setting
  of the same name when not stated. The code that reads them is not in the open-source tree, so this follows their
  documented contract.

The documentation lists the inherited settings as a list, one engine group per line.

Related: ClickHouse#59913

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@buggins

buggins commented Oct 18, 2026

Copy link
Copy Markdown
Contributor Author

performance check was failed at unrelated functionality.

@buggins

buggins commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

@Ergus, the PR is ready for review.

It implements the proposal from my question above (#123041 (comment)): settings that a table takes from elsewhere unless its definition states them are listed again, with the new column inherited = 1, and value is the engine's own value. WHERE NOT inherited leaves the settings whose value a new table uses, and the MergeTree rows still match system.merge_tree_settings. If you would rather not have the extra column, the fallback is small: list the settings and say where the value comes from in description.

Since then, following the bot reviews and an audit of every engine:

  • The settings an engine sets itself are shown with the value it uses (inherited = 0): the header detection that Kafka, FileLog, NATS and RabbitMQ disable (readonly = 1), and the error-handling format settings of Kafka, NATS and RabbitMQ.
  • Settings without effect on a new table are not listed: the dictionary-only settings of YTsaurus, and the format settings Set, Hive and FileLog never read.
  • More settings are marked inherited: the materialized-view block sizes of S3Queue/AzureQueue, max_command_execution_time of ExecutablePool, rabbitmq_vhost, and the compaction settings of the Iceberg engines.

The follow-ups stay as listed in the question (required and readonly for non-MergeTree engines, the engines without a settings class, per-family data lake settings), each a small separate PR. system.table_settings (#124001) builds on this one.

Your four comments are addressed; the two open threads have the tests you asked for (05318_deltalake_local_keeps_data_lake_settings, 05317_datalake_catalog_type_none).

…tings-59913

Conflicts resolved: `StorageFactory::StorageFeatures` keeps `enumerate_engine_settings_fn` and `is_inherited_setting_fn`
before master's `get_export_access_fn`; `S3Queue` and `AzureQueue` set all three; `DataLakeStorageSettings` and
`PostgreSQLSettings` keep both sides' declarations, and `isLoadedFromQueryContext` follows master's
`loadFromQueryContext`.

Master's new `Elasticsearch` engine enumerates its settings in `system.engine_settings`. Master renamed
`allow_experimental_cleanup_old_data_files_compaction` to `enable_cleanup_old_data_files_compaction`, keeping the
old name as an alias, so the Iceberg settings taken from the query and `05404_engine_settings_inherited` use the
new name.

Related: ClickHouse#59913
Related: ClickHouse#123041

Co-Authored-By: Claude Opus 5.5 <[email protected]>
buggins added a commit to buggins/ClickHouse that referenced this pull request Nov 6, 2026
Brings in master at `3e3cf06186a` through ClickHouse#123041. Conflicts resolved: `StorageFactory::StorageFeatures` keeps
`settings_from_engine_arguments_fn` of this branch and `get_export_access_fn` of master, in that order;
`DataLakeStorageSettings` keeps `enumerateSettings(const SettingsChanges &)` of this branch and `resolveName` of
master. Master's new `Elasticsearch` engine declares `enumerateSettings` with the changes to apply, as the other
settings classes do here.

Related: ClickHouse#116543
Related: ClickHouse#124001
Related: ClickHouse#123041

Co-Authored-By: Claude Opus 5.5 <[email protected]>
buggins and others added 3 commits November 15, 2026 10:28
…tings-59913

# Conflicts:
#	src/Storages/MergeTree/registerStorageMergeTree.cpp
#	src/Storages/RocksDB/StorageEmbeddedRocksDB.cpp
#	src/Storages/StorageMemory.cpp
#	src/Storages/StorageSet.cpp
Master moved the disk settings code of `MergeTreeSettings.cpp` to `MergeTreeSettingsDisks.cpp` together with the include of
`Interpreters/Context.h`, which `MergeTreeSettings::enumerateEngineSettings` and
`MergeTreeSettings::enumerateReplicatedEngineSettings` still use.

Related: ClickHouse#59913

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…tings-59913

# Conflicts:
#	src/Storages/StorageFactory.h
clickhouse-gh[bot]
clickhouse-gh Bot previously approved these changes Nov 17, 2026
`modernize-use-nodiscard` of clang-tidy is enabled on master since 2026-11-15, and the new `enumerateSettings` and
`enumerateSettingsWithConstraints` const methods of the engine settings failed the tidy build without the attribute.

https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=123041&sha=cd63e43cc1f37c1d7ee95901c404cc54aace9c1b&name_0=PR&name_1=Build%20%28arm_tidy%2C%201%2F4%29
Related: ClickHouse#123041
Related: ClickHouse#126158

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@clickhouse-gh
clickhouse-gh Bot dismissed their stale review November 17, 2026 23:36

AI review of a later commit does not approve the PR, see the AI Review comment.

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

can be tested Allows running workflows for external contributors comp-system-table system.* tables (introspection, system metadata, performance visibility). external Author is not a member of the ClickHouse organization pr-feature Pull request with new product feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement system.engine_settings

3 participants