Skip to main content

ClickHouse Writer programmer's reference

ClickHouse Writer properties

Configure the following properties on a ClickHouse Writer target.

Property

Type

Required

Default

Description

UploadPolicy

String

No

eventcount:10000, interval:30s

Controls how often ClickHouse Writer flushes a batch. eventcount:<N> flushes after N events; interval:<duration> flushes after the given duration (for example, 5s, 30s, 2m). Either condition triggers a flush.

Target Table Definition

String (JSON)

No

""

Per-table DDL clauses applied when Striim creates a target table: Order By (Sorting Key), Primary Key, Partition By, Sample By, TTL, and Settings. Ignored if the target table already exists. Has no effect for Replicated engines, Distributed tables, or AggregatingMergeTree, because Striim does not manage table creation for these engines.

Tables

String

Yes

""

Maps source tables to target tables. Supports explicit mapping (src.EMP, target_db.employee), wildcard mapping (SCH.%, target_db.% — wildcards are supported for tables, not databases), and single-table mapping. Events that do not match any mapping are discarded and counted in the discard metric. Supports the KeyColumn and ColumnMap sub-clauses (see Target table definition).

Table Engine

String

No

MergeTree

The ClickHouse table engine used for all tables written by this target. See Choosing a table engine for supported values and guidance.

ParallelThreads

Integer

No

1

Creates multiple writer instances to increase throughput. Events are distributed by target table, and events for the same table are always routed to the same instance to preserve ordering. If a writer targets only one table, increasing ParallelThreads beyond 1 has no effect; see Scaling writes to a single table for an alternative.

OptimizedMerge

Boolean

No

false

Applies only when Table Engine is MergeTree and Mode is MERGE. Enable when the source emits partial-row updates (for example, Oracle supplemental logging set to capture changed columns only). Enabling OptimizedMerge with any other table engine halts the application at startup.

NullMarker

String

No

NULL

The token ClickHouse Writer writes to represent a NULL value in the batched CSV data. Change this only if your data legitimately contains the literal string "NULL" as a non-null value.

Mode

String

No

APPENDONLY

Applies only when Table Engine is MergeTree. APPENDONLY appends every event as a new row and does not apply UPDATE, DELETE, or PKUPDATE semantics; use it for initial loads, audit tables, or non-CDC sources. MERGE reconciles INSERT, UPDATE, DELETE, and PKUPDATE operations from the source.

IgnorableExceptionCode

String

No

""

The only accepted value is the literal string TABLE_NOT_FOUND (case-insensitive); any other value is rejected at compile time. When set, a TABLE_NOT_FOUND error for a target table is logged and the triggering event is discarded and acknowledged instead of halting the application; the missing table is remembered so later events for that table are also discarded without re-querying ClickHouse. Use with care: ignoring this error means events for a missing table are silently dropped rather than retried or surfaced.

Excluded Tables

String

No

""

A semicolon-separated list of source tables to exclude from replication. Events for a listed table are discarded rather than written to ClickHouse. Supports the same case-sensitive, multi-schema, and wildcard matching as the Tables property.

DeleteStrategy

String

No

LightweightDelete

Applies when Mode is MERGE (MergeTree) or when Table Engine is CoalescingMergeTree. LightweightDelete issues DELETE FROM ... WHERE ...; ClickHouse marks the rows deleted immediately and reclaims them physically during a later background merge. MutationDelete issues ALTER TABLE ... DELETE WHERE ...; ClickHouse rewrites the affected data parts immediately, which is useful for compliance-driven erasure requirements but causes higher write amplification.

ConnectionRetryPolicy

String

No

initialRetryDelay=10s, retryDelayMultiplier=2, maxRetryDelay=1m, maxAttempts=10, totalTimeout=10m

Controls how ClickHouse Writer retries a failed connection before halting the application.

connectionProfileName

String

Yes

""

The name of the ClickHouse Connection Profile attached to this writer. Credentials are not configurable inline; they come from the Connection Profile.

CDDLAction

String

No

Process

Controls how ClickHouse Writer responds to DDL events from the source. Process applies supported CREATE, ALTER, DROP, and TRUNCATE TABLE changes to ClickHouse automatically. Ignore skips the DDL event and continues processing DML. Halt flushes pending data and stops the application; use this when the target schema is managed outside Striim, for example by dbt or Terraform. See Schema evolution (CDDLAction) for supported changes and known limitations.

