Repository navigation
Add system.engine_settings - #123041
Add system.engine_settings#123041buggins wants to merge 37 commits into
system.engine_settings#123041Conversation
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]>
|
Workflow [PR], commit [66379fe] Summary: ❌
AI ReviewSummaryAdds Final Verdict✅ Approve |
Related: ClickHouse#59913 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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;
-- createdSo 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.
There was a problem hiding this comment.
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
DeltaLakeLocalCREATEwithSETTINGS iceberg_compaction_commit_batch_size = …(or any name that is both a data lake setting and a query setting), checking thatSHOW CREATE TABLEkeeps it.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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}, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Hello @Ergus !
This your finding is fixed as you suggested. Could you please resolve this thread?
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]>
|
Also fixed the style check failure (9e05b04, a double space in a column definition). Thanks for the review and for the |
…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]>
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]>
…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]>
|
@Ergus, a question about the contract of To keep
Proposal for this PR: list these settings again, with Planned follow-ups, each a small separate PR after this one:
Questions:
|
…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]>
…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]>
…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]>
|
performance check was failed at unrelated functionality. |
|
@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 Since then, following the bot reviews and an audit of every engine:
The follow-ups stay as listed in the question ( Your four comments are addressed; the two open threads have the tests you asked for ( |
…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]>
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]>
…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
`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]>
AI review of a later commit does not approve the PR, see the AI Review comment.
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 assystem.merge_tree_settingsplusengine_nameandinherited. Until now only theMergeTreefamily had such a table (system.s3_queue_settingsandsystem.azure_queue_settingsshow the settings of existing tables, not of the engine); forKafka,Memory,Distributedand the rest, the documentation was the only source.valueis 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, unlessinheritedis 1:MergeTreefamily and the replicated family, exactly the rows ofsystem.merge_tree_settingsandsystem.replicated_merge_tree_settings: the<merge_tree>/<replicated_merge_tree>config sections,compatibilityof the default profile, and the current user's constraints. The constraint handling moved fromdumpToSystemMergeTreeSettingsColumnsinto a function both tables use; their output is unchanged.Distributed,RemoteandRemoteSecure, the<distributed>config section, with thebackground_insert_*settings filled from the server'sdistributed_background_insert_*settings, as a new table fills them.changedis 1 for a setting the server configuration sets, that the engine itself sets (see below), or, for theMergeTreefamily, thatcompatibilitychanges; theDistributedfill-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 ofPostgreSQLandmysql_datatypes_support_levelofMySQLfrom the session creating it, theNATS/RabbitMQcredentials from the server configuration, the block size, poll and flush settings ofKafka,FileLog,NATSandRabbitMQfrom the server'smax_insert_block_size,max_block_size,stream_poll_timeout_msandstream_flush_interval_ms, the security and compression settings ofKafkafrom thekafkasection of the server configuration, andkeeper_pathofS3QueueandAzureQueuefrom the server'ss3queue_default_zookeeper_pathand the table. For these rowsvalueis the engine's own value, which such a table does not use;WHERE NOT inheritedleaves only the settings whosevaluea new table uses. So every engine with aSETTINGSclause and a settings class is listed, includingS3,AzureBlobStorage,HDFS,COSN,OSS,GCSandPostgreSQL, 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,Kafkausesinput_format_skip_unknown_fields= 1,input_format_allow_errors_ratio= 0 andinput_format_allow_errors_num=kafka_skip_broken_messages; the rows take these values fromcreateSettingsAdjustments, the function a table uses.Kafka,FileLog,NATSandRabbitMQalways disable the header detection of theCSV,TSVandCustomSeparatedformats, whatever a table states, soinput_format_csv_detect_header,input_format_tsv_detect_headerandinput_format_custom_detect_headershow0, withreadonly= 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_numormaterialized_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:ExecutablePoollowersmax_command_execution_timeto the server'smax_execution_timewhen that is smaller, andRabbitMQprefers thevhostof the server configuration torabbitmq_vhost.Settings that have no effect on a new table are not listed.
MaterializedPostgreSQLshares its settings class with the database engine of the same name: a table rejectsmaterialized_postgresql_use_extended_date_and_time_typesandmaterialized_postgresql_schema_list, and overwritesmaterialized_postgresql_tables_listwith its remote table. The data lake engines reject the deprecatedstorage_catalog_type,storage_catalog_urlandstorage_aws_access_key_id.SetandHiveaccept the format settings their settings classes declare, but never read them. These engines enumerate their settings withenumerateCompiledDefaultsExcept, 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:modeofS3QueueandAzureQueue, required since ClickHouse 24.6, whose defaultorderedapplies only toS3Queuetables created by earlier releases, and the broker, topic, group and format settings ofKafka,NATSandRabbitMQ.The issue also proposes turning
system.merge_tree_settingsinto a view over this table. That is left out, since it changes a table a lot of tooling reads; as theMergeTreerows already match it exactly (checked both ways by05293_engine_settings_match_merge_tree_settings), the view would be a plainWHERE engine_name = 'MergeTree'projection whenever it is wanted. The column definitions are those ofsystem.merge_tree_settings, copied verbatim, plusengine_nameandinherited(always 0 for theMergeTreerows); 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
MergeTreeengines the table shows the server's configuration, the same data assystem.merge_tree_settings, and forDistributed,RemoteandRemoteSecureit is the only system table showing the<distributed>section. So it should be granted likesystem.merge_tree_settings, not likesystem.table_engines; its documentation says so. No setting of these engines holds a secret.Not covered yet, planned as follow-ups (#123041 (comment)):
requiredcolumn, andreadonlyfor the engines other thanMergeTree(whetherALTER ... MODIFY SETTINGcan change the setting);File,URL,Joinand theLogfamily (Log,StripeLog,TinyLog), which accept aSETTINGSclause but have no settings class of their own;DatabaseDataLakeCatalogType::NONE, the default ofcatalog_type/storage_catalog_type, gets the namenone:system.engine_settingsrenders every setting of the data lake engines, includingstorage_catalog_type, before it leaves out the ones a new table cannot use, and rendering a default without a name throws. Writingcatalog_type = 'none'now fails with the same "Unspecified catalog type" as leaving it out.DeltaLakeLocalis now registered withDataLakeStorageSettings, the settings class its creator reads, asDeltaLake,DeltaLakeS3andDeltaLakeAzureare, instead ofStorageObjectStorageSettings. Sosystem.engine_settingslists its 37 data lake settings (disk,allow_dynamic_metadata_for_data_lakes, …). The registration also decides which names of aCREATEquery'sSETTINGSclause are query settings: forDeltaLakeLocal, a name that is both a data lake setting and a query setting now stays with the table, as forDeltaLake, instead of being applied to theCREATEquery. These are theiceberg_*compaction settings, whichDeltaLakeLocalignores, andallow_experimental_delta_kernel_rs, which is obsolete as a table setting; to disable the Delta kernel for the query, useallow_delta_kernel_rs.05318checks thatSHOW CREATE TABLEkeeps such a setting.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Added the
system.engine_settingssystem table, which lists the engine-specific settings of table engines such asKafka,S3Queue,MemoryandDistributed, with their values, defaults, descriptions and types. Theinheritedcolumn 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 theMergeTreefamily it shows the same server-level values and constraints assystem.merge_tree_settingsandsystem.replicated_merge_tree_settings.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/123041]