Eduard Pelivan
Eduard Pelivan

Reputation: 1

inserts in ClickHouse database

currently I'm using ClickHouse database and I have some trouble in inserting data to database. Question: how to insert data from file(insert script) in ClickHouse database

Upvotes: 0

Views: 989

Answers (1)

simPod
simPod

Reputation: 13456

With clickhouse-client:

cat data.csv | clickhouse-client --query="INSERT INTO data FORMAT CSV";

Or via http interface

cat data.csv | curl http://localhost:8123/?query=INSERT%20INTO%20default.data%20FORMAT%20CSV' --data-binary @-

For the POST requests, you can pass your data directly in request body which is more suitable for large datasets.

Upvotes: 4

Related Questions