tencent cloud

All product documents
Stream Compute Service
ClickHouse Sinks
Last updated: 2023-11-08 16:20:02
ClickHouse Sinks
Last updated: 2023-11-08 16:20:02

Overview

A ClickHouse data sink can write data to ClickHouse.
Note
The engine of ClickHouse data sink tables must be CollapsingMergeTree.

Mapping of common data types

For the data types supported by ClickHouse, see ClickHouse Data ‍Types. The table below lists some of the common data types and their counterparts in Flink.
Flink
ClickHouse
VARCHAR
String/FixedString(N)
STRING
String/FixedString(N)
BOOLEAN
There isn't a dedicated ClickHouse type for boolean. You can use UInt8 to store boolean data, limiting the valid values to 0 and 1, or use the string type, limiting the valid values to true and false.
DECIMAL
Decimal32(S)/Decimal64(S)/Decimal128(S)
TINYINT
Int8
SMALLINT
Int16
INTEGER
Int32
BIGINT
Int64
FLOAT
Float32
DOUBLE
Float64
DATE
Date
TIMESTAMP
DateTime
TIMESTAMP WITH LOCAL TIME ZONE
DateTime. Example: DateTime64(3, 'Asia/Shanghai').

Notes

Primary key

‍To ensure that update and delete operations are synced as expected, make sure you define the primary key correctly using the CREATE TABLE statement.

Collapsed fields

The CollapsingMergeTree engine of ClickHouse adds the logic of rows collapsing to data parts merge algorithm. You can specify collapsed fields using ENGINE = CollapsingMergeTree(Sign) when creating a table. ‍To learn more, see the ClickHouse document.

WITH parameters

ClickHouse data sinks are developed based on the data warehouse ClickHouse. The two have identical WITH parameters. For details, see ClickHouse.
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon