row_binary_with_names
Description
A binary column count and column-name header followed by positional binary rows. Input can bind header names to target columns.
Input and output. Select it with FORMAT row_binary_with_names. Names ignore ASCII case; use the snake_case name shown here.
A column count and name strings precede the ordinary row_binary payload. The default name matching binds fields without regard to ASCII case; its positional mode reads in target order.
Names alone do not describe value widths. The import must still have compatible target types. Use the names-and-types variant when type declarations should travel in the header too.
SELECT expressions FORMAT row_binary_with_names;
INSERT INTO table [(columns)] [SETTINGS ...] FORMAT row_binary_with_names
<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.
./coordinator client --database data --query "SELECT CAST(7 AS Int64) AS id FORMAT row_binary_with_names" > sample.row_binary_with_names
./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" < sample.row_binary_with_names > /dev/null
./coordinator client --database data --query "SELECT id FROM format_import FORMAT csv"7Create 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 |
|---|---|---|---|
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_json_strings |
Bool |
0 |
Read JSON fields as length-prefixed JSON text; binary JSON paths are unsupported. |
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). |