RowBinary
Input | Output | Alias |
---|---|---|
✔ | ✔ |
Description
The RowBinary
format parses data by row in binary format.
Rows and values are listed consecutively, without separators.
Because data is in the binary format the delimiter after FORMAT RowBinary
is strictly specified as follows:
- Any number of whitespaces:
' '
(space - code0x20
)'\t'
(tab - code0x09
)'\f'
(form feed - code0x0C
)
- Followed by exactly one new line sequence:
- Windows style
"\r\n"
- or Unix style
'\n'
- Windows style
- Immediately followed by binary data.
Note
This format is less efficient than the Native format since it is row-based.
For the following data types it is important to note that:
- Integers use fixed-length little-endian representation. For example,
UInt64
uses 8 bytes. - DateTime is represented as
UInt32
containing the Unix timestamp as the value. - Date is represented as a UInt16 object that contains the number of days since
1970-01-01
as the value. - String is represented as a variable-width integer (varint) (unsigned
LEB128
), followed by the bytes of the string. - FixedString is represented simply as a sequence of bytes.
- Arrays are represented as a variable-width integer (varint) (unsigned LEB128), followed by successive elements of the array.
For NULL support, an additional byte containing 1
or 0
is added before each Nullable value.
- If
1
, then the value isNULL
and this byte is interpreted as a separate value. - If
0
, the value after the byte is notNULL
.
Example Usage
Format Settings
The following settings are common to all RowBinary
type formats.
Setting | Description | Default |
---|---|---|
format_binary_max_string_size | The maximum allowed size for String in RowBinary format. | 1GiB |
output_format_binary_encode_types_in_binary_format | Allows to write types in header using binary encoding instead of strings with type names in RowBinaryWithNamesAndTypes output format. | false |
input_format_binary_encode_types_in_binary_format | Allows to read types in header using binary encoding instead of strings with type names in RowBinaryWithNamesAndTypes input format. | false |
output_format_binary_write_json_as_string | Allows to write values of the JSON data type as JSON String values in RowBinary output format. | false |
input_format_binary_read_json_as_string | Allows to read values of the JSON data type as JSON String values in RowBinary input format. | false |