跳到主要内容
跳到主要内容

服务器数据包

valuenamedescription
0Hello服务器握手响应
1Dataclient data
2Exception查询处理异常
3Progress查询进度
4PongPing 响应
5EndOfStream所有数据包已传输
6ProfileInfo性能分析数据
7Totals总值
8Extremes极值(最小值,最大值)
9TablesStatusResponse对 TableStatus 请求的响应
10Log查询系统日志
11TableColumns列描述
12UUIDs唯一部分ID的列表
13ReadTaskRequest字符串(UUID)描述需要下一个任务的请求
14ProfileEvents来自服务器的性能事件数据包

DataTotalsExtremes 可以被压缩。

Hello

client hello 的响应。

fieldtypevaluedescription
nameStringClickhouse服务器名称
version_majorUVarInt21服务器主版本
version_minorUVarInt12服务器次版本
revisionUVarInt54452服务器修订版本
tzStringEurope/Moscow服务器时区
display_nameStringClickhouseUI 中的服务器名称
version_patchUVarInt3服务器补丁版本

Exception

服务器在查询处理期间的异常。

fieldtypevaluedescription
codeInt3260ErrorCodes.cpp.
nameStringDB::Exception服务器异常
messageStringDB::Exception: Table X doesn't exist服务器异常信息
stack_traceString~C++ 堆栈跟踪
nestedBooltrue更多错误

可以连续列出异常,直到 nestedfalse

Progress

查询执行的进度由服务器定期报告。

提示

进度以 增量 形式报告。总计由客户端累积。

fieldtypevaluedescription
rowsUVarInt65535行数
bytesUVarInt871799字节数
total_rowsUVarInt0总行数
wrote_rowsUVarInt0来自客户端的行数
wrote_bytesUVarInt0来自客户端的字节数

Pong

client ping 的响应,没有数据包主体。

End of stream

不再发送 Data 数据包,查询结果已完全从服务器传送到客户端。

没有数据包主体。

Profile info

fieldtype
rowsUVarInt
blocksUVarInt
bytesUVarInt
applied_limitBool
rows_before_limitUVarInt
calculated_rows_before_limitBool

Log

数据块 包含服务器日志。

提示

编编码为 数据块 的列,但从未压缩。

columntype
timeDateTime
time_microUInt32
host_nameString
query_idString
thread_idUInt64
priorityInt8
sourceString
textString

Profile events

数据块 包含性能事件。

提示

编编码为 数据块 的列,但从未压缩。

value 类型为 UInt64Int64,具体取决于服务器修订版本。

columntype
host_nameString
current_timeDateTime
thread_idUInt64
typeInt8
nameString
valueUInt64 or Int64