mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
Merge pull request #15368 from olgarev/revolg-DOCSUP-2403-Document_the_mechanics_of_custom_settings_specifying
DOCSUP-2403: Docs for the mechanics of custom settings specifying
This commit is contained in:
commit
fbd402c9b4
@ -66,6 +66,20 @@ If no conditions met for a data part, ClickHouse uses the `lz4` compression.
|
||||
</compression>
|
||||
```
|
||||
|
||||
## custom_settings_prefixes {#custom_settings_prefixes}
|
||||
|
||||
List of prefixes for [custom settings](../../operations/settings/index.md#custom_settings). The prefixes must be separated with commas.
|
||||
|
||||
**Example**
|
||||
|
||||
```xml
|
||||
<custom_settings_prefixes>custom_</custom_settings_prefixes>
|
||||
```
|
||||
|
||||
**See Also**
|
||||
|
||||
- [Custom settings](../../operations/settings/index.md#custom_settings)
|
||||
|
||||
## core_dump
|
||||
|
||||
Configures soft limit for core dump file size, one gigabyte by default.
|
||||
|
@ -28,4 +28,30 @@ Ways to configure settings, in order of priority:
|
||||
|
||||
Settings that can only be made in the server config file are not covered in this section.
|
||||
|
||||
## Custom Settings {#custom_settings}
|
||||
|
||||
In addition to the common [settings](../../operations/settings/settings.md), users can define custom settings.
|
||||
|
||||
A custom setting name must begin with one of predefined prefixes. The list of these prefixes must be declared in the [custom_settings_prefixes](../../operations/server-configuration-parameters/settings.md#custom_settings_prefixes) parameter in the server configuration file.
|
||||
|
||||
```xml
|
||||
<custom_settings_prefixes>custom_</custom_settings_prefixes>
|
||||
```
|
||||
|
||||
To define a custom setting use `SET` command:
|
||||
|
||||
```sql
|
||||
SET custom_a = 123;
|
||||
```
|
||||
|
||||
To get the current value of a custom setting use `getSetting()` function:
|
||||
|
||||
```sql
|
||||
SELECT getSetting('custom_a');
|
||||
```
|
||||
|
||||
**See Also**
|
||||
|
||||
- [Server Configuration Settings](../../operations/server-configuration-parameters/settings.md)
|
||||
|
||||
[Original article](https://clickhouse.tech/docs/en/operations/settings/) <!--hide-->
|
||||
|
@ -1491,4 +1491,40 @@ Result:
|
||||
|
||||
```
|
||||
|
||||
## getSetting {#getSetting}
|
||||
|
||||
Returns the current value of a [custom setting](../../operations/settings/index.md#custom_settings).
|
||||
|
||||
**Syntax**
|
||||
|
||||
```sql
|
||||
getSetting('custom_setting');
|
||||
```
|
||||
|
||||
**Parameter**
|
||||
|
||||
- `custom_setting` — The setting name. [String](../../sql-reference/data-types/string.md).
|
||||
|
||||
**Returned value**
|
||||
|
||||
- The setting current value.
|
||||
|
||||
**Example**
|
||||
|
||||
```sql
|
||||
SET custom_a = 123;
|
||||
SELECT getSetting('custom_a');
|
||||
```
|
||||
|
||||
**Result**
|
||||
|
||||
```
|
||||
123
|
||||
```
|
||||
|
||||
**See Also**
|
||||
|
||||
- [Custom Settings](../../operations/settings/index.md#custom_settings)
|
||||
|
||||
|
||||
[Original article](https://clickhouse.tech/docs/en/query_language/functions/other_functions/) <!--hide-->
|
||||
|
Loading…
Reference in New Issue
Block a user