> ## 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.

> Documentación sobre el formato MsgPack

# MsgPack

| Entrada | Salida | Alias |
| ------- | ------ | ----- |
| ✔       | ✔      |       |

<div id="description">
  ## Descripción
</div>

ClickHouse admite leer y escribir archivos de datos [MessagePack](https://msgpack.org/).

<div id="data-types-matching">
  ## Correspondencia entre tipos de datos
</div>

| Tipo de dato de MessagePack (`INSERT`)                             | Tipo de dato de ClickHouse                                                          | Tipo de dato de MessagePack (`SELECT`) |
| ------------------------------------------------------------------ | ----------------------------------------------------------------------------------- | -------------------------------------- |
| `uint N`, `positive fixint`                                        | [`UIntN`](/es/reference/data-types/int-uint)                                        | `uint N`                               |
| `int N`, `negative fixint`                                         | [`IntN`](/es/reference/data-types/int-uint)                                         | `int N`                                |
| `bool`                                                             | [`UInt8`](/es/reference/data-types/int-uint)                                        | `uint 8`                               |
| `fixstr`, `str 8`, `str 16`, `str 32`, `bin 8`, `bin 16`, `bin 32` | [`String`](/es/reference/data-types/string)                                         | `bin 8`, `bin 16`, `bin 32`            |
| `fixstr`, `str 8`, `str 16`, `str 32`, `bin 8`, `bin 16`, `bin 32` | [`FixedString`](/es/reference/data-types/fixedstring)                               | `bin 8`, `bin 16`, `bin 32`            |
| `float 32`                                                         | [`Float32`](/es/reference/data-types/float)                                         | `float 32`                             |
| `float 64`                                                         | [`Float64`](/es/reference/data-types/float)                                         | `float 64`                             |
| `uint 16`                                                          | [`Date`](/es/reference/data-types/date)                                             | `uint 16`                              |
| `int 32`                                                           | [`Date32`](/es/reference/data-types/date32)                                         | `int 32`                               |
| `uint 32`                                                          | [`DateTime`](/es/reference/data-types/datetime)                                     | `uint 32`                              |
| `uint 64`                                                          | [`DateTime64`](/es/reference/data-types/datetime)                                   | `uint 64`                              |
| `fixarray`, `array 16`, `array 32`                                 | [`Array`](/es/reference/data-types/array)/[`Tuple`](/es/reference/data-types/tuple) | `fixarray`, `array 16`, `array 32`     |
| `fixmap`, `map 16`, `map 32`                                       | [`Map`](/es/reference/data-types/map)                                               | `fixmap`, `map 16`, `map 32`           |
| `uint 32`                                                          | [`IPv4`](/es/reference/data-types/ipv4)                                             | `uint 32`                              |
| `bin 8`                                                            | [`String`](/es/reference/data-types/string)                                         | `bin 8`                                |
| `int 8`                                                            | [`Enum8`](/es/reference/data-types/enum)                                            | `int 8`                                |
| `bin 8`                                                            | [`(U)Int128`/`(U)Int256`](/es/reference/data-types/int-uint)                        | `bin 8`                                |
| `int 32`                                                           | [`Decimal32`](/es/reference/data-types/decimal)                                     | `int 32`                               |
| `int 64`                                                           | [`Decimal64`](/es/reference/data-types/decimal)                                     | `int 64`                               |
| `bin 8`                                                            | [`Decimal128`/`Decimal256`](/es/reference/data-types/decimal)                       | `bin 8 `                               |

<div id="example-usage">
  ## Ejemplo de uso
</div>

Escribir en un archivo ".msgpk":

```sql theme={null}
$ clickhouse-client --query="CREATE TABLE msgpack (array Array(UInt8)) ENGINE = Memory;"
$ clickhouse-client --query="INSERT INTO msgpack VALUES ([0, 1, 2, 3, 42, 253, 254, 255]), ([255, 254, 253, 42, 3, 2, 1, 0])";
$ clickhouse-client --query="SELECT * FROM msgpack FORMAT MsgPack" > tmp_msgpack.msgpk;
```

<div id="format-settings">
  ## Configuración del formato
</div>

| Configuración                                                                                                           | Descripción                                                                                                                        | Predeterminado |
| ----------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | -------------- |
| [`input_format_msgpack_number_of_columns`](/es/reference/settings/formats#input_format_msgpack_number_of_columns)       | el número de columnas de los datos MsgPack insertados. Se utiliza para la inferencia automática del esquema a partir de los datos. | `0`            |
| [`output_format_msgpack_uuid_representation`](/es/reference/settings/formats#output_format_msgpack_uuid_representation) | cómo generar UUID en formato MsgPack.                                                                                              | `EXT`          |
