> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# ProtobufList

> ProtobufList 格式文档

[ClickHouse Cloud 不支持此功能](https://clickhouse.com/docs/products/cloud/guides/cloud-compatibility.md#list-of-unsupported-features)

| 输入 | 输出 | 别名 |
| - | - | - |
| ✔ | ✔ | |

## 描述

`ProtobufList` 格式与 [`Protobuf`](https://clickhouse.com/docs/zh/reference/formats/Protobuf/Protobuf) 格式类似，但其中的行会表示为一系列子消息，这些子消息包含在一个名称固定为“Envelope”的消息中。

## 示例用法

例如：

```sql theme={null}
SELECT * FROM test.table FORMAT ProtobufList SETTINGS format_schema = 'schemafile:MessageType'
```

```bash theme={null}
cat protobuflist_messages.bin | clickhouse-client --query "INSERT INTO test.table FORMAT ProtobufList SETTINGS format_schema='schemafile:MessageType'"
```

其中，文件 `schemafile.proto` 如下所示：

```capnp title="schemafile.proto" theme={null}
syntax = "proto3";
message Envelope {
  message MessageType {
    string name = 1;
    string surname = 2;
    uint32 birthDate = 3;
    repeated string phoneNumbers = 4;
  };
  MessageType row = 1;
};
```

`format_schema` 中指定的消息类型会先解析为顶层 `Envelope` 消息内部的嵌套类型。如果未在其中找到匹配项——无论是因为 schema 中没有 `Envelope` 消息，还是因为 `Envelope` 中不包含所请求名称的消息——则直接使用该名称对应的顶层消息。

## 格式设置
