提交 d1c7833f 编写于 作者: D Daria Mozhaeva

Edit and translate.

上级 a4cefd25
......@@ -726,7 +726,7 @@ log_queries=1
## log_queries_min_query_duration_ms {#settings-log-queries-min-query-duration-ms}
Minimal time for the query to run to get to the following tables:
Minimum query execution time to navigate to the following tables:
- `system.query_log`
- `system.query_thread_log`
......
# system.errors {#system_tables-errors}
Contains error codes with number of times they have been triggered.
Contains error codes with the number of times they have been triggered.
Columns:
- `name` ([String](../../sql-reference/data-types/string.md)) — name of the error (`errorCodeToName`).
- `code` ([Int32](../../sql-reference/data-types/int-uint.md)) — code number of the error.
- `value` ([UInt64](../../sql-reference/data-types/int-uint.md)) - number of times this error has been happened.
- `value` ([UInt64](../../sql-reference/data-types/int-uint.md)) - the number of times this error has been happened.
**Example**
......
......@@ -157,14 +157,14 @@ Levels are the same as in URLHierarchy. This function is specific to Yandex.Metr
## farmHash64 {#farmhash64}
Produces a 64-bit [FarmHash](https://github.com/google/farmhash) or Fingerprint value. Prefer `farmFingerprint64` for a stable and portable value.
Produces a 64-bit [FarmHash](https://github.com/google/farmhash) or Fingerprint value. `farmFingerprint64` is preferred for a stable and portable value.
``` sql
farmFingerprint64(par1, ...)
farmHash64(par1, ...)
```
These functions use the `Fingerprint64` and `Hash64` method respectively from all [available methods](https://github.com/google/farmhash/blob/master/src/farmhash.h).
These functions use the `Fingerprint64` and `Hash64` methods respectively from all [available methods](https://github.com/google/farmhash/blob/master/src/farmhash.h).
**Parameters**
......
......@@ -412,7 +412,7 @@ INSERT INTO table_with_enum_column_for_tsv_insert FORMAT TSV 102 2;
- `'basic'` — используется базовый парсер.
ClickHouse может парсить только базовый формат `YYYY-MM-DD HH:MM:SS`. Например, `'2019-08-20 10:18:56'`.
ClickHouse может парсить только базовый формат `YYYY-MM-DD HH:MM:SS` или `YYYY-MM-DD`. Например, `'2019-08-20 10:18:56'` или `2019-08-20`.
Значение по умолчанию: `'basic'`.
......@@ -691,6 +691,21 @@ ClickHouse использует этот параметр при чтении д
log_queries=1
```
## log_queries_min_query_duration_ms {#settings-log-queries-min-query-duration-ms}
Минимальное время выполнения запроса для перехода к следующим таблицам:
- `system.query_log`
- `system.query_thread_log`
В лог попадут только запросы следующего типа:
- `QUERY_FINISH`
- `EXCEPTION_WHILE_PROCESSING`
- Тип: milliseconds
- Значение по умолчанию: 0 (для любого запроса)
## log_queries_min_type {#settings-log-queries-min-type}
Задаёт минимальный уровень логирования в `query_log`.
......
# system.errors {#system_tables-errors}
Содержит коды ошибок с указанием количества срабатываний.
Столбцы:
- `name` ([String](../../sql-reference/data-types/string.md)) — название ошибки (`errorCodeToName`).
- `code` ([Int32](../../sql-reference/data-types/int-uint.md)) — номер кода ошибки.
- `value` ([UInt64](../../sql-reference/data-types/int-uint.md)) - сколько раз возникала эта ошибка.
**Пример**
``` sql
SELECT *
FROM system.errors
WHERE value > 0
ORDER BY code ASC
LIMIT 1
┌─name─────────────┬─code─┬─value─┐
CANNOT_OPEN_FILE 76 1
└──────────────────┴──────┴───────┘
```
......@@ -9,4 +9,39 @@ toc_title: Date
Дата хранится без учёта часового пояса.
## Примеры {#examples}
**1.** Создание таблицы со столбцом типа `DateTime` и добавление в неё данных:
``` sql
CREATE TABLE dt
(
`timestamp` Date,
`event_id` UInt8
)
ENGINE = TinyLog;
```
``` sql
INSERT INTO dt Values (1546300800, 1), ('2019-01-01', 2);
```
``` sql
SELECT * FROM dt;
```
``` text
┌──timestamp─┬─event_id─┐
│ 2019-01-01 │ 1 │
│ 2019-01-01 │ 2 │
└────────────┴──────────┘
```
## Смотрите также {#see-also}
- [Функции для работы с датой и временем](../../sql-reference/functions/date-time-functions.md)
- [Операторы для работы с датой и временем](../../sql-reference/operators/index.md#operators-datetime)
- [Тип данных `DateTime`](../../sql-reference/data-types/datetime.md)
[Оригинальная статья](https://clickhouse.tech/docs/ru/data_types/date/) <!--hide-->
......@@ -153,15 +153,18 @@ SELECT groupBitXor(cityHash64(*)) FROM table
`URLHash(s, N)` - вычислить хэш от строки до N-го уровня в иерархии URL, без одного завершающего символа `/`, `?` или `#` на конце, если там такой есть.
Уровни аналогичные URLHierarchy. Функция специфична для Яндекс.Метрики.
## farmFingerprint64 {#farmfingerprint64}
## farmHash64 {#farmhash64}
Генерирует 64-х битное значение [FarmHash](https://github.com/google/farmhash).
Создает 64-битное значение [FarmHash](https://github.com/google/farmhash) или значение. `farmFingerprint64` предпочтительнее для стабильных и перемещаемых значений.
``` sql
farmFingerprint64(par1, ...)
farmHash64(par1, ...)
```
Из всех [доступных методов](https://github.com/google/farmhash/blob/master/src/farmhash.h) функция использует `Hash64`.
Эти функции используют методы `Fingerprint64` и `Hash64` из всех [доступных методов](https://github.com/google/farmhash/blob/master/src/farmhash.h).
**Параметры**
......
......@@ -1589,4 +1589,24 @@ SELECT countDigits(toDecimal32(1, 9)), countDigits(toDecimal32(-1, 9)),
10 10 19 19 39 39
```
## errorCodeToName {#error-code-to-name}
**Возвращаемое значение**
- Название переменной для кода ошибки.
Тип: [LowCardinality(String)](../../sql-reference/data-types/lowcardinality.md).
**Синтаксис**
``` sql
errorCodeToName(1)
```
Результат:
``` text
UNSUPPORTED_METHOD
```
[Оригинальная статья](https://clickhouse.tech/docs/ru/query_language/functions/other_functions/) <!--hide-->
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册