title_wip

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

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

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

Similar to the [`RowBinary`](/docs/interfaces/formats/RowBinary) format, but with an extra byte before each column that indicates if the default value should be used.

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

Examples:

```
SELECT * FROM FORMAT('RowBinaryWithDefaults', 'x UInt32 default 42, y UInt32', x'010001000000')
```

```
┌──x─┬─y─┐
│ 42 │ 1 │
└────┴───┘
```

- For column `x` there is only one byte `01` that indicates that default value should be used and no other data after this byte is provided.
- For column `y` data starts with byte `00` that indicates that column has actual value that should be read from the subsequent data `01000000`.

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

The following settings are common to all `RowBinary` type formats.

|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Setting Description Default|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | [`format_binary_max_string_size`](/docs/operations/settings/formats#format_binary_max_string_size) The maximum allowed size for String in RowBinary format. `1GiB`| [`output_format_binary_encode_types_in_binary_format`](/docs/operations/settings/formats#input_format_binary_decode_types_in_binary_format) Allows to write types in header using [`binary encoding`](/docs/sql-reference/data-types/data-types-binary-encoding) instead of strings with type names in [`RowBinaryWithNamesAndTypes`](/docs/interfaces/formats/RowBinaryWithNamesAndTypes) output format. `false`| [`input_format_binary_decode_types_in_binary_format`](/docs/operations/settings/formats#input_format_binary_decode_types_in_binary_format) Allows to read types in header using [`binary encoding`](/docs/sql-reference/data-types/data-types-binary-encoding) instead of strings with type names in [`RowBinaryWithNamesAndTypes`](/docs/interfaces/formats/RowBinaryWithNamesAndTypes) input format. `false`| [`output_format_binary_write_json_as_string`](/docs/operations/settings/formats#output_format_binary_write_json_as_string) Allows to write values of the [`JSON`](/docs/sql-reference/data-types/newjson) data type as `JSON` [String](/docs/sql-reference/data-types/string) values in [`RowBinary`](/docs/interfaces/formats/RowBinary) output format. `false`| [`input_format_binary_read_json_as_string`](/docs/operations/settings/formats#input_format_binary_read_json_as_string) Allows to read values of the [`JSON`](/docs/sql-reference/data-types/newjson) data type as `JSON` [String](/docs/sql-reference/data-types/string) values in [`RowBinary`](/docs/interfaces/formats/RowBinary) input format. `false` | | | | | | | | | | | | | | | | | |

- [Description](#description)- [Example usage](#example-usage)- [Format settings](#format-settings)

Was this page helpful?