Arrow

[Edit this page](https://github.com/ClickHouse/ClickHouse/tree/master/docs/en/interfaces/formats/Arrow/Arrow.md)

|  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- |
| Input Output Alias|  |  |  | | --- | --- | --- | | ✔ ✔  | | | | | |

## Description[​](#description "Direct link to Description")

[Apache Arrow](https://arrow.apache.org/) comes with two built-in columnar storage formats. ClickHouse supports read and write operations for these formats.
`Arrow` is Apache Arrow's "file mode" format. It is designed for in-memory random access.

## Data types matching[​](#data-types-matching "Direct link to Data types matching")

The table below shows the supported data types and how they correspond to ClickHouse [data types](/docs/sql-reference/data-types) in `INSERT` and `SELECT` queries.

|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Arrow data type (`INSERT`) ClickHouse data type Arrow data type (`SELECT`)|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `BOOL` [Bool](/docs/sql-reference/data-types/boolean) `BOOL`| `UINT8`, `BOOL` [UInt8](/docs/sql-reference/data-types/int-uint) `UINT8`| `INT8` [Int8](/docs/sql-reference/data-types/int-uint)/[Enum8](/docs/sql-reference/data-types/enum) `INT8`| `UINT16` [UInt16](/docs/sql-reference/data-types/int-uint) `UINT16`| `INT16` [Int16](/docs/sql-reference/data-types/int-uint)/[Enum16](/docs/sql-reference/data-types/enum) `INT16`| `UINT32` [UInt32](/docs/sql-reference/data-types/int-uint) `UINT32`| `INT32` [Int32](/docs/sql-reference/data-types/int-uint) `INT32`| `UINT64` [UInt64](/docs/sql-reference/data-types/int-uint) `UINT64`| `INT64` [Int64](/docs/sql-reference/data-types/int-uint) `INT64`| `FLOAT`, `HALF_FLOAT` [Float32](/docs/sql-reference/data-types/float) `FLOAT32`| `DOUBLE` [Float64](/docs/sql-reference/data-types/float) `FLOAT64`| `DATE32` [Date32](/docs/sql-reference/data-types/date32) `UINT16`| `DATE64` [DateTime](/docs/sql-reference/data-types/datetime) `UINT32`| `TIMESTAMP`, `TIME32`, `TIME64` [DateTime64](/docs/sql-reference/data-types/datetime64) `TIMESTAMP`| `STRING`, `BINARY` [String](/docs/sql-reference/data-types/string) `BINARY`| `STRING`, `BINARY`, `FIXED_SIZE_BINARY` [FixedString](/docs/sql-reference/data-types/fixedstring) `FIXED_SIZE_BINARY`| `DECIMAL` [Decimal](/docs/sql-reference/data-types/decimal) `DECIMAL`| `DECIMAL256` [Decimal256](/docs/sql-reference/data-types/decimal) `DECIMAL256`| `LIST` [Array](/docs/sql-reference/data-types/array) `LIST`| `STRUCT` [Tuple](/docs/sql-reference/data-types/tuple) `STRUCT`| `MAP` [Map](/docs/sql-reference/data-types/map) `MAP`| `UINT32` [IPv4](/docs/sql-reference/data-types/ipv4) `UINT32`| `FIXED_SIZE_BINARY`, `BINARY` [IPv6](/docs/sql-reference/data-types/ipv6) `FIXED_SIZE_BINARY`| `FIXED_SIZE_BINARY`, `BINARY` [Int128/UInt128/Int256/UInt256](/docs/sql-reference/data-types/int-uint) `FIXED_SIZE_BINARY`| `DURATION` [Interval](/docs/sql-reference/data-types/special-data-types/interval) (Nanosecond/Microsecond/Millisecond/Second) `DURATION`| `INT64` [Interval](/docs/sql-reference/data-types/special-data-types/interval) (Minute/Hour/Day/Week/Month/Quarter/Year) `INT64` | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |

Arrays can be nested and can have a value of the `Nullable` type as an argument. `Tuple` and `Map` types can also be nested.

The `DICTIONARY` type is supported for `INSERT` queries, and for `SELECT` queries there is an [`output_format_arrow_low_cardinality_as_dictionary`](/docs/operations/settings/formats#output_format_arrow_low_cardinality_as_dictionary) setting that allows to output [LowCardinality](/docs/sql-reference/data-types/lowcardinality) type as a `DICTIONARY` type. Note that there might be unused values in `LowCardinality` dictionary, which can lead to unused values in Arrow `DICTIONARY` during output.

Unsupported Arrow data types:

- `FIXED_SIZE_BINARY`
- `JSON`
- `UUID`
- `ENUM`.

The data types of ClickHouse table columns do not have to match the corresponding Arrow data fields. When inserting data, ClickHouse interprets data types according to the table above and then [casts](/docs/sql-reference/functions/type-conversion-functions#CAST) the data to the data type set for the ClickHouse table column.

## Example usage[​](#example-usage "Direct link to Example usage")

### Inserting data[​](#inserting-data "Direct link to Inserting data")

You can insert Arrow data from a file into ClickHouse table using the following command:

```
$ cat filename.arrow | clickhouse-client --query="INSERT INTO some_table FORMAT Arrow"
```

### Selecting data[​](#selecting-data "Direct link to Selecting data")

You can select data from a ClickHouse table and save it into some file in the Arrow format using the following command:

```
$ clickhouse-client --query="SELECT * FROM {some_table} FORMAT Arrow" > {filename.arrow}
```

## Format settings[​](#format-settings "Direct link to Format settings")