Skip to main content
Skip to main content
Edit this page

RowBinaryWithDefaults

InputOutputAlias
✔✗

Description​

Similar to the RowBinary format, but with an extra byte before each column that indicates if the default value should be used.

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​

The following settings are common to all RowBinary type formats.

SettingDescriptionDefault
format_binary_max_string_sizeThe maximum allowed size for String in RowBinary format.1GiB
output_format_binary_encode_types_in_binary_formatAllows to write types in header using binary encoding instead of strings with type names in RowBinaryWithNamesAndTypes output format.false
input_format_binary_decode_types_in_binary_formatAllows 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_stringAllows to write values of the JSON data type as JSON String values in RowBinary output format.false
input_format_binary_read_json_as_stringAllows to read values of the JSON data type as JSON String values in RowBinary input format.false