Skip to main content

clickhouse-client and clickhouse-local

clickhouse-client is a client application that is used to connect to ClickHouse from the command line. clickhouse-local is a client application that is used to query files on disk and across the network. Many of the guides in the ClickHouse documentation will have you examine the schema of a file (CSV, TSV, Parquet, etc.) with clickhouse-local, query the file, and even manipulate the data from the file in order to prepare it for insertion into ClickHouse. We will often have you query a file with clickhouse-local and pipe the output to clickhouse-client to stream the data into ClickHouse. There are example datasets that use both clickhouse-client and clickhouse-local in the Next Steps section at the end of this document.

tip

If you have already installed ClickHouse server locally you may have clickhouse-client and clickhouse local installed. Check by running clickhouse client and clickhouse local at the commandline. Otherwise follow the instructions for your operating system.

Install clickhouse-client and clickhouse-local

Install the clickhouse-client package:

sudo apt-get install -y apt-transport-https ca-certificates dirmgr
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 8919F6BD2B48D754
echo "deb https://packages.clickhouse.com/deb stable main" | sudo tee /etc/apt/sources.list.d/clickhouse.list
sudo apt-get update
sudo apt-get install -y clickhouse-client

Verify that the commands are in your path:

which clickhouse-client
which clickhouse-local

Next Steps

See the NYPD Complaint dataset for example use of both clickhouse-client and clickhouse-local.

See the clickhouse-client docs.

See the clickhouse-local docs.