All quickstartsDocumentation Index
Fetch the complete documentation index at: https://private-7c7dfe99-page-updates.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
BeginnerReal-Time AnalyticsData WarehousingObservabilityAI/MLCloud
Prerequisites
You should also have completed the following quickstarts:- Create your first Cloud service - you’ll need a running ClickHouse Cloud service to insert data into
- Obtain your Cloud connection details - you’ll need your hostname, username and password to connect
What you’ll build
In this quickstart you’ll use clickhouse-client - the official ClickHouse CLI client - to insert data from a local CSV file into a ClickHouse Cloud service. You’ll install clickhouse-client, prepare a sample dataset, connect to your Cloud service, create a table, and insert data from your local machine. By the end, you’ll know how to use clickhouse-client to load local files into ClickHouse Cloud, a workflow that works with CSV, Parquet, JSON, and many other formats.Install clickhouse-client
clickhouse-client is the official CLI for connecting to ClickHouse. It is included in the ClickHouse binary.Install it using the universal installer:clickhouse binary into your current directory. Verify the installation:clickhouse-client is ready to use.Prepare a sample CSV file
Create a small sample CSV file so this quickstart is self-contained. Run the following in your terminal:Connect to your Cloud service
The commands below assume you’ve exportedCLICKHOUSE_HOST, CLICKHOUSE_USER, and CLICKHOUSE_PASSWORD as environment variables, as described in the Obtain your Cloud connection details quickstart. If you haven’t, you can replace them with your values directly.Test connectivity by running a simple query against your Cloud service:1 printed to the terminal. If you get a connection error, check that your service is awake in the Cloud console and that your hostname and password are correct.Port
9440 is the secure native protocol port for ClickHouse Cloud. The --secure flag enables TLS encryption. These are required for all Cloud connections.Create a target table and insert data
First, create a table on your Cloud service to receive the data:clickhouse-client reads the file from stdin and streams it to the remote service:clickhouse-client sends the contents of the CSV file directly to your Cloud service. The CSVWithNames format tells ClickHouse that the first row contains column headers.Verify the data was inserted
Query your Cloud service to confirm the rows arrived:10 - the number of rows in the sample CSV.Preview the data:FORMAT clause and pipe in the appropriate file.Next steps
In this quickstart you installedclickhouse-client, connected it to a ClickHouse Cloud service, and used it to stream data from a local CSV file into the Cloud. This same approach works for Parquet, JSON, and dozens of other formats.
Check out the following quickstarts next:
Or go deeper with the reference documentation:
