Skip to main content
How-to guide
The TSV connector uses a tab as its default field separator. It reads files with or without headers and writes datasets with append or whole-dataset overwrite.

Before you start

Prepare file access and a client connection using Read and write files. Prepare two columns named order_id and amount, with data rows (1, 12.5) and (2, 7.5). Put an actual tab between fields in each record.

Read data with headers

Enable headers explicitly. The default is false. With header 'true', the first record supplies column names and is excluded from the data.
Expect two rows: (1, 12.5) and (2, 7.5). The header must match the explicit schema in both names and order. Omit the column list and set inferSchema 'true' to infer types from a bounded sample instead.

Read data without headers

Supply column names and types, and leave headers disabled:

Write data

Use the shared guide’s spark connection and a private mounted output directory.
Each part file has its own header when header is enabled. Use mode("append") to add rows with the same schema and compatible parsing settings.

Options

Use the shared file options for folder filtering and storage access. No delimiter option is needed for normal TSV input.

Data types and limits

An explicit schema converts text fields to the selected types. Without a schema or type inference, discovered columns are strings. Keep header names, order, and field types consistent across a folder. Quoted newlines are supported directly. multiLine is not a TSV option. Row updates, deletes, and merges are not supported by the file sink. Use a table connector when rows need those changes.
Last modified on November 23, 2026