メインコンテンツへスキップ
メインコンテンツへスキップ

system.kafka_consumers

ClickHouse Cloud でのクエリ実行

このシステムテーブルのデータは、ClickHouse Cloud の各ノードにローカルに格納されています。そのため、すべてのデータを包括的に確認するには、clusterAllReplicas 関数を使用する必要があります。詳細についてはこちらを参照してください。

説明

Kafka コンシューマーに関する情報を含みます。 Kafka table engine (ClickHouse ネイティブ統合) に適用されます。

カラム

  • database (String) — Kafka エンジンのテーブルが属するデータベース。
  • table (String) — Kafka エンジンのテーブル名。
  • consumer_id (String) — Kafka コンシューマーの識別子。なお、1 つのテーブルは複数のコンシューマーを持つことができます。kafka_num_consumers パラメータで指定されます。
  • assignments.topic (Array(String)) — Kafka トピック。
  • assignments.partition_id (Array(Int32)) — Kafka パーティション ID。なお、1 つのパーティションに割り当てられるコンシューマーは 1 つだけです。
  • assignments.current_offset (Array(Int64)) — 現在のオフセット。
  • assignments.intent_size (Array(Nullable(Int64))) — 新しい StorageKafka において、プッシュ済みだがまだコミットされていないメッセージ数。
  • exceptions.time (Array(DateTime)) — 直近 10 件の例外が生成された時刻のタイムスタンプ。
  • exceptions.text (Array(String)) — 直近 10 件の例外のテキスト。
  • last_poll_time (DateTime) — 直近の poll のタイムスタンプ。
  • num_messages_read (UInt64) — コンシューマーが読み取ったメッセージ数。
  • last_commit_time (DateTime) — 直近の poll のタイムスタンプ。
  • num_commits (UInt64) — コンシューマーのコミット総数。
  • last_rebalance_time (DateTime) — 直近の Kafka リバランスのタイムスタンプ。
  • num_rebalance_revocations (UInt64) — コンシューマーからパーティションの割り当てが取り消された回数。
  • num_rebalance_assignments (UInt64) — コンシューマーが Kafka クラスターに割り当てられた回数。
  • is_currently_used (UInt8) — コンシューマーが現在使用中かどうかを示すフラグ。
  • last_used (DateTime64(6)) — このコンシューマーが最後に使用された時刻。
  • rdkafka_stat (String) — ライブラリ内部の統計情報。statistics_interval_ms を 0 に設定すると無効になります。デフォルトは 3000 です (3 秒に 1 回) 。
  • dependencies (Array(Array(String))) — 推移的なデータベース依存関係。
  • missing_dependencies (Array(Array(String))) — 欠落している推移的なデータベース依存関係。

例:

SELECT *
FROM system.kafka_consumers
FORMAT Vertical
Row 1:
──────
database:                      test
table:                         kafka
consumer_id:                   ClickHouse-instance-test-kafka-1caddc7f-f917-4bb1-ac55-e28bd103a4a0
assignments.topic:             ['system_kafka_cons']
assignments.partition_id:      [0]
assignments.current_offset:    [18446744073709550615]
exceptions.time:               []
exceptions.text:               []
last_poll_time:                2006-11-09 18:47:47
num_messages_read:             4
last_commit_time:              2006-11-10 04:39:40
num_commits:                   1
last_rebalance_time:           1970-01-01 00:00:00
num_rebalance_revocations:     0
num_rebalance_assignments:     1
is_currently_used:             1
rdkafka_stat:                  {...}
dependencies:                  [['test.mv2','test.target2'],['test.mv1','test.target1']]
missing_dependencies:          []