ClickHouse Writer programmer's reference
ClickHouse Writer properties
Configure the following properties on a ClickHouse Writer target.
property | type | default value | notes |
|---|---|---|---|
CDDL Action | String | Process | |
Connection Profile Name | String |
| See Connection profiles. |
Connection Retry Policy | String | initialRetryDelay=10s, retryDelayMultiplier=2, maxRetryDelay=1m, maxAttempts=10, totalTimeout=10m | With the default setting, if a connection attempt is unsuccessful, the adapter will try again in 10 seconds ( The adapter will halt when either
If To disable connection retry, set Negative values are not supported. |
Delete Strategy | String | LightweightDelete | Applies when Mode is MERGE (MergeTree) or when Table Engine is CoalescingMergeTree. Controls the SQL mechanism used to physically remove rows from ClickHouse during DELETE and PKUPDATE operations in MERGE mode. Two strategies are supported:
Both strategies run with mutations_sync = 1, meaning the writer waits for the operation to complete before processing the next batch. |
Excluded Tables | String |
| If |
Ignorable Exception Code | String |
| 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. |
Mode | String | APPENDONLY | Applies only when Table Engine is MergeTree. Determines how CDC operations are applied to the target.
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. |
Null Marker | String | 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. |
Optimized Merge | Boolean | False | Applies only when Table Engine is MergeTree and Mode is MERGE. Set to True only when target’s input stream is the output of an HP NonStop reader, MySQL Reader, or Oracle Reader source and the source events will include partial records, or when the source is Oracle Reader and the source table includes BLOB or CLOB columns. For example, with Oracle Reader, when supplemental logging has not been enabled for all columns, partial records are sent for updates. When the source events will always include full records, leave this set to false. When Optimized Merge is True, each primary key update is handled in a separate write operation. If the source has frequent primary key updates, this may lead to a decline in write performance compared with Optimized Merge = False. |
Parallel Threads | Integer | 1 | Creates multiple instances of writer for better performance. See Creating multiple writer instances. Events are distributed by target table, and events for the same table are always routed to the same instance to preserve ordering. If the writer targets only one table, setting this higher than 1 has no effect; see Scaling writes to a single table for an alternative. |
Table Engine | String | MergeTree | The ClickHouse table engine used for all tables written by this target. See Choosing a table engine for supported values and guidance. |
Tables | String |
| Maps source to target tables. It supports the following forms:
If an incoming event's source table is not matched by any rule, the event is discarded (and counted in the discard metric). Supports the KeyColumn and ColumnMap sub-clauses (see Modifying output using ColumnMap and Defining relations between source and target using ColumnMap and KeyColumns). 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. |
Target Table Definition | String |
| |
Upload Policy | String | eventcount:10000, interval:30s | The upload policy may include eventcount and/or interval (see Setting output names and rollover / upload policies for syntax). Cached data is written to the storage account every time any of the specified values is exceeded. With the default value, data will be written every five minutes or sooner if the cache contains 10,000 events. When the app is undeployed, all remaining data is written to the storage account. |
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 | Float64 | 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) |