Skip to main content

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.

Availability

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: 8123 for HTTP or 8443 for 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​

FieldDescription
HostHost name or IP address of the server. Do not include http://, a port or a path.
HTTP Port8123 for HTTP, 8443 for HTTPS (ClickHouse Cloud).
DatabaseThe database whose tables you want to sync.
UsernameThe ClickHouse user.
PasswordThe user's password. Leave it empty only for a user that has none.
Use HTTPSConnect over HTTPS with certificate verification. Turn this on for ClickHouse Cloud.
Read timeoutSeconds 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 system and information_schema databases 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​

ModeSupported
Full RefreshYes
Incremental (source-defined cursor)Yes, for tables whose sorting key starts with a suitable column
Change data captureNo
DeletesNo (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 typeSynced as
Int8–Int64, UInt8–UInt64integer
Int128, Int256, UInt128, UInt256string (exact)
Decimal(P, S)string (exact); ClickHouse drops trailing zeros, so 10.00 is synced as "10"
Float32, Float64number; NaN and infinity are synced as null
Boolboolean
String, FixedString, UUID, IPv4, IPv6, Enumstring
Date, Date32string, YYYY-MM-DD
DateTime, DateTime64string, 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 typesas ClickHouse renders them in JSON

Nullable(T) and LowCardinality(T) map like T; nullable columns can be null.

Troubleshooting​

Error codeMeaning
authentication_failedThe username or password was rejected.
permission_deniedThe user cannot SELECT from a selected table.
resource_not_foundThe database does not exist.
invalid_catalogA selected table, column or cursor no longer exists, or the cursor type is not supported. Refresh the schema.
provider_timeout, provider_transient_errorThe 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_errorDaspire could not reach the server, or the connection dropped.
provider_redirect_rejectedThe endpoint answered with a redirect. Use the server's direct address.