mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-10-14 04:20:47 +00:00
DOCAPI-4821. Sync between ru and en versions of docs.
This commit is contained in:
parent
931124a4d1
commit
1f8a79e9f7
@ -14,7 +14,7 @@ If `replace` is specified, it replaces the entire element with the specified one
|
|||||||
|
|
||||||
If `remove` is specified, it deletes the element.
|
If `remove` is specified, it deletes the element.
|
||||||
|
|
||||||
The config can also define "substitutions". If an element has the `incl` attribute, the corresponding substitution from the file will be used as the value. By default, the path to the file with substitutions is `/etc/metrika.xml`. This can be changed in the [include_from](server_settings/settings.md#server_settings-include_from) element in the server config. The substitution values are specified in `/yandex/substitution_name` elements in this file. If a substitution specified in `incl` does not exist, it is recorded in the log. To prevent ClickHouse from logging missing substitutions, specify the `optional="true"` attribute (for example, settings for [macros]() server_settings/settings.md#server_settings-macros)).
|
The config can also define "substitutions". If an element has the `incl` attribute, the corresponding substitution from the file will be used as the value. By default, the path to the file with substitutions is `/etc/metrika.xml`. This can be changed in the [include_from](server_settings/settings.md#server_settings-include_from) element in the server config. The substitution values are specified in `/yandex/substitution_name` elements in this file. If a substitution specified in `incl` does not exist, it is recorded in the log. To prevent ClickHouse from logging missing substitutions, specify the `optional="true"` attribute (for example, settings for [macros](server_settings/settings.md#server_settings-macros)).
|
||||||
|
|
||||||
Substitutions can also be performed from ZooKeeper. To do this, specify the attribute `from_zk = "/path/to/node"`. The element value is replaced with the contents of the node at `/path/to/node` in ZooKeeper. You can also put an entire XML subtree on the ZooKeeper node and it will be fully inserted into the source element.
|
Substitutions can also be performed from ZooKeeper. To do this, specify the attribute `from_zk = "/path/to/node"`. The element value is replaced with the contents of the node at `/path/to/node` in ZooKeeper. You can also put an entire XML subtree on the ZooKeeper node and it will be fully inserted into the source element.
|
||||||
|
|
||||||
|
@ -532,6 +532,7 @@ Columns in the log:
|
|||||||
- database_name – The name of the database.
|
- database_name – The name of the database.
|
||||||
- table_name – Name of the table.
|
- table_name – Name of the table.
|
||||||
- part_name – Name of the data part.
|
- part_name – Name of the data part.
|
||||||
|
- partition_id – The identifier of the partition.
|
||||||
- size_in_bytes – Size of the data part in bytes.
|
- size_in_bytes – Size of the data part in bytes.
|
||||||
- merged_from – An array of names of data parts that make up the merge (also used when downloading a merged part).
|
- merged_from – An array of names of data parts that make up the merge (also used when downloading a merged part).
|
||||||
- merge_time_ms – Time spent on the merge.
|
- merge_time_ms – Time spent on the merge.
|
||||||
|
@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
Restrictions on query complexity are part of the settings.
|
Restrictions on query complexity are part of the settings.
|
||||||
They are used in order to provide safer execution from the user interface.
|
They are used in order to provide safer execution from the user interface.
|
||||||
Almost all the restrictions only apply to SELECTs.For distributed query processing, restrictions are applied on each server separately.
|
Almost all the restrictions only apply to `SELECT`. For distributed query processing, restrictions are applied on each server separately.
|
||||||
|
|
||||||
|
ClickHouse checks the restrictions for data parts, not for each row. It means that you can exceed the value of restriction with a size of the data part.
|
||||||
|
|
||||||
Restrictions on the "maximum amount of something" can take the value 0, which means "unrestricted".
|
Restrictions on the "maximum amount of something" can take the value 0, which means "unrestricted".
|
||||||
Most restrictions also have an 'overflow_mode' setting, meaning what to do when the limit is exceeded.
|
Most restrictions also have an 'overflow_mode' setting, meaning what to do when the limit is exceeded.
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# Dictionary
|
# Dictionary
|
||||||
|
|
||||||
The `Dictionary` engine displays the dictionary data as a ClickHouse table.
|
The `Dictionary` engine displays the [dictionary](../../query_language/dicts/external_dicts.md#dicts-external_dicts) data as a ClickHouse table.
|
||||||
|
|
||||||
As an example, consider a dictionary of `products` with the following configuration:
|
As an example, consider a dictionary of `products` with the following configuration:
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ If the data query specifies:
|
|||||||
|
|
||||||
- `CounterID in ('a', 'h')`, the server reads the data in the ranges of marks `[0, 3)` and `[6, 8)`.
|
- `CounterID in ('a', 'h')`, the server reads the data in the ranges of marks `[0, 3)` and `[6, 8)`.
|
||||||
- `CounterID IN ('a', 'h') AND Date = 3`, the server reads the data in the ranges of marks `[1, 3)` and `[7, 8)`.
|
- `CounterID IN ('a', 'h') AND Date = 3`, the server reads the data in the ranges of marks `[1, 3)` and `[7, 8)`.
|
||||||
- `Date = 3`, the server reads the data in the range of marks `[1, 10)`.
|
- `Date = 3`, the server reads the data in the range of marks `[1, 10]`.
|
||||||
|
|
||||||
The examples above show that it is always more effective to use an index than a full scan.
|
The examples above show that it is always more effective to use an index than a full scan.
|
||||||
|
|
||||||
|
@ -35,13 +35,13 @@ Example of settings:
|
|||||||
|
|
||||||
When upgrading the dictionaries, the ClickHouse server applies different logic depending on the type of [ source](external_dicts_dict_sources.md#dicts-external_dicts_dict_sources):
|
When upgrading the dictionaries, the ClickHouse server applies different logic depending on the type of [ source](external_dicts_dict_sources.md#dicts-external_dicts_dict_sources):
|
||||||
|
|
||||||
> - For a text file, it checks the time of modification. If the time differs from the previously recorded time, the dictionary is updated.
|
- For a text file, it checks the time of modification. If the time differs from the previously recorded time, the dictionary is updated.
|
||||||
- For MyISAM tables, the time of modification is checked using a `SHOW TABLE STATUS` query.
|
- For MyISAM tables, the time of modification is checked using a `SHOW TABLE STATUS` query.
|
||||||
- Dictionaries from other sources are updated every time by default.
|
- Dictionaries from other sources are updated every time by default.
|
||||||
|
|
||||||
For MySQL (InnoDB) and ODBC sources, you can set up a query that will update the dictionaries only if they really changed, rather than each time. To do this, follow these steps:
|
For MySQL (InnoDB), ODBC and ClickHouse sources, you can set up a query that will update the dictionaries only if they really changed, rather than each time. To do this, follow these steps:
|
||||||
|
|
||||||
> - The dictionary table must have a field that always changes when the source data is updated.
|
- The dictionary table must have a field that always changes when the source data is updated.
|
||||||
- The settings of the source must specify a query that retrieves the changing field. The ClickHouse server interprets the query result as a row, and if this row has changed relative to its previous state, the dictionary is updated. Specify the query in the `<invalidate_query>` field in the settings for the [source](external_dicts_dict_sources.md#dicts-external_dicts_dict_sources).
|
- The settings of the source must specify a query that retrieves the changing field. The ClickHouse server interprets the query result as a row, and if this row has changed relative to its previous state, the dictionary is updated. Specify the query in the `<invalidate_query>` field in the settings for the [source](external_dicts_dict_sources.md#dicts-external_dicts_dict_sources).
|
||||||
|
|
||||||
Example of settings:
|
Example of settings:
|
||||||
|
@ -18,7 +18,8 @@ For a case-insensitive search, use the function `positionCaseInsensitiveUTF8`.
|
|||||||
|
|
||||||
## match(haystack, pattern)
|
## match(haystack, pattern)
|
||||||
|
|
||||||
Checks whether the string matches the 'pattern' regular expression. A re2 regular expression.
|
Checks whether the string matches the `pattern` regular expression. A `re2` regular expression. The [syntax](https://github.com/google/re2/wiki/Syntax) of the `re2` regular expressions is more limited than the syntax of the Perl regular expressions.
|
||||||
|
|
||||||
Returns 0 if it doesn't match, or 1 if it matches.
|
Returns 0 if it doesn't match, or 1 if it matches.
|
||||||
|
|
||||||
Note that the backslash symbol (`\`) is used for escaping in the regular expression. The same symbol is used for escaping in string literals. So in order to escape the symbol in a regular expression, you must write two backslashes (\\) in a string literal.
|
Note that the backslash symbol (`\`) is used for escaping in the regular expression. The same symbol is used for escaping in string literals. So in order to escape the symbol in a regular expression, you must write two backslashes (\\) in a string literal.
|
||||||
|
@ -12,6 +12,10 @@
|
|||||||
|
|
||||||
## toDate, toDateTime
|
## toDate, toDateTime
|
||||||
|
|
||||||
|
## toDecimal32(value, S), toDecimal64(value, S), toDecimal128(value, S)
|
||||||
|
|
||||||
|
Converts `value` to [Decimal](../../data_types/decimal.md#data_type-decimal) of precision `S`. The `value` can be a number or a string. The `S` (scale) parameter specifies the number of decimal places.
|
||||||
|
|
||||||
## toString
|
## toString
|
||||||
|
|
||||||
Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times.
|
Functions for converting between numbers, strings (but not fixed strings), dates, and dates with times.
|
||||||
|
@ -91,11 +91,15 @@ The conditional operator calculates the values of b and c, then checks whether c
|
|||||||
CASE [x]
|
CASE [x]
|
||||||
WHEN a THEN b
|
WHEN a THEN b
|
||||||
[WHEN ... THEN ...]
|
[WHEN ... THEN ...]
|
||||||
ELSE c
|
[ELSE c]
|
||||||
END
|
END
|
||||||
```
|
```
|
||||||
|
|
||||||
If "x" is specified, then transform(x, \[a, ...\], \[b, ...\], c). Otherwise – multiIf(a, b, ..., c).
|
If `x` is specified, then `transform(x, [a, ...], [b, ...], c)` function is used. Otherwise – `multiIf(a, b, ..., c)`.
|
||||||
|
|
||||||
|
If there is no `ELSE c` clause in the expression, the default value is `NULL`.
|
||||||
|
|
||||||
|
The `transform` function does not work with `NULL`.
|
||||||
|
|
||||||
## Concatenation Operator
|
## Concatenation Operator
|
||||||
|
|
||||||
|
@ -24,6 +24,33 @@ Merge(hits, '^WatchLog')
|
|||||||
|
|
||||||
Типичный способ использования движка `Merge` — работа с большим количеством таблиц типа `TinyLog`, как с одной.
|
Типичный способ использования движка `Merge` — работа с большим количеством таблиц типа `TinyLog`, как с одной.
|
||||||
|
|
||||||
|
Пример 2:
|
||||||
|
|
||||||
|
Пусть есть старая таблица `WatchLog_old`. Необходимо изменить партиционирование без перемещения данных в новую таблицу `WatchLog_new`. При этом в выборке должны участвовать данные обеих таблиц.
|
||||||
|
|
||||||
|
```
|
||||||
|
CREATE TABLE WatchLog_old(date Date, UserId Int64, EventType String, Cnt UInt64)
|
||||||
|
ENGINE=MergeTree(date, (UserId, EventType), 8192);
|
||||||
|
INSERT INTO WatchLog_old VALUES ('2018-01-01', 1, 'hit', 3);
|
||||||
|
|
||||||
|
CREATE TABLE WatchLog_new(date Date, UserId Int64, EventType String, Cnt UInt64)
|
||||||
|
ENGINE=MergeTree PARTITION BY date ORDER BY (UserId, EventType) SETTINGS index_granularity=8192;
|
||||||
|
INSERT INTO WatchLog_new VALUES ('2018-01-02', 2, 'hit', 3);
|
||||||
|
|
||||||
|
CREATE TABLE WatchLog as WatchLog_old ENGINE=Merge(currentDatabase(), '^WatchLog');
|
||||||
|
|
||||||
|
SELECT *
|
||||||
|
FROM WatchLog
|
||||||
|
|
||||||
|
┌───────date─┬─UserId─┬─EventType─┬─Cnt─┐
|
||||||
|
│ 2018-01-01 │ 1 │ hit │ 3 │
|
||||||
|
└────────────┴────────┴───────────┴─────┘
|
||||||
|
┌───────date─┬─UserId─┬─EventType─┬─Cnt─┐
|
||||||
|
│ 2018-01-02 │ 2 │ hit │ 3 │
|
||||||
|
└────────────┴────────┴───────────┴─────┘
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
## Виртуальные столбцы
|
## Виртуальные столбцы
|
||||||
|
|
||||||
Виртуальные столбцы — столбцы, предоставляемые движком таблиц независимо от определения таблицы. То есть, такие столбцы не указываются в `CREATE TABLE`, но доступны для `SELECT`.
|
Виртуальные столбцы — столбцы, предоставляемые движком таблиц независимо от определения таблицы. То есть, такие столбцы не указываются в `CREATE TABLE`, но доступны для `SELECT`.
|
||||||
|
@ -21,7 +21,7 @@ Turbo-Boost крайне не рекомендуется отключать. П
|
|||||||
Нужно всегда использовать `performance` scaling governor. `ondemand` scaling governor работает намного хуже при постоянно высоком спросе.
|
Нужно всегда использовать `performance` scaling governor. `ondemand` scaling governor работает намного хуже при постоянно высоком спросе.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo echo 'performance' | tee /sys/devices/system/cpu/cpu\*/cpufreq/scaling_governor
|
sudo echo 'performance' | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
|
||||||
```
|
```
|
||||||
|
|
||||||
## Ограничение CPU
|
## Ограничение CPU
|
||||||
|
@ -95,9 +95,9 @@ CASE [x]
|
|||||||
END
|
END
|
||||||
```
|
```
|
||||||
|
|
||||||
В случае указания x - функция transform(x, \[a, ...\], \[b, ...\], c). Иначе - multiIf(a, b, ..., c).
|
В случае указания `x` - функция `transform(x, [a, ...], [b, ...], c)`. Иначе — `multiIf(a, b, ..., c)`.
|
||||||
При отсутствии секции `ELSE c`, значением по умолчанию будет NULL.
|
При отсутствии секции `ELSE c`, значением по умолчанию будет `NULL`.
|
||||||
P.S. Функция transform не умеет работать с NULL.
|
P.S. Функция `transform` не умеет работать с `NULL`.
|
||||||
|
|
||||||
## Оператор склеивания строк
|
## Оператор склеивания строк
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user