> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-fix-nav-issues.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> 该引擎支持通过 Apache Arrow Flight 查询远程数据集。

# ArrowFlight 表引擎

ArrowFlight 表引擎使 ClickHouse 能够通过 [Apache Arrow Flight](https://arrow.apache.org/docs/format/Flight.html) 协议查询远程数据集。
该集成使 ClickHouse 能够以高性能从外部支持 Flight 的服务器中拉取列式 Arrow 格式的数据。

<div id="creating-a-table">
  ## 创建表
</div>

```sql theme={null}
CREATE TABLE [IF NOT EXISTS] [db.]table_name (name1 [type1], name2 [type2], ...)
    ENGINE = ArrowFlight('host:port', 'dataset_name' [, 'username', 'password']);
```

**引擎参数**

* `host:port` — 远程 Arrow Flight 服务器的地址。
* `dataset_name` — Flight 服务器上的数据集标识符。
* `username` - 用于基本 HTTP 身份验证的用户名。
* `password` - 用于基本 HTTP 身份验证的密码。
  如果未指定 `username` 和 `password`，则表示不使用身份验证
  (仅当 Arrow Flight 服务器允许时才可行) 。

<div id="usage-example">
  ## 使用示例
</div>

本示例展示了如何创建一个从远程 Arrow Flight 服务器读取数据的表：

```sql theme={null}
CREATE TABLE remote_flight_data
(
    id UInt32,
    name String,
    value Float64
) ENGINE = ArrowFlight('127.0.0.1:9005', 'sample_dataset');
```

将远程数据视作本地表进行查询：

```sql theme={null}
SELECT * FROM remote_flight_data ORDER BY id;
```

```text theme={null}
┌─id─┬─name────┬─value─┐
│  1 │ foo     │ 42.1  │
│  2 │ bar     │ 13.3  │
│  3 │ baz     │ 77.0  │
└────┴─────────┴───────┘
```

<div id="notes">
  ## 注意事项
</div>

* 在 ClickHouse 中定义的 schema 必须与 Flight 服务器 返回的 schema 保持一致。
* 该引擎适用于联邦查询、数据虚拟化，以及将存储与 compute 解耦。

<div id="see-also">
  ## 另请参阅
</div>

* [Apache Arrow Flight SQL](https://arrow.apache.org/docs/format/FlightSql.html)
* [ClickHouse 中的 Arrow 格式集成](/zh/reference/formats/Arrow/Arrow)
