system.distributed_ddl_queue

Contains information about distributed ddl queries (ON CLUSTER clause) that were executed on a cluster.

Columns:

  • entry (String) — Query id.
  • host_name (String) — Hostname.
  • host_address (String) — IP address that the Hostname resolves to.
  • port (UInt16) — Host Port.
  • status (Enum8) — Status of the query.
  • cluster (String) — Cluster name.
  • query (String) — Query executed.
  • initiator (String) — Node that executed the query.
  • query_start_time (DateTime) — Query start time.
  • query_finish_time (DateTime) — Query finish time.
  • query_duration_ms (UInt64) — Duration of query execution (in milliseconds).
  • exception_code (Enum8) — Exception code from ZooKeeper.

Example

  1. SELECT *
  2. FROM system.distributed_ddl_queue
  3. WHERE cluster = 'test_cluster'
  4. LIMIT 2
  5. FORMAT Vertical
  6. Query id: f544e72a-6641-43f1-836b-24baa1c9632a
  7. Row 1:
  8. ──────
  9. entry: query-0000000000
  10. host_name: clickhouse01
  11. host_address: 172.23.0.11
  12. port: 9000
  13. status: Finished
  14. cluster: test_cluster
  15. query: CREATE DATABASE test_db UUID '4a82697e-c85e-4e5b-a01e-a36f2a758456' ON CLUSTER test_cluster
  16. initiator: clickhouse01:9000
  17. query_start_time: 2020-12-30 13:07:51
  18. query_finish_time: 2020-12-30 13:07:51
  19. query_duration_ms: 6
  20. exception_code: ZOK
  21. Row 2:
  22. ──────
  23. entry: query-0000000000
  24. host_name: clickhouse02
  25. host_address: 172.23.0.12
  26. port: 9000
  27. status: Finished
  28. cluster: test_cluster
  29. query: CREATE DATABASE test_db UUID '4a82697e-c85e-4e5b-a01e-a36f2a758456' ON CLUSTER test_cluster
  30. initiator: clickhouse01:9000
  31. query_start_time: 2020-12-30 13:07:51
  32. query_finish_time: 2020-12-30 13:07:51
  33. query_duration_ms: 6
  34. exception_code: ZOK
  35. 2 rows in set. Elapsed: 0.025 sec.