Formats
CoordinatorDB reads rows with INSERT ... FORMAT and writes query results with
SELECT ... FORMAT. A format can support input, output, or both. The default
output format is pretty_compact.
Format names are case-insensitive. Use the snake_case names listed below; ClickHouse CamelCase names are not aliases.
Formats overview
Use format settings in a statement's SETTINGS clause.
These settings apply to one statement and are not persisted by SET. On an
INSERT, put SETTINGS before FORMAT: the bytes after the format name are
input data.
Reading and writing data
Create a destination table:
CREATE TABLE people (id UInt32, name String);Read two CSV rows in a separate request:
INSERT INTO people FORMAT csv
1,Ada
2,GraceWrite the same rows as one JSON object per line:
SELECT id, name FROM people ORDER BY id FORMAT json_each_row;{"id":1,"name":"Ada"}
{"id":2,"name":"Grace"}Inline input occupies the rest of its request. Send later SQL in another request. For client files, see the loading guide.
Format schema
Schema-bearing containers include Arrow, Parquet, Avro, NumPy, and SQLite. Input values must still satisfy the destination column declarations.
The protobuf format uses the statement settings protobuf_schema and
protobuf_message for its inline schema and message name. The
avro_confluent format resolves schema identifiers through its configured
schema registry. See their format pages for complete examples.
A container schema does not replace an explicit server file() schema except
for the input formats that support inference or supply fixed metadata columns.
See file schemas.