Import and export ClickHouse data

Export to CSV, JSON, SQL, XLSX, Markdown or Parquet, and import files by append in confirmed batches, with no transaction.

Export writes CSV, JSON, SQL, XLSX and Markdown through the same writer as the other engines. A table export is one streaming read with your filter and sort order. It is a fresh read, not a snapshot. If the server fails midway, the job fails and the earlier file is left alone. A console result is exported from the rows already on screen, without running the query again. CSV and Excel files neutralize text that a spreadsheet would run as a formula, unless you turn that off.

Parquet export is produced by the server with FORMAT Parquet, so column types are kept and cancelling stops the query on the server. A column whose type cannot make a safe round trip in SQL is refused by name, and Tablyne never guesses a CAST.

Import appends rows only. ClickHouse has no replace-on-insert, so replace and upsert modes are blocked in the preview. Rows go in batches of up to 10,000 rows or 8 MiB. Each batch is confirmed by the server. There is no transaction across batches. If one fails, the earlier ones stay written. If the answer to a batch never arrives, Tablyne marks the outcome as uncertain and does not resend it.

A NULL for a column that does not accept NULL is an error, not a silent default. Tablyne does not write to ALIAS, MATERIALIZED or EPHEMERAL columns, or to engines that reach outside the server. The preview lists materialized views that receive every batch.

A new table made by import uses MergeTree with ORDER BY tuple() and Nullable columns. Adjust the key later.

Parquet files can be imported directly. The file streams to the server, which matches columns by name. There is no preview and no column mapping, and the import is not all-or-nothing.

A logical copy saves a database to a .chcopy.gz file and restores it into an empty database. It is not a backup and not a snapshot, and tables left out are listed with the reason.