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

> 关于 RowBinaryWithDefaults 格式的文档

# RowBinaryWithDefaults

| 输入 | 输出 | 别名 |
| -- | -- | -- |
| ✔  | ✗  |    |

<div id="description">
  ## 说明
</div>

与 [`RowBinary`](/zh/reference/formats/RowBinary/RowBinary) 格式类似，但在每一列前都会额外加上一个字节，用于指示是否使用默认值。

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

示例：

```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 │
└────┴───┘
```

* 对于列 `x`，只有一个字节 `01`，表示应使用默认值，且该字节之后不再有其他数据。
* 对于列 `y`，数据以字节 `00` 开始，表示该列有实际值，应从后续的 `01000000` 中读取。

<div id="format-settings">
  ## 格式设置
</div>

以下设置适用于所有 `RowBinary` 类型的格式。

| Setting                                                                                                                                  | Description                                                                                                                                                                                            | Default |
| ---------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------- |
| [`format_binary_max_string_size`](/zh/reference/settings/formats#format_binary_max_string_size)                                          | `RowBinary` 格式中 String 的最大允许大小。                                                                                                                                                                        | `1GiB`  |
| [`output_format_binary_encode_types_in_binary_format`](/zh/reference/settings/formats#input_format_binary_decode_types_in_binary_format) | 允许在请求头中使用[`binary encoding`](/zh/reference/data-types/data-types-binary-encoding)写入类型，而不是在[`RowBinaryWithNamesAndTypes`](/zh/reference/formats/RowBinary/RowBinaryWithNamesAndTypes)输出格式中使用包含类型名称的字符串。 | `false` |
| [`input_format_binary_decode_types_in_binary_format`](/zh/reference/settings/formats#input_format_binary_decode_types_in_binary_format)  | 允许在请求头中使用[`binary encoding`](/zh/reference/data-types/data-types-binary-encoding)读取类型，而不是在[`RowBinaryWithNamesAndTypes`](/zh/reference/formats/RowBinary/RowBinaryWithNamesAndTypes)输入格式中使用包含类型名称的字符串。 | `false` |
| [`output_format_binary_write_json_as_string`](/zh/reference/settings/formats#output_format_binary_write_json_as_string)                  | 允许在[`RowBinary`](/zh/reference/formats/RowBinary/RowBinary)输出格式中，将[`JSON`](/zh/reference/data-types/newjson)数据类型的值写为 `JSON` [String](/zh/reference/data-types/string) 值。                               | `false` |
| [`input_format_binary_read_json_as_string`](/zh/reference/settings/formats#input_format_binary_read_json_as_string)                      | 允许在[`RowBinary`](/zh/reference/formats/RowBinary/RowBinary)输入格式中，将[`JSON`](/zh/reference/data-types/newjson)数据类型的值读取为 `JSON` [String](/zh/reference/data-types/string) 值。                              | `false` |
