# tab_separated_raw

## Description

Tab-separated fields without outer escaping or an output header. Literal tabs and newlines in data can change record boundaries; choose an escaped format for such values.

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

The outer field values are written without tab-separated escaping. This is suitable only when the consumer can interpret those bytes and embedded delimiters are controlled.

Literal tabs or newlines can change the apparent field and row boundaries. Choose tab_separated when values can contain those characters and must round-trip through an escaped representation.

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

## Example usage

```sql
SELECT CAST(7 AS Int64) AS id, 'Ada' AS name FORMAT tab_separated_raw;
```

```text
7	Ada
```

## Format settings

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

| Setting                          | Type     | Default | Meaning                                                                                                             |
| -------------------------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| `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_detect_header`    | `Bool`   | `1`     | Recognize a raw TSV names header and optional matching types header before reading data.                            |
| `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_null_text`        | `String` | `\N`    | The field text that stands for NULL when reading and writing; it cannot contain tabs or line breaks.                |
| `tab_separated_read_crlf`        | `Bool`   | `0`     | Accept carriage-return/line-feed endings in raw TSV input, removing the carriage return from each record.           |
| `tab_separated_skip_empty_lines` | `Bool`   | `0`     | Ignore empty lines at the end of raw TSV input; empty lines inside the data remain records.                         |
| `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. |
