> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-fix-nav-issues.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` 函数。更多详情请参见[此处](/zh/reference/system-tables/overview#system-tables-in-clickhouse-cloud)。
</Info>

<div id="description">
  ## 描述
</div>

包含 Kafka 消费者的相关信息。
适用于 [Kafka 表引擎](/zh/reference/engines/table-engines/integrations/kafka) (ClickHouse 原生集成)

<div id="columns">
  ## 列
</div>

* `database` ([String](/zh/reference/data-types)) — 带有表引擎的表所在的数据库。
* `table` ([String](/zh/reference/data-types)) — 带有表引擎的表名称。
* `consumer_id` ([String](/zh/reference/data-types)) — Kafka 消费者标识符。请注意，一个表可以有多个消费者。由 `kafka_num_consumers` 参数指定。
* `assignments.topic` ([Array(String)](/zh/reference/data-types)) — Kafka topic。
* `assignments.partition_id` ([Array(Int32)](/zh/reference/data-types)) — Kafka 分区 ID。请注意，一个分区只能分配给一个消费者。
* `assignments.current_offset` ([Array(Int64)](/zh/reference/data-types)) — 当前 offset。
* `assignments.intent_size` ([Array(Nullable(Int64))](/zh/reference/data-types)) — 在新的 StorageKafka 中，已推送但尚未提交的消息数。
* `exceptions.time` ([Array(DateTime)](/zh/reference/data-types)) — 最近 10 个异常产生时的时间戳。
* `exceptions.text` ([Array(String)](/zh/reference/data-types)) — 最近 10 个异常的文本。
* `last_poll_time` ([DateTime](/zh/reference/data-types)) — 最近一次 poll 的时间戳。
* `num_messages_read` ([UInt64](/zh/reference/data-types)) — 该消费者读取的消息数。
* `last_commit_time` ([DateTime](/zh/reference/data-types)) — 最近一次 poll 的时间戳。
* `num_commits` ([UInt64](/zh/reference/data-types)) — 该消费者的提交总次数。
* `last_rebalance_time` ([DateTime](/zh/reference/data-types)) — 最近一次 Kafka rebalance 的时间戳。
* `num_rebalance_revocations` ([UInt64](/zh/reference/data-types)) — 该消费者的分区分配被撤销的次数。
* `num_rebalance_assignments` ([UInt64](/zh/reference/data-types)) — 该消费者被分配到 Kafka 集群的次数。
* `is_currently_used` ([UInt8](/zh/reference/data-types)) — 指示该消费者当前是否正在使用的标志。
* `last_used` ([DateTime64(6)](/zh/reference/data-types)) — 该消费者上次被使用的时间。
* `rdkafka_stat` ([String](/zh/reference/data-types)) — 库内部统计信息。将 statistics\_interval\_ms 设为 0 可禁用，默认值为 3000 (每三秒一次) 。
* `dependencies` ([Array(Array(String))](/zh/reference/data-types)) — 传递性数据库依赖项。
* `missing_dependencies` ([Array(Array(String))](/zh/reference/data-types)) — 缺失的传递性数据库依赖项。

示例：

```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:          []
```
