Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOCSUP-3538: Documeted the tid and logTrace funtions #16884

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
64 changes: 64 additions & 0 deletions docs/en/sql-reference/functions/introspection.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,3 +306,67 @@ execute_native_thread_routine
start_thread
clone
```
## tid {#tid}

Returns id of the thread, in which current [Block](https://clickhouse.tech/docs/en/development/architecture/#block) is processed.

**Syntax**

``` sql
tid()
```

**Returned value**

- Current thread id. [Uint64](../../sql-reference/data-types/int-uint.md#uint-ranges).

**Example**

Query:

``` sql
SELECT tid();
```

Result:

``` text
┌─tid()─┐
│ 3878 │
└───────┘
```
## logTrace {#logtrace}

Emits trace log message to server log for each [Block](https://clickhouse.tech/docs/en/development/architecture/#block).

**Syntax**

``` sql
logTrace('message')
```

**Parameters**

- `message` — Message that is emitted to server log. [String](../../sql-reference/data-types/string.md#string).

**Returned value**

- Always returns 0.

**Example**

Query:

``` sql
SELECT logTrace('logTrace message');
```

Result:

``` text
┌─logTrace('logTrace message')─┐
│ 0 │
└──────────────────────────────┘
```

[Original article](https://clickhouse.tech/docs/en/query_language/functions/introspection/) <!--hide-->
65 changes: 65 additions & 0 deletions docs/ru/sql-reference/functions/introspection.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,3 +306,68 @@ execute_native_thread_routine
start_thread
clone
```

## tid {#tid}

Возвращает id потока, в котором обрабатывается текущий [Block](https://clickhouse.tech/docs/ru/development/architecture/#block).

**Синтаксис**

``` sql
tid()
```

**Возвращаемое значение**

- Id текущего потока. [Uint64](../../sql-reference/data-types/int-uint.md#uint-ranges).

**Пример**

Запрос:

``` sql
SELECT tid();
```

Результат:

``` text
┌─tid()─┐
│ 3878 │
└───────┘
```
## logTrace {#logtrace}

Выводит сообщение в лог сервера для каждого [Block](https://clickhouse.tech/docs/ru/development/architecture/#block).

**Синтаксис**

``` sql
logTrace('message')
```

**Параметры**

- `message` — сообщение, которое отправляется в серверный лог. [String](../../sql-reference/data-types/string.md#string).

**Возвращаемое значение**

- Всегда возвращает 0.

**Example**

Запрос:

``` sql
SELECT logTrace('logTrace message');
```

Результат:

``` text
┌─logTrace('logTrace message')─┐
│ 0 │
└──────────────────────────────┘
```

[Original article](https://clickhouse.tech/docs/en/query_language/functions/introspection/) <!--hide-->