Insert with the native client
Use the supplied coordinator client to insert literal rows or send rows from a local file. Its native protocol is CoordinatorDB-specific; a ClickHouse client cannot connect to it.
Start a server and open ./coordinator client --database data before running the SQL below.
Create a destination table
CREATE TABLE people(id UInt64, name String);Insert literal values
INSERT INTO people VALUES (1, 'Ada'), (2, 'Grace');SELECT id, name
FROM people
ORDER BY id
FORMAT csv;1,"Ada"
2,"Grace"Load a client-side file
From a terminal in the directory containing the executable, create a CSV file and load it:
printf '3,Linus\n' > people.csv
./coordinator client --database data --query "INSERT INTO people FROM INFILE 'people.csv' FORMAT csv" > /dev/nullThe file is read on the client machine. Relative paths use the client's working directory. Every matched file retains its own headers or container boundary during decoding.
A subsequent query of people includes (3, 'Linus'). The UInt64 and String declarations validate file values just as they validate SQL values.
See INSERT INTO and batch inserts for stdin, compressed files and larger inputs.