File formats and preview

The Format step tells the Lake how to read the files of a datasource: the CSV or TSV dialect, the shape of JSON documents, workbook options and how column types are read. Open it while you create a file datasource, or open it again later to change how the source reads its files.

Where the Format step appears

The step is the third of five in the file datasource wizard (General > Source > Format > Tables > Review), and it appears for the CSV, TSV, JSON, Apache Parquet and Excel Workbook source types. The rest of the flow is on Load files.

Each format shows its own options under a heading named after it, for example CSV format, with the preview below. Parquet files carry their own schema and types, so there is nothing to configure for them. The settings take effect when you save; how they apply to files you already stored is covered in When your settings apply.

Note

The standalone Amazon S3 source has a Format step of its own, with a different list of file types; it is described on Connect Amazon S3.

Set the CSV or TSV dialect

The dialect settings shape how delimited text is read. TSV starts from a tab delimiter; everything else below is shared with CSV. A new source starts with Auto-detect for the delimiter, header and encoding, no skipped rows, a double quote character, the 1,234.56 number format and the Day / Month / Year date order.

Null values

Null values lists the strings that mean "no value": type a value and press Enter to add it, or pick one of the suggestions, (empty), NULL, N/A and -. The empty string appears as (empty). Press Backspace on an empty input to remove the last chip, or use the remove control on a chip to remove that one.

Strict TSV

TSV sources offer Strict TSV: Read files as ClickHouse TSV: values escaped with backslashes and never quoted. While it is on, the delimiter is fixed to tab, the step shows Strict TSV: tab separated, backslash escapes, no quoting. in place of the delimiter field, and the quote character field is hidden.

Choose how column types are read

Every format except Parquet ends with Load all columns as String: Skip type detection; every value is kept exactly as written. Groups can override this. Turn it on when you do not want the Lake to guess types for the files. A table group can change the choice for itself on the Tables step; see Group files into tables.

Shape JSON files

JSON sources show a shape editor instead of a dialect:

  1. Shape picks how records sit in the document: Auto-detect, JSON Lines (one record per line), Top-level array, Object with a records array, Object map (one record per key) or Single object per file. With Auto-detect, a loaded document adds Looks like: {shape}.
  2. Record path points at the array that holds the records, for example data.items. Click Use as records on an array in the document tree, or type the path; the field takes the value on blur or Enter, and clearing it returns to the shape default. The help text under the field reads Click an array in the document to load each of its items as a row.
  3. The document tree shows the first stored document. Arrays appear as [n], objects as {n}, and the top is named document. The chosen array carries a Records badge; tick a scalar value to carry it into every record. Until a document is ready, the panel reads The first document appears here once a file is ready. You can still type the record path.
  4. Carried into every record lists the values you ticked, each with a column name that starts from its path (joined with _). Rename a column in place or stop carrying the value.
  5. Flatten depth sets how deep nested objects become separate columns; nested names join with _. A value deeper than the chosen depth, or a nested container such as an array, is kept as text rather than split further. The range is 1 to 5 and the default is 3.
  6. Schemaless (one _raw column) keeps each record in a single _raw column instead of separate columns; Flatten depth is disabled while it is on.

These settings are the defaults for every table group, as the step notes: These settings are the defaults for every table group; a group can override them on the Tables step. A group that overrides them shows (custom for this group) and can go back with Reset to format defaults; see Group files into tables.

Set Excel workbook options

An Excel Workbook source gets two switches and a list of per-workbook overrides. Both switches start off.

Check the preview

The preview sits below the settings and shows what the Lake will read from the current files:

When your settings apply

Limits and edge cases

For the messages you may see while you set up a file source, read Lake troubleshooting.

Questions, answered

Which delimiters can I choose?

Auto-detect, Comma ( , ), Semicolon ( ; ), Pipe ( | ), Tab, or Other... to type your own. In Auto-detect, the preview sample decides. A custom delimiter can be up to 16 characters and cannot contain line breaks or quote characters.

How do I skip extra rows at the top or bottom of a file?

Set Skip rows before header for rows above the header and Skip footer rows for rows at the end. Each takes 0 to 1000. On an existing source, a footer change applies to newly added files only; stored files keep their current footer handling.

How do I make empty strings or values like N/A load as NULL?

Add them to Null values: type the value and press Enter, or pick a suggestion ((empty), NULL, N/A, -). The empty string shows as (empty). Press Backspace on an empty input to remove the last chip.

What is Strict TSV?

A TSV setting that reads files as ClickHouse TSV: values escaped with backslashes and never quoted. While it is on, the delimiter is fixed to tab and the quote character field is hidden.

My file is not UTF-8. Which encoding do I choose?

Pick the file's real encoding under Encoding, or leave Auto-detect to guess it. Files are converted to UTF-8 when they are stored.

I changed the encoding after some files were stored. Will they be read again?

In a new source, files you already uploaded are read again with the new encoding after you save. On an existing source, the change applies to newly added files only; stored files keep their current conversion.

What do the JSON shape options mean?

JSON Lines (one record per line) reads one JSON object per line. Top-level array reads one array whose items are the records. Object with a records array reads a wrapper object and needs the array's path (the next question covers it). Object map (one record per key) turns each key's value into a record. Single object per file reads the whole file as one record. Auto-detect guesses and reports Looks like: {shape}.

What is the record path for?

It points at the array that holds the records inside a JSON document, for example data.items. Click Use as records on an array in the document tree, or type the path yourself; the value is taken on blur or Enter, and clearing it returns to the shape default.

What does flatten depth do?

It sets how deep nested objects become their own columns; nested names join with _. A value deeper than the chosen depth, or a nested container such as an array, is kept as text at the cut. Choose 1 to 5; the default is 3, and the control is disabled while Schemaless is on.

What does Schemaless do?

It keeps each record in a single _raw column instead of separate columns. Flatten depth is disabled while it is on.

Why does my workbook override row never apply?

Read the line under the row. Matches {names}, but {rows} already apply first. means an earlier row already claims those workbooks, and the first matching row wins. Same as row {n}, so this row never applies means the pattern repeats an earlier row. Move the row up, or change or remove its pattern.

Why is the preview empty?

Four states. Loading preview... means it is still loading. Add files on the Source step to see a preview means the source has no files yet. Waiting for files to finish processing means the files are uploaded but not ready. No rows to preview means the ready files produced no rows; recheck the format settings and the file itself.