diff --git a/dbms/src/Core/SettingsCollection.h b/dbms/src/Core/SettingsCollection.h index 466b80b1fd3..da21412b7c1 100644 --- a/dbms/src/Core/SettingsCollection.h +++ b/dbms/src/Core/SettingsCollection.h @@ -345,6 +345,7 @@ private: StringRef name; StringRef description; + StringRef type; bool is_important; IsChangedFunction is_changed; GetStringFunction get_string; @@ -391,6 +392,7 @@ public: const_reference(const const_reference & src) = default; const StringRef & getName() const { return member->name; } const StringRef & getDescription() const { return member->description; } + const StringRef & getType() const { return member->type; } bool isChanged() const { return member->is_changed(*collection); } Field getValue() const; String getValueAsString() const { return member->get_string(*collection); } diff --git a/dbms/src/Core/SettingsCollectionImpl.h b/dbms/src/Core/SettingsCollectionImpl.h index a97de0f48af..d5716c2a80d 100644 --- a/dbms/src/Core/SettingsCollectionImpl.h +++ b/dbms/src/Core/SettingsCollectionImpl.h @@ -323,7 +323,9 @@ void SettingsCollection::deserialize(ReadBuffer & buf, SettingsBinaryFo #define IMPLEMENT_SETTINGS_COLLECTION_ADD_MEMBER_INFO_HELPER_(TYPE, NAME, DEFAULT, DESCRIPTION, FLAGS) \ - add({StringRef(#NAME, strlen(#NAME)), StringRef(DESCRIPTION, strlen(DESCRIPTION)), \ + add({StringRef(#NAME, strlen(#NAME)), \ + StringRef(DESCRIPTION, strlen(DESCRIPTION)), \ + StringRef(#TYPE, strlen(#TYPE)), \ FLAGS & IMPORTANT, \ [](const Derived & d) { return d.NAME.changed; }, \ &Functions::NAME##_getString, &Functions::NAME##_getField, \ diff --git a/dbms/src/Storages/System/StorageSystemMergeTreeSettings.cpp b/dbms/src/Storages/System/StorageSystemMergeTreeSettings.cpp index bb0918454ef..9d32ec74d51 100644 --- a/dbms/src/Storages/System/StorageSystemMergeTreeSettings.cpp +++ b/dbms/src/Storages/System/StorageSystemMergeTreeSettings.cpp @@ -14,6 +14,7 @@ NamesAndTypesList SystemMergeTreeSettings::getNamesAndTypes() {"value", std::make_shared()}, {"changed", std::make_shared()}, {"description", std::make_shared()}, + {"type", std::make_shared()}, }; } @@ -25,6 +26,7 @@ void SystemMergeTreeSettings::fillData(MutableColumns & res_columns, const Conte res_columns[1]->insert(setting.getValueAsString()); res_columns[2]->insert(setting.isChanged()); res_columns[3]->insert(setting.getDescription().toString()); + res_columns[4]->insert(setting.getType().toString()); } } diff --git a/dbms/src/Storages/System/StorageSystemSettings.cpp b/dbms/src/Storages/System/StorageSystemSettings.cpp index 0be7618922d..f0a3e47defb 100644 --- a/dbms/src/Storages/System/StorageSystemSettings.cpp +++ b/dbms/src/Storages/System/StorageSystemSettings.cpp @@ -17,7 +17,8 @@ NamesAndTypesList StorageSystemSettings::getNamesAndTypes() {"description", std::make_shared()}, {"min", std::make_shared(std::make_shared())}, {"max", std::make_shared(std::make_shared())}, - {"readonly", std::make_shared()} + {"readonly", std::make_shared()}, + {"type", std::make_shared()}, }; } @@ -59,6 +60,7 @@ void StorageSystemSettings::fillData(MutableColumns & res_columns, const Context res_columns[4]->insert(min); res_columns[5]->insert(max); res_columns[6]->insert(read_only); + res_columns[7]->insert(setting.getType().toString()); } } diff --git a/docs/en/operations/system_tables.md b/docs/en/operations/system_tables.md index 4280c4c0ea7..c5613e92ae8 100644 --- a/docs/en/operations/system_tables.md +++ b/docs/en/operations/system_tables.md @@ -841,25 +841,42 @@ Columns: - `name` (String) — Setting name. - `value` (String) — Setting value. +- `description` (String) — Setting description. +- `type` (String) — Setting type. - `changed` (UInt8) — Whether the setting was explicitly defined in the config or explicitly changed. +- `min` (Nullable(String)) — Get minimum allowed value (if any is set via [constraints](settings/constraints_on_settings.md#constraints-on-settings)). +- `max` (Nullable(String)) — Get maximum allowed value (if any is set via [constraints](settings/constraints_on_settings.md#constraints-on-settings)). +- `readonly` (UInt8) — Can user change this setting (for more info, look into [constraints](settings/constraints_on_settings.md#constraints-on-settings)). Example: ``` sql -SELECT * +SELECT name, value FROM system.settings WHERE changed ``` ``` text -┌─name───────────────────┬─value───────┬─changed─┐ -│ max_threads │ 8 │ 1 │ -│ use_uncompressed_cache │ 0 │ 1 │ -│ load_balancing │ random │ 1 │ -│ max_memory_usage │ 10000000000 │ 1 │ -└────────────────────────┴─────────────┴─────────┘ +┌─name───────────────────┬─value───────┐ +│ max_threads │ 8 │ +│ use_uncompressed_cache │ 0 │ +│ load_balancing │ random │ +│ max_memory_usage │ 10000000000 │ +└────────────────────────┴─────────────┘ ``` +## system.merge\_tree\_settings {#system-merge_tree_settings} + +Contains information about settings for `MergeTree` tables. + +Columns: + +- `name` (String) — Setting name. +- `value` (String) — Setting value. +- `description` (String) — Setting description. +- `type` (String) — Setting type. +- `changed` (UInt8) — Whether the setting was explicitly defined in the config or explicitly changed. + ## system.table\_engines {#system-table-engines} Contains description of table engines supported by server and their feature support information.