ClickHouse/docs/en/operations/system-tables/distributed_ddl_queue.md

65 lines
2.7 KiB
Markdown
Raw Normal View History

2022-03-30 02:38:50 +00:00
# distributed_ddl_queue {#system_tables-distributed_ddl_queue}
2020-12-15 07:30:18 +00:00
Contains information about [distributed ddl queries (ON CLUSTER clause)](../../sql-reference/distributed-ddl.md) that were executed on a cluster.
2020-12-15 07:30:18 +00:00
Columns:
- `entry` ([String](../../sql-reference/data-types/string.md)) — Query id.
- `host_name` ([String](../../sql-reference/data-types/string.md)) — Hostname.
- `host_address` ([String](../../sql-reference/data-types/string.md)) — IP address that the Hostname resolves to.
- `port` ([UInt16](../../sql-reference/data-types/int-uint.md)) — Host Port.
- `status` ([Enum8](../../sql-reference/data-types/enum.md)) — Status of the query.
- `cluster` ([String](../../sql-reference/data-types/string.md)) — Cluster name.
- `query` ([String](../../sql-reference/data-types/string.md)) — Query executed.
- `initiator` ([String](../../sql-reference/data-types/string.md)) — Node that executed the query.
- `query_start_time` ([DateTime](../../sql-reference/data-types/datetime.md)) — Query start time.
- `query_finish_time` ([DateTime](../../sql-reference/data-types/datetime.md)) — Query finish time.
- `query_duration_ms` ([UInt64](../../sql-reference/data-types/int-uint.md)) — Duration of query execution (in milliseconds).
- `exception_code` ([Enum8](../../sql-reference/data-types/enum.md)) — Exception code from [ZooKeeper](../../operations/tips.md#zookeeper).
2020-12-15 07:30:18 +00:00
**Example**
``` sql
SELECT *
FROM system.distributed_ddl_queue
2020-12-30 10:40:07 +00:00
WHERE cluster = 'test_cluster'
2020-12-15 07:30:18 +00:00
LIMIT 2
FORMAT Vertical
2020-12-30 10:40:07 +00:00
Query id: f544e72a-6641-43f1-836b-24baa1c9632a
2020-12-15 07:30:18 +00:00
Row 1:
──────
entry: query-0000000000
host_name: clickhouse01
host_address: 172.23.0.11
port: 9000
2020-12-30 20:56:00 +00:00
status: Finished
2020-12-15 07:30:18 +00:00
cluster: test_cluster
2020-12-30 10:40:07 +00:00
query: CREATE DATABASE test_db UUID '4a82697e-c85e-4e5b-a01e-a36f2a758456' ON CLUSTER test_cluster
initiator: clickhouse01:9000
query_start_time: 2020-12-30 13:07:51
query_finish_time: 2020-12-30 13:07:51
query_duration_ms: 6
2020-12-15 07:30:18 +00:00
exception_code: ZOK
Row 2:
──────
entry: query-0000000000
host_name: clickhouse02
host_address: 172.23.0.12
port: 9000
2020-12-30 20:56:00 +00:00
status: Finished
2020-12-15 07:30:18 +00:00
cluster: test_cluster
2020-12-30 10:40:07 +00:00
query: CREATE DATABASE test_db UUID '4a82697e-c85e-4e5b-a01e-a36f2a758456' ON CLUSTER test_cluster
initiator: clickhouse01:9000
query_start_time: 2020-12-30 13:07:51
query_finish_time: 2020-12-30 13:07:51
query_duration_ms: 6
2020-12-15 07:30:18 +00:00
exception_code: ZOK
2020-12-30 10:40:07 +00:00
2 rows in set. Elapsed: 0.025 sec.
2020-12-15 07:30:18 +00:00
```
[Original article](https://clickhouse.com/docs/en/operations/system_tables/distributed_ddl_queuedistributed_ddl_queue.md) <!--hide-->