DOCAPI-5757 input_format_values_interpret_expressions EN review and RU translation (#4982)

This commit is contained in:
BayoNet 2019-04-11 17:54:40 +03:00 committed by Ivan Blinkov
parent f8a1eaba3a
commit 0488438ac6
3 changed files with 53 additions and 9 deletions

View File

@ -142,23 +142,23 @@ If `input_format_allow_errors_ratio` is exceeded, ClickHouse throws an exception
## input_format_values_interpret_expressions {#settings-input_format_values_interpret_expressions}
Turns on the full SQL parser if the fast stream parser can't parse the data. This setting is used only for [Values](../../interfaces/formats.md#data-format-values) format at the data insertion. For more information about syntax parsing, see the [Syntax](../../query_language/syntax.md) section.
Turns on the full SQL parser if the fast stream parser can't parse the data. This setting is used only for the [Values](../../interfaces/formats.md#data-format-values) format during data insertion. For more information about syntax parsing, see the [Syntax](../../query_language/syntax.md) section.
Possible values:
- 0 — The functionality is turned off.
- 0 — Functionality is turned off.
In this case, you must provide formatted data. See the [Formats](../../interfaces/formats.md) section.
- 1 — The functionality is turned on.
- 1 — Functionality is turned on.
In this case, you can use an SQL expression as a value, but ClickHouse inserts the data much slower this way. If you insert only formatted data, then ClickHouse behaves as the setting value is 0.
In this case, you can use an SQL expression as a value, but data insertion is much slower this way. If you insert only formatted data, then ClickHouse behaves as if the setting value is 0.
Default value: 1.
**Example of Use**
Let's try to insert the [DateTime](../../data_types/datetime.md) type value with the different settings.
Insert the [DateTime](../../data_types/datetime.md) type value with the different settings.
```sql
SET input_format_values_interpret_expressions = 0;
@ -175,7 +175,7 @@ INSERT INTO datetime_t VALUES (now())
Ok.
```
The last query is equivalent to the following.
The last query is equivalent to the following:
```sql
SET input_format_values_interpret_expressions = 0;
@ -189,7 +189,7 @@ Ok.
Turns on/off the extended data exchange between a ClickHouse client and a ClickHouse server. This setting applies for `INSERT` queries.
When executing the `INSERT` query, ClickHouse client prepares data and sends it to the server for writing. During the preparation of the data, the client gets the table structure from the server. In some cases, the client needs more information than the server sends by default. Turn on the extended data exchange with `input_format_defaults_for_omitted_fields = 1`.
When executing the `INSERT` query, the ClickHouse client prepares data and sends it to the server for writing. The client gets the table structure from the server when preparing the data. In some cases, the client needs more information than the server sends by default. Turn on the extended data exchange with `input_format_defaults_for_omitted_fields = 1`.
When the extended data exchange is enabled, the server sends the additional metadata along with the table structure. The composition of the metadata depends on the operation.

View File

@ -8,7 +8,7 @@ The `INSERT` query uses both parsers:
INSERT INTO t VALUES (1, 'Hello, world'), (2, 'abc'), (3, 'def')
```
The `INSERT INTO t VALUES` fragment is parsed by the full parser, and the data `(1, 'Hello, world'), (2, 'abc'), (3, 'def')` is parsed by the fast stream parser. You can turn on the full parser for the data too. Use the [input_format_values_interpret_expressions](../operations/settings/settings.md#settings-input_format_values_interpret_expressions) setting. When `input_format_values_interpret_expressions = 1`, ClickHouse tries to parse values with the fast stream parser and if it fails ClickHouse tries to use the full parser for the data supposing it as an SQL [expression](#syntax-expressions).
The `INSERT INTO t VALUES` fragment is parsed by the full parser, and the data `(1, 'Hello, world'), (2, 'abc'), (3, 'def')` is parsed by the fast stream parser. You can also turn on the full parser for the data by using the [input_format_values_interpret_expressions](../operations/settings/settings.md#settings-input_format_values_interpret_expressions) setting. When `input_format_values_interpret_expressions = 1`, ClickHouse first tries to parse values with the fast stream parser. If it fails, ClickHouse tries to use the full parser for the data, treating it like an SQL [expression](#syntax-expressions).
Data can have any format. When a query is received, the server calculates no more than [max_query_size](../operations/settings/settings.md#settings-max_query_size) bytes of the request in RAM (by default, 1 MB), and the rest is stream parsed.
This means the system doesn't have problems with large `INSERT` queries, like MySQL does.

View File

@ -101,6 +101,50 @@ ClickHouse применяет настройку в тех случаях, ко
В случае превышения `input_format_allow_errors_ratio` ClickHouse генерирует исключение.
## input_format_values_interpret_expressions {#settings-input_format_values_interpret_expressions}
Включает парсер SQL, если потоковый парсер не может проанализировать данные. Этот параметр используется только для формата [Values](../../interfaces/formats.md#data-format-values) при вводе данных. Дополнительные сведения о парсерах читайте в разделе [Синтаксис](../../query_language/syntax.md).
Возможные значения:
- 0 — функциональность выключена.
В этом случае необходимо вставлять форматированные данные. Смотрите раздел [Форматы](../../interfaces/formats.md).
- 1 — функциональность включена.
В этом случае вы можете использовать выражение SQL в качестве значения, но вставка данных намного медленнее. Если вы вставляете только форматированные данные, ClickHouse ведет себя так, как будто значение параметра равно 0.
Значение по умолчанию: 1.
**Пример использования**
Вставим значение типа [DateTime](../../data_types/datetime.md) при разных значения настройки.
```sql
SET input_format_values_interpret_expressions = 0;
INSERT INTO datetime_t VALUES (now())
Exception on client:
Code: 27. DB::Exception: Cannot parse input: expected ) before: now()): (at row 1)
```
```sql
SET input_format_values_interpret_expressions = 1;
INSERT INTO datetime_t VALUES (now())
Ok.
```
Последний запрос эквивалентен следующему:
```sql
SET input_format_values_interpret_expressions = 0;
INSERT INTO datetime_t SELECT now()
Ok.
```
## input_format_defaults_for_omitted_fields {#session_settings-input_format_defaults_for_omitted_fields}
Включает/выключает расширенный обмен данными между клиентом ClickHouse и сервером ClickHouse. Параметр применяется для запросов `INSERT`.
@ -115,7 +159,7 @@ ClickHouse применяет настройку в тех случаях, ко
Для всех остальных операций ClickHouse не применяет этот параметр.
!!! Примечание " Примечание"
!!! note "Примечание"
Функциональность расширенного обмена данными потребляет дополнительные вычислительные ресурсы на сервере и может снизить производительность.
**Возможные значения**