system.kafka_consumers
在 ClickHouse Cloud 中进行查询
该系统表中的数据保存在 ClickHouse Cloud 中每个节点的本地。因此,如需获得所有数据的完整视图,需要使用 clusterAllReplicas 函数。更多详情请参阅此处。
描述
包含 Kafka 消费者 的相关信息。 适用于 Kafka 表引擎 (ClickHouse 原生集成) 。
列
database(String) — 使用 Kafka 引擎的表所在的数据库。table(String) — 使用 Kafka 引擎的表名。consumer_id(String) — Kafka 消费者 标识符。请注意,一个表可以有多个 消费者。由kafka_num_consumers参数指定。assignments.topic(Array(String)) — Kafka topic。assignments.partition_id(Array(Int32)) — Kafka 分区 id。请注意,一个分区只能分配给一个 消费者。assignments.current_offset(Array(Int64)) — 当前 offset。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) — 消费者 的 commit 总次数。last_rebalance_time(DateTime) — 最近一次 Kafka rebalance 的时间戳。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 (每三秒一次) 。dependencies(Array(Array(String))) — 传递性数据库依赖。missing_dependencies(Array(Array(String))) — 缺失的传递性数据库依赖。
示例: