distributed_ddl_queue
包含有关在集群上执行的分布式DDL查询(ON CLUSTER子句)的信息。
列
entry
(字符串) — 查询 ID。entry_version
(Nullable(UInt8)) - 条目的版本initiator_host
(Nullable(字符串)) - 发起DDL操作的主机initiator_port
(Nullable(UInt16)) - 发起者使用的端口cluster
(字符串) — 集群名称。query
(字符串) — 执行的查询。settings
(Map(字符串, 字符串)) - DDL操作中使用的设置query_create_time
(日期时间) — 查询创建时间。host
(字符串) — 主机名port
(UInt16) — 主机端口。status
(Enum8) — 查询的状态。exception_code
(Enum8) — 异常代码。exception_text
(Nullable(字符串)) - 异常消息query_finish_time
(日期时间) — 查询完成时间。query_duration_ms
(UInt64) — 查询执行持续时间(以毫秒为单位)。
示例
SELECT *
FROM system.distributed_ddl_queue
WHERE cluster = 'test_cluster'
LIMIT 2
FORMAT Vertical
Query id: f544e72a-6641-43f1-836b-24baa1c9632a
Row 1:
──────
entry: query-0000000000
entry_version: 5
initiator_host: clickhouse01
initiator_port: 9000
cluster: test_cluster
query: CREATE DATABASE test_db UUID '4a82697e-c85e-4e5b-a01e-a36f2a758456' ON CLUSTER test_cluster
settings: {'max_threads':'16','use_uncompressed_cache':'0'}
query_create_time: 2023-09-01 16:15:14
host: clickhouse-01
port: 9000
status: Finished
exception_code: 0
exception_text:
query_finish_time: 2023-09-01 16:15:14
query_duration_ms: 154
Row 2:
──────
entry: query-0000000001
entry_version: 5
initiator_host: clickhouse01
initiator_port: 9000
cluster: test_cluster
query: CREATE DATABASE test_db UUID '4a82697e-c85e-4e5b-a01e-a36f2a758456' ON CLUSTER test_cluster
settings: {'max_threads':'16','use_uncompressed_cache':'0'}
query_create_time: 2023-09-01 16:15:14
host: clickhouse-01
port: 9000
status: Finished
exception_code: 630
exception_text: Code: 630. DB::Exception: Cannot drop or rename test_db, because some tables depend on it:
query_finish_time: 2023-09-01 16:15:14
query_duration_ms: 154
2 rows in set. Elapsed: 0.025 sec.