ClickHouse source
The ClickHouse source reads tables and views from one ClickHouse database through the ClickHouse HTTP interface. It is a Daspire-built connector and runs on the Daspire native runtime.
The ClickHouse source is being rolled out. If it is not yet listed when you add a source, it has not been released yet. Contact Daspire support for the expected date.
Prerequisites
- ClickHouse server version 21 or later (self-managed or ClickHouse Cloud).
- Network access from Daspire to the server's HTTP port:
8123for HTTP or8443for HTTPS. The native TCP port (9000) is not used. - A ClickHouse user that can read the database.
Create a read-only user
We recommend a dedicated read-only user:
CREATE USER daspire_reader IDENTIFIED BY '<strong-password>' SETTINGS readonly = 1;
GRANT SELECT ON <database>.* TO daspire_reader;
readonly = 1 is fully supported: the connector changes no query settings.
Connection fields
| Field | Description |
|---|---|
| Host | Host name or IP address of the server. Do not include http://, a port or a path. |
| HTTP Port | 8123 for HTTP, 8443 for HTTPS (ClickHouse Cloud). |
| Database | The database whose tables you want to sync. |
| Username | The ClickHouse user. |
| Password | The user's password. Leave it empty only for a user that has none. |
| Use HTTPS | Connect over HTTPS with certificate verification. Turn this on for ClickHouse Cloud. |
| Read timeout | Seconds to wait for data from the server (default 300). |
SSH tunnels and JDBC URL parameters are not supported.
Streams
Every table and view in the database becomes a stream, with these exceptions:
- Tables whose names use characters other than letters, digits,
.,_,:or-are skipped. - Queue engines (
Kafka,RabbitMQ,NATS,FileLog,S3Queue,AzureQueue,RedisStreams) are skipped, because reading them consumes messages. Generator engines (GenerateRandom,System*) are skipped too. - The internal storage tables of materialized views (
.inner…) are skipped; the materialized view itself is listed. - The
systemandinformation_schemadatabases cannot be synced.
You can choose which columns to sync for each stream.
Primary keys
ClickHouse does not enforce unique keys. The connector reports a primary key
only for ReplacingMergeTree tables (including replicated and shared
variants), where the sorting key identifies a row. Those tables are read with
FINAL, so each key returns only its latest version, even before ClickHouse
has merged older versions away. For other tables, set the primary key yourself
if you use a deduplicating destination mode.
Sync modes
| Mode | Supported |
|---|---|
| Full Refresh | Yes |
| Incremental (source-defined cursor) | Yes, for tables whose sorting key starts with a suitable column |
| Change data capture | No |
| Deletes | No (use Full Refresh to remove deleted rows) |
Incremental syncs
Daspire chooses the cursor; you can't pick one. A table supports incremental
syncs only when the first column of its sorting key (ORDER BY) is a
non-nullable integer (Int8 to Int64, UInt8 to UInt64), Date, Date32,
DateTime or DateTime64 column, such as an increasing ID or an insert time.
That column becomes the cursor. Every other table offers Full Refresh only.
Because the cursor leads the sorting key, ClickHouse can stream rows in cursor
order without sorting the table first.
Each sync reads rows whose cursor is greater than or equal to the last saved value. Rows that share the saved value are read again, so a row inserted later with the same value is never missed. Use a destination mode that deduplicates, or deduplicate in your queries, to drop those repeats.
Limits of the cursor rule:
- Late rows below the cursor are not picked up. A row inserted later with a cursor value lower than the last saved one (for example a back-dated timestamp) is never read by an incremental sync. Run a Full Refresh to catch such rows.
- Updates and deletes are not tracked. Changing a row without raising its cursor value, or deleting it, is not seen by an incremental sync.
- ReplacingMergeTree tables are read with
FINAL, so each sync returns only the latest version of each key as of that sync. Versions that replaced an earlier row without raising the cursor value are not re-read by later incremental syncs.
Data types
| ClickHouse type | Synced as |
|---|---|
Int8–Int64, UInt8–UInt64 | integer |
Int128, Int256, UInt128, UInt256 | string (exact) |
Decimal(P, S) | string (exact); ClickHouse drops trailing zeros, so 10.00 is synced as "10" |
Float32, Float64 | number; NaN and infinity are synced as null |
Bool | boolean |
String, FixedString, UUID, IPv4, IPv6, Enum | string |
Date, Date32 | string, YYYY-MM-DD |
DateTime, DateTime64 | string, ISO 8601 in UTC, for example 2026-11-26T01:00:00.125Z |
Array(T) | array of the mapped type (Array(DateTime) items in UTC too) |
Map, Tuple, JSON, Nested and other types | as ClickHouse renders them in JSON |
Nullable(T) and LowCardinality(T) map like T; nullable columns can be null.
Troubleshooting
| Error code | Meaning |
|---|---|
authentication_failed | The username or password was rejected. |
permission_denied | The user cannot SELECT from a selected table. |
resource_not_found | The database does not exist. |
invalid_catalog | A selected table, column or cursor no longer exists, or the cursor type is not supported. Refresh the schema. |
provider_timeout, provider_transient_error | The server timed out, ran out of memory or failed while streaming rows. Try again. If it keeps timing out, raise the read timeout or ask Daspire support to check the server's limits. |
provider_transport_error | Daspire could not reach the server, or the connection dropped. |
provider_redirect_rejected | The endpoint answered with a redirect. Use the server's direct address. |