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

> Documentation for the RowBinaryWithDefaults format

# RowBinaryWithDefaults

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

<h2 id="description">
  Description
</h2>

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

<h2 id="example-usage">
  Example usage
</h2>

Examples:

```sql title="Query" theme={null}
SELECT * FROM FORMAT('RowBinaryWithDefaults', 'x UInt32 default 42, y UInt32', x'010001000000')
```

```response title="Response" theme={null}
┌──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`.

<h2 id="format-settings">
  Format settings
</h2>

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

| Setting                                                                                                                               | Description                                                                                                                                                                                                                                              | Default |
| ------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| [`format_binary_max_string_size`](/reference/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`](/reference/settings/formats#input_format_binary_decode_types_in_binary_format) | Allows to write types in header using [`binary encoding`](/reference/data-types/data-types-binary-encoding) instead of strings with type names in [`RowBinaryWithNamesAndTypes`](/reference/formats/RowBinary/RowBinaryWithNamesAndTypes) output format. | `false` |
| [`input_format_binary_decode_types_in_binary_format`](/reference/settings/formats#input_format_binary_decode_types_in_binary_format)  | Allows to read types in header using [`binary encoding`](/reference/data-types/data-types-binary-encoding) instead of strings with type names in [`RowBinaryWithNamesAndTypes`](/reference/formats/RowBinary/RowBinaryWithNamesAndTypes) input format.   | `false` |
| [`output_format_binary_write_json_as_string`](/reference/settings/formats#output_format_binary_write_json_as_string)                  | Allows to write values of the [`JSON`](/reference/data-types/newjson) data type as `JSON` [String](/reference/data-types/string) values in [`RowBinary`](/reference/formats/RowBinary/RowBinary) output format.                                          | `false` |
| [`input_format_binary_read_json_as_string`](/reference/settings/formats#input_format_binary_read_json_as_string)                      | Allows to read values of the [`JSON`](/reference/data-types/newjson) data type as `JSON` [String](/reference/data-types/string) values in [`RowBinary`](/reference/formats/RowBinary/RowBinary) input format.                                            | `false` |
