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

ProtobufList

Not supported in ClickHouse Cloud
输入输出别名

描述

ProtobufList 格式类似于 Protobuf 格式,但行以包含在固定名称为 "Envelope" 的消息中的子消息序列表示。

示例用法

例如:

SELECT * FROM test.table FORMAT ProtobufList SETTINGS format_schema = 'schemafile:MessageType'
cat protobuflist_messages.bin | clickhouse-client --query "INSERT INTO test.table FORMAT ProtobufList SETTINGS format_schema='schemafile:MessageType'"

其中文件 schemafile.proto 的内容如下:

syntax = "proto3";
message Envelope {
  message MessageType {
    string name = 1;
    string surname = 2;
    uint32 birthDate = 3;
    repeated string phoneNumbers = 4;
  };
  MessageType row = 1;
};

格式设置