Known limitation: Unicode and other special characters in source or target table names, column names, or Key Column names are not reliably supported; avoid them in identifiers that ClickHouse Writer maps. Very long column names (near ClickHouse's identifier length limit) can also fail. Test any non-ASCII or unusually long identifiers against your ClickHouse version before deploying to production.

Note: Mode is intended for MergeTree only. If you set Mode explicitly for a different table engine — for example, Mode = APPENDONLY with Table Engine = ReplacingMergeTree, which requires Mode = MERGE — the application halts at startup with a configuration error instead of silently ignoring the setting.

Supported data types

ClickHouse Writer converts Striim's internal TQL data types, and each supported source system's native data types, to ClickHouse data types as shown in the tables below. Confirm precision-sensitive mappings against your source schema before migrating, and use Target Table Definition to override a generated column definition if a source-specific value differs from what you expect.

TQL to ClickHouse

TQL type

ClickHouse type

Binary

String

Boolean

Bool

Byte

Int8

Date

Date32

DateTime

DateTime64(6, 'UTC')

Decimal

Decimal(p, s)

Double

Float64

Float

Float32 or Float64

Integer

Int32

Long

Int64

Short

Int16

String

String

Time

Time64(6)

BigQuery to ClickHouse

BigQuery type

ClickHouse type

Condition

BIGNUMERIC, BIGNUMERIC(p,0), BIGNUMERIC(p,s), NUMERIC, NUMERIC(p,0), NUMERIC(p,s)

Decimal(p, s)

p ≤ 76 and s ≤ 76

BOOL

Bool

BYTES, BYTES(p)

String

DATE

Date32

DATETIME

DateTime64(s)

FLOAT64

Float32

See note below

GEOGRAPHY, INTERVAL, JSON, STRING

String

INT64

Int64

TIME

Time64(s)

TIMESTAMP

DateTime64(s)

MySQL to ClickHouse

Not supported: GEOMETRY, SET.

MySQL type

ClickHouse type

Condition

BIGINT UNSIGNED

UInt64

INT / INT UNSIGNED

Int32 / UInt32

MEDIUMINT / MEDIUMINT UNSIGNED

Int32 / UInt32

SMALLINT / SMALLINT UNSIGNED

Int16 / UInt16

TINYINT / TINYINT UNSIGNED

Int8 / UInt8

YEAR

UInt16

BINARY, BINARY(p), BLOB, CHAR, CHAR(p)

String

BIT

FixedString(1)

BIT(p)

String

DATE

Date32

DATETIME / DATETIME(s)

DateTime64(s)

s ≤ 9

DECIMAL / DECIMAL UNSIGNED

Decimal(p, s) / String

Decimal if p ≤ 76 and s ≤ 76; String if s > 76 or (p, s) > 76

DOUBLE / DOUBLE(p,0) / DOUBLE(p,s)

Float64 / String

Float64 if p ≤ 53; String if (p, s) > 53

ENUM

String

FLOAT / FLOAT(p,s)

Float32 / Float64 / String

Float32 if p ≤ 24; Float64 if 24 < p ≤ 53; String if (p, s) > 53

JSON, LONGBLOB, LONGTEXT, MEDIUMBLOB, MEDIUMTEXT, TEXT, TINYBLOB, TINYTEXT, VARBINARY(p), VARCHAR(p)

String

TIME

Time64(6)

TIMESTAMP

DateTime64(s)

Oracle to ClickHouse

Not supported: BFILE, LONG, LONG RAW, SDO_GEOMETRY, UROWID.

Oracle type

ClickHouse type

Condition

BINARY_DOUBLE

Float64

BINARY_FLOAT

Float32

BLOB, CHAR, CHAR(p), CLOB, NCHAR(p), NCLOB, NVARCHAR2(p), RAW(p), ROWID, VARCHAR2(p), XMLTYPE

String

DATE

Date32

FLOAT

String

FLOAT(p)

String

p > 53

INTERVAL DAY TO SECOND, INTERVAL YEAR TO MONTH

String

NUMBER

Decimal(76)

NUMBER(p,0)

Decimal(p, s)

p ≤ 76 and s ≤ 76

NUMBER(p,s)

Decimal(p, s) / String

Decimal if p ≤ 76 and s ≤ 76; String if s > 76 or (p, s) > 76

TIMESTAMP, TIMESTAMP(p), TIMESTAMP WITH [LOCAL] TIME ZONE[(p)]

DateTime64(s)

s ≤ 9 where precision is specified

PostgreSQL to ClickHouse

PostgreSQL type

ClickHouse type

Condition

BIGSERIAL

Int64

BOOL

Bool

DATE

Date32

FLOAT4

Float32

FLOAT8

Float32

See note below

INT2 / INT4 / INT8

Int16 / Int32 / Int64

SERIAL / SMALLSERIAL

Int32 / Int16

UUID

UUID

BIT

FixedString(1)

BIT(p)

String

p > 1

BOX, BPCHAR, BPCHAR(p), BYTEA, CIDR, CIRCLE, DATERANGE, INET, INT4RANGE, INT8RANGE, INTERVAL, INTERVAL(p), JSON, JSONB, LINE, LSEG, MACADDR, MONEY, NUMRANGE, PATH, POINT, POLYGON, TEXT, TIMETZ, TIMETZ(p), TSQUERY, TSRANGE, TSTZRANGE, TSVECTOR, TXID_SNAPSHOT, VARBIT, VARBIT(p), VARCHAR, VARCHAR(p), XML

String

NUMERIC

Decimal(76)

NUMERIC(p,0) / NUMERIC(p,s)

Decimal(p, s) / String

Decimal if p ≤ 76 and s ≤ 76; String if s > 76 or (p, s) > 76

TIME / TIME(p)

Time64(s)

s ≤ 9 for TIME(p)

TIMESTAMP / TIMESTAMP(p) / TIMESTAMPTZ / TIMESTAMPTZ(p)

DateTime64(s)

s ≤ 9 where precision is specified

Snowflake to ClickHouse

Snowflake type

ClickHouse type

Condition

ARRAY, BINARY, BINARY(p), GEOGRAPHY, GEOMETRY, OBJECT, VARCHAR, VARCHAR(p), VARIANT

String

BOOLEAN

Bool

DATE

Date32

DOUBLE

Float64

NUMBER, NUMBER(p,0), NUMBER(p,s)

Decimal(p, s) / String

Decimal if p ≤ 76 and s ≤ 76; String if s > 76 or (p, s) > 76

TIME, TIME(p)

Time64(6)

TIMESTAMPLTZ, TIMESTAMPLTZ(p), TIMESTAMPNTZ, TIMESTAMPNTZ(p), TIMESTAMPTZ, TIMESTAMPTZ(p)

DateTime64(6)

SQL Server to ClickHouse

Not supported: GEOGRAPHY, GEOMETRY, HIERARCHYID, SQL_VARIANT.

SQL Server type

ClickHouse type

Condition

BIGINT

Int64

BIGINT IDENTITY(p,s)

Int64

10 ≤ p ≤ 19

BIT

Bool

INT

Int32

INT IDENTITY(p,s)

Int64 / Int32

Int64 if 10 ≤ p ≤ 19; Int32 if 5 ≤ p ≤ 10

SMALLINT

Int16

SMALLINT IDENTITY(p,s)

Int16 / Int32

Int16 if 3 ≤ p ≤ 5; Int32 if 5 ≤ p ≤ 10

TINYINT

UInt8

TINYINT IDENTITY(p,s)

Int8 / Int16

Int8 if p ≤ 3; Int16 if 3 ≤ p ≤ 5

BINARY(p), CHAR, CHAR(p), IMAGE, MONEY, NCHAR, NCHAR(p), NTEXT, NVARCHAR, NVARCHAR(max), NVARCHAR(p), SMALLMONEY, TEXT, TIMESTAMP, UNIQUEIDENTIFIER, VARBINARY, VARBINARY(max), VARBINARY(p), VARCHAR, VARCHAR(max), VARCHAR(p), XML

String

DATE

Date32

DATETIME, DATETIME2, DATETIMEOFFSET, SMALLDATETIME

DateTime64(s)

DATETIME2(p), DATETIMEOFFSET(p)

DateTime64(s)

s ≤ 9

DECIMAL, NUMERIC, NUMERIC IDENTITY(p,s)

Decimal(p, s) / String

Decimal if p ≤ 76 and s ≤ 76; String if s > 76 or (p, s) > 76

FLOAT

Float64

FLOAT(p)

Float64 / String

Float64 if 24 ≤ p ≤ 53; String if p > 53

REAL

Float32

REAL(p)

Float32

p ≤ 24

TIME / TIME(p)

Time64(s)

s ≤ 9 for TIME(p)