| 值 | 名称 | 描述 |
|---|---|---|
| 0 | Hello | 服务器握手响应 |
| 1 | Data | 与客户端数据相同 |
| 2 | Exception | 查询处理异常 |
| 3 | Progress | 查询进度 |
| 4 | Pong | Ping 响应 |
| 5 | EndOfStream | 所有数据包均已传输完毕 |
| 6 | ProfileInfo | 性能分析数据 |
| 7 | Totals | 总计值 |
| 8 | Extremes | 极值 (最小值、最大值) |
| 9 | TablesStatusResponse | 对 TableStatus 请求的响应 |
| 10 | 日志 | 查询系统日志 |
| 11 | TableColumns | 列描述 |
| 12 | UUIDs | 唯一 parts ID 的列表 |
| 13 | ReadTaskRequest | String (UUID) ,用于描述需要下一个任务的请求 |
| 14 | ProfileEvents | 来自服务器的 profile events 数据包 |
Data、Totals 和 Extremes 可以压缩。
Hello
对 客户端 hello 的响应。
| 字段 | 类型 | 值 | 描述 |
|---|---|---|---|
| name | String | ClickHouse |
服务器名称 |
| version_major | UVarInt | 21 |
服务器主版本 |
| version_minor | UVarInt | 12 |
服务器次版本 |
| revision | UVarInt | 54452 |
服务器修订号 |
| tz | String | Europe/Moscow |
服务器时区 |
| display_name | String | <display_name-or-hostname> |
UI 中显示的服务器名称 |
| version_patch | UVarInt | 3 |
服务器补丁版本 |
Exception
查询处理期间的服务器异常。
| 字段 | 类型 | 值 | 描述 |
|---|---|---|---|
| code | Int32 | 60 |
参见 ErrorCodes.cpp。 |
| name | String | DB::Exception |
服务器主版本 |
| message | String | DB::Exception: Table X doesn't exist |
服务器次版本 |
| stack_trace | String | ~ | C++ 栈跟踪 |
| nested | Bool | true |
更多错误 |
可以是连续的异常列表,直到 nested 为 false。
Progress
服务器会定期报告查询执行进度。
| 字段 | 类型 | 值 | 描述 |
|---|---|---|---|
| rows | UVarInt | 65535 |
行数 |
| bytes | UVarInt | 871799 |
字节数 |
| total_rows | UVarInt | 0 |
总行数 |
| wrote_rows | UVarInt | 0 |
来自客户端的行数 |
| wrote_bytes | UVarInt | 0 |
来自客户端的字节数 |
Pong
对客户端 Ping的响应,不包含数据包主体。
流结束
不会再发送更多 Data 数据包,查询结果已从服务器完整流式传输到客户端。
无数据包主体。
Profile 信息
| 字段 | 类型 |
|---|---|
| rows | UVarInt |
| blocks | UVarInt |
| bytes | UVarInt |
| applied_limit | Bool |
| rows_before_limit | UVarInt |
| calculated_rows_before_limit | Bool |
日志
包含服务器日志的数据块。
| 列 | 类型 |
|---|---|
| time | DateTime |
| time_micro | UInt32 |
| host_name | String |
| query_id | String |
| thread_id | UInt64 |
| priority | Int8 |
| source | String |
| text | String |
Profile events
包含 profile events 的数据块。
| 列 | 类型 |
|---|---|
| host_name | String |
| current_time | DateTime |
| thread_id | UInt64 |
| type | Int8 |
| name | String |
| value | UInt64 or Int64 |