> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-fbfa8bee.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Kafkaコンシューマーの情報を含むシステムテーブル。

# system.kafka_consumers

<Info>
  **ClickHouse Cloud でのクエリ**

  このシステムテーブルのデータは、ClickHouse Cloud の各ノードにローカルに保持されています。したがって、すべてのデータを完全に把握するには、`clusterAllReplicas` 関数を使用する必要があります。詳細については、[こちら](/ja/reference/system-tables/overview#system-tables-in-clickhouse-cloud)を参照してください。
</Info>

<div id="description">
  ## 説明
</div>

Kafka コンシューマーに関する情報です。
[Kafka テーブルエンジン](/ja/reference/engines/table-engines/integrations/kafka) (ClickHouse のネイティブインテグレーション) に適用されます

<div id="columns">
  ## カラム
</div>

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

例:

```sql theme={null}
SELECT *
FROM system.kafka_consumers
FORMAT Vertical
```

```text theme={null}
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:          []
```
