Skip to main content

Description

Similar to the RowBinaryWithNamesAndTypes format, but with an extra byte before each cell that indicates whether the column’s DEFAULT value should be used — exactly like in the RowBinaryWithDefaults format. This combination supports schema-evolving INSERTs: the writer can omit columns from the header (they receive the target column’s DEFAULT) and, for any column it does send, it can mark individual cells as “use the column’s DEFAULT” without conflating that with NULL. This format is input only.

Wire format

The header is identical to RowBinaryWithNamesAndTypes:
  1. A VarUInt with the number of columns N.
  2. N length-prefixed Strings with column names.
  3. N column types — either textual names or compact binary encoding, controlled by the output_format_binary_encode_types_in_binary_format / input_format_binary_decode_types_in_binary_format settings.
After the header, each row consists of N cells. For each cell:
  • A single UInt8 marker byte.
    • 0x01 — use the target column’s DEFAULT expression. No value bytes follow.
    • 0x00 — a value follows, serialized via the column type’s RowBinary serializer. For Nullable(T) the value bytes start with the Nullable null byte (0 for non-null, 1 for NULL), then the inner value if non-null.

Defaults vs NULL

The per-cell default marker and Nullable’s built-in null byte are independent. A Nullable(UInt32) DEFAULT 42 column can be sent three different ways per row:

Schema evolution

Example usage

Query
Response
  • The header carries one column named x of type Nullable(UInt32).
  • The single cell uses marker 0x01, meaning “use DEFAULT 42”.

Format settings

The following settings are common to all RowBinary type formats.
Last modified on July 2, 2026