Requirements
You will need:-
A ClickHouse server that Unstructured can reach over ClickHouse’s HTTP or HTTPS interface. The connector does not use the native TCP protocol. The connector supports two kinds of deployment:
- ClickHouse Cloud: Use your service’s hostname and port
8443. Connections to ClickHouse Cloud always use TLS. - Self-managed ClickHouse (on-premises or in your own cloud account): Use your server’s hostname, plus port
8123for plain HTTP or port8443for HTTPS. If a private certificate authority (CA) signed your server’s TLS certificate, you also need that CA’s certificate as PEM text.
Timed out connecting to ClickHouse. Check the host, port, TLS setting and firewall rules. - ClickHouse Cloud: Use your service’s hostname and port
- The ClickHouse user’s name and password. If the user has no password, the password can be empty.
- The name of the database that contains the table. Database and table names cannot contain a backtick, single quote, or backslash.
-
The name of the table to read.
The user needs the
SELECTprivilege on the table: -
A table with key columns that identify each row.
By default, the connector uses the table’s sorting key (the
ORDER BYclause) as the key columns. The sorting key must consist of plain, non-nullable scalar columns, not expressions. If the table has no usable sorting key, you can name the key columns in the connector’s settings instead. The connector reads the table in key order and groups the keys into batches. Each batch is one record, and the connector stores each row of a batch as its own JSON file. The key columns must identify one row. If more than one row has the same key values, the run fails withMore than one row has the same value for the key columns (<key columns>). Set the key columns to columns that identify one row.ClickHouse does not require a sorting key to be unique, so the default key columns can fail on a plainMergeTreetable. Set Key columns (key_columns) to a unique column or a combination such as(tenant, id). The connection test does not check the table for equal key values. The run checks them as it reads. For tables that use theReplacingMergeTree,CollapsingMergeTree, orVersionedCollapsingMergeTreeengine families (including theReplicatedandSharedvariants), the connector reads withFINAL.FINALapplies the engine’s merge rules. ForReplacingMergeTree, it returns the latest version of each row. The Collapsing engines drop cancelled rows, so the connector does not read a key whose rows cancel out. If the key columns are exactly the sorting key of such a table, rows with equal key values are versions of one row, and the run does not fail. The connector does not useFINALfor other engines, such asSummingMergeTreeandAggregatingMergeTree. The connector builds each query from bound parameters. It does not support a free-formWHEREfilter, so it reads the whole table. Column names cannot contain a backtick, single quote, or backslash. Incremental sync is not available. Every run reads the whole table, so the Version column (version_column) and Incremental overlap (s) (overlap_seconds) settings do not change which rows the connector reads.
Create the connector
Open the sources list
Start a new connector
Name the connector
Choose the provider
Fill in the fields
Save the connector
- Name (required): A unique name for this connector.
- Host (required): The ClickHouse server’s hostname or IP address, without a scheme or path. For ClickHouse Cloud, this is the service’s hostname.
- Port: The HTTP(S) interface port. The default is
8443. Use8443for ClickHouse Cloud and for self-managed servers with TLS, or8123for a self-managed server without TLS. - Use TLS: Switch on to connect over HTTPS, or off to connect over plain HTTP. The default is on. Keep this on for ClickHouse Cloud. For a self-managed server on port
8123, switch it off. - Username: The ClickHouse user. The default is
default. - Password (required): The user’s password. If the user has no password, enter an empty value and confirm that the connection test passes.
- Database: The database that contains the table. The default is
default. - Verify TLS certificate: Switch on to verify the server’s certificate, or off to skip verification. The default is on. Switch it off only for testing.
- CA certificate: The PEM text of a private CA certificate that signed the server’s certificate. The text must contain
-----BEGIN CERTIFICATE-----. Leave it empty if a public CA signed the certificate. - Connect timeout (s): The number of seconds to wait to open a connection. The default is
30. A paused ClickHouse Cloud service must wake up first, so raise this value if the first connection after a long idle period times out. - Read timeout (s): The number of seconds to wait for the server between reads. The default is
300.
- Table (required): The table to read.
- Key columns: The columns that identify a row, in the order the connector pages through the table. No two rows can have the same values, or the run fails. By default, the connector uses the table’s sorting key, which must consist of plain columns. ClickHouse does not require a sorting key to be unique. Set this field unless the table uses a
Replacing,Collapsing, orVersionedCollapsingMergeTreeengine keyed by its sorting key. - Version column: A
DateorDateTimecolumn that changes when a row changes. Incremental sync is not available. Every run reads the whole table, so this setting does not change which rows the connector reads. The connector still checks that the column exists and is aDateorDateTimecolumn. - Rows per batch: The number of rows that the connector fetches in one download step and holds in memory at once. The default is
500, and the maximum is1000. The limit applies to rows, not bytes, so lower it for wide rows or large columns. - Page size: The number of rows to read per query. The default is
10000. - Incremental overlap (s): The number of seconds to re-read when syncing incrementally. The default is
0. Incremental sync is not available, so this setting has no effect.
- ClickHouse Cloud
- Self-managed
- Host: Your service’s hostname.
- Port:
8443. - Use TLS: On.
- Verify TLS certificate: On.
- CA certificate: Leave empty.
Troubleshooting
ClickHouse rejected the username or password
ClickHouse rejected the username or password
ClickHouse rejected the username or password.Cause: The username or password does not match a ClickHouse user.Solution: Check the Username (username) and Password (password) values. If the user has no password, test with an empty Password and confirm the connection test passes.Timed out connecting to ClickHouse
Timed out connecting to ClickHouse
Timed out connecting to ClickHouse. Check the host, port, TLS setting and firewall rules.Cause: Unstructured could not open a connection to the host and port before the connect timeout expired. Possible causes:- A firewall or IP access list blocks the connection.
- The port or TLS setting does not match the server.
- A paused ClickHouse Cloud service did not wake up in time.
port) and Use TLS (secure) match your deployment (8443 with TLS, or 8123 without). Allow connections from Unstructured through any firewall or IP access list.
For ClickHouse Cloud, raise Connect timeout (s) (connect_timeout) if the first connection after a long idle period fails.Could not reach the provider
Could not reach the provider
Could not reach the provider. Check network egress, DNS, and firewall rules.Cause: The hostname does not resolve, or the host is unreachable from Unstructured.Solution: Check that Host (host) is correct, is a bare hostname, and is reachable from Unstructured.The ClickHouse settings are not valid
The ClickHouse settings are not valid
The ClickHouse settings are not valid. followed by the field path and reason, for example connector_config.host: Value error, host must be a bare hostname or IP address or connector_config.ca_cert: Value error, ca_cert must be PEM text.Cause: A connection field value does not meet the connector’s validation rules.Solution: Enter only the hostname in Host (host), with no scheme (https://), path, or credentials. Paste the full PEM text, including the -----BEGIN CERTIFICATE----- line, in CA certificate (ca_cert).Batch size is above the limit
Batch size is above the limit
The ClickHouse settings are not valid. followed by indexer_config.batch_size: Value error, batch_size must be at most 1000. and a longer explanation.Cause: Rows per batch (batch_size) is above the limit of 1000 rows.Solution: Set Rows per batch (batch_size) to 1000 or less.ClickHouse denied the operation
ClickHouse denied the operation
ClickHouse denied the operation. Check the user's grants on the database and table.Cause: The user lacks the SELECT privilege that reading the table needs.Solution: Grant SELECT on the table.ClickHouse could not find the database, table or column
ClickHouse could not find the database, table or column
ClickHouse could not find the database, table or column. Check the names in the settings. or The ClickHouse table was not found, or the user cannot read it.Cause: A database, table, or column name is wrong, or the user cannot read the table.Solution: Check the Database (database), Table (table), Key columns (key_columns), and Version column (version_column) values. Confirm that the user has SELECT on the table.None of the requested rows were found
None of the requested rows were found
None of the requested rows were found in ClickHouse.Cause: None of the rows that the run requested exist in the table when the download reads it.Solution: Check that the rows still exist in the table, and then run the workflow again.The source table has no usable key
The source table has no usable key
The table has no sorting key. Set the key columns in the settings.The table's sorting key contains an expression. Set the key columns in the settings.Key column '<name>' is nullable; key columns must not be nullable.Key column '<name>' must be a plain scalar type.The key columns contain a duplicate.Key column '<name>' does not exist or cannot be read.
key_columns) to plain, non-nullable columns that identify each row.More than one row has the same key values
More than one row has the same key values
More than one row has the same value for the key columns (<key columns>). Set the key columns to columns that identify one row.Cause: The key columns do not identify one row. By default, the key columns are the table’s sorting key, and ClickHouse does not require a sorting key to be unique. The connector accepts equal key values only when the table uses a ReplacingMergeTree, CollapsingMergeTree, or VersionedCollapsingMergeTree engine and the key columns are exactly its sorting key.Solution: Set Key columns (key_columns) to a column or combination of columns that has a different value in every row, such as (tenant, id).The version column is rejected
The version column is rejected
Version column '<name>' does not exist or cannot be read. or The version column must be a Date or DateTime column.Cause: The column does not exist, the user cannot read it, or it is not a Date or DateTime column.Solution: Set Version column (version_column) to a Date or DateTime column that the user can read, or leave it empty.
