Skip to content

row_binary_with_names_and_types ​

Description ​

A binary column count, names and type declarations followed by positional binary rows. Input validates names and types with the configured header settings. JSON fields require the explicit JSON-string mode.

Input and output. Select it with FORMAT row_binary_with_names_and_types. Names ignore ASCII case; use the snake_case name shown here.

The header carries a column count, names and types before the row_binary values. Type names are textual by default; the binary-type options select tags and binary parameters instead.

Input checks header types by default. Disabling the check decodes matched fields using the target widths, so compatibility is still required. JSON fields need the explicit read/write JSON-string modes.

text
SELECT expressions FORMAT row_binary_with_names_and_types;
INSERT INTO table [(columns)] [SETTINGS ...] FORMAT row_binary_with_names_and_types
<data>

Example usage ​

Use the native client's --query mode to preserve binary output bytes. The server must be running, the executable available as ./coordinator, and database data selected.

sh
./coordinator client --database data --query "SELECT CAST(7 AS Int64) AS id FORMAT row_binary_with_names_and_types" > sample.row_binary_with_names_and_types
./coordinator client --database data --query "CREATE TABLE format_import(id Int64)" > /dev/null
./coordinator client --database data --query "INSERT INTO format_import FORMAT row_binary_with_names_and_types" < sample.row_binary_with_names_and_types > /dev/null
./coordinator client --database data --query "SELECT id FROM format_import FORMAT csv"
text
7

Create format_import in a fresh database before running this example.

Format settings ​

Use a statement SETTINGS clause; these options are not persisted by SET.

Setting Type Default Meaning
ignore_unknown_fields Bool 0 Skip input keys and header names that match no target column instead of failing.
row_binary_check_types Bool 1 Compare input header types with target types; when off decode matched fields with target widths.
row_binary_match_names Bool 1 Match input header names ignoring ASCII case; when off read in target column order.
row_binary_max_string_bytes UInt64 1073741824 Maximum bytes in an input variable-length string, including header names and type parameters; 0 disables the limit.
row_binary_read_binary_types Bool 0 Read type tags and their binary parameters instead of textual type names in the input header.
row_binary_read_json_strings Bool 0 Read JSON fields as length-prefixed JSON text; binary JSON paths are unsupported.
row_binary_write_binary_types Bool 0 Write type tags and their binary parameters instead of textual type names in the output header.
row_binary_write_json_strings Bool 0 Write JSON fields as length-prefixed JSON text; binary JSON paths are unsupported.
snappy_mode String basic Read Snappy client files as basic (Hadoop blocks) or framed (standard streaming format).