Skip to content

Import Data

Download the previous example dataset.


Currently, the brahmand-client and HTTP interface do not support data import. You must use the ClickHouse client to load data directly into your ClickHouse tables. Native import functionality is planned for a future release.

Considering you are running brahmand with the docker compose configuration, use following commands to import the data.

First, copy your downloaded CSVs into the same folder as your docker-compose.yml. Then, from that folder, run:

Terminal window
docker compose exec -T clickhouse-service \
clickhouse-client --database=brahmand \
--query="INSERT INTO User FORMAT CSVWithNames" < node_users.csv
Terminal window
docker compose exec -T clickhouse-service \
clickhouse-client --database=brahmand \
--query="INSERT INTO Post FORMAT CSVWithNames" < node_posts.csv
Terminal window
docker compose exec -T clickhouse-service \
clickhouse-client --database=brahmand \
--query="INSERT INTO FOLLOWS FORMAT CSVWithNames" < rel_follows.csv
Terminal window
docker compose exec -T clickhouse-service \
clickhouse-client --database=brahmand \
--query="INSERT INTO POSTS FORMAT CSVWithNames" < rel_posts.csv
Terminal window
docker compose exec -T clickhouse-service \
clickhouse-client --database=brahmand \
--query="INSERT INTO LIKES FORMAT CSVWithNames" < rel_likes.csv

Considering you are running brahmand with the docker compose configuration, to launch ClickHouse client, use this following command -

Terminal window
docker compose exec clickhouse-service clickhouse-client \
--host clickhouse-service \
--port 9000 \
--user test_user \
--password test_pass \
--database brahmand