Skip to content
ClickHouse Docs
ClickHouse DocsClickHouse Docs

ProtobufList

Not supported in ClickHouse Cloud
Input Output Alias

Description

The ProtobufList format is similar to the Protobuf format but rows are represented as a sequence of sub-messages contained in a message with a fixed name of “Envelope”.

Example usage

For example:

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'"

Where the file schemafile.proto looks like this:

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

The message type specified in format_schema is resolved by first looking for it as a nested type inside a top-level Envelope message. If no match is found there — either because the schema has no Envelope message, or the Envelope does not contain a message with the requested name — the top-level message with that name is used directly.

Format settings

Navigation