Skip to content

tab_separated_with_names ​

Description ​

Escaped tab-separated fields with a first row of column names.

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

The first escaped tab-separated row contains names, followed by ordinary data rows. Input can match names to destination columns using the format's header settings.

There is no type row. Use the names-and-types variant when type metadata must be checked as part of the import.

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

Example usage ​

sql
SELECT CAST(7 AS Int64) AS id, 'Ada' AS name FORMAT tab_separated_with_names;
text
id	name
7	Ada

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.
snappy_mode String basic Read Snappy client files as basic (Hadoop blocks) or framed (standard streaming format).
tab_separated_crlf Bool 0 End each written row with a carriage return and a line feed instead of a line feed.
tab_separated_empty_as_default Bool 0 Give an empty field the column's DEFAULT instead of reading it as empty text.
tab_separated_enum_by_number Bool 0 Read a whole number in an Enum column as the label's number instead of its name.
tab_separated_match_names Bool 1 Match input names to target columns ignoring ASCII case; when off, skip the names header and read in target order.
tab_separated_null_text String \N The field text that stands for NULL when reading and writing; it cannot contain tabs or line breaks.
tab_separated_skip_lines UInt64 0 Ignore this many lines at the start of the input, before any header row.
tab_separated_uneven_rows Bool 0 Accept rows with too few or too many fields: missing fields take the column's DEFAULT and extra fields are dropped.