ClickHouse

Supports:

  • ✅ Models
  • ✅ Model sync destination
  • ✅ Bulk sync source
  • ✅ Bulk sync destination

Connection

Configuration

NameTypeDescriptionRequired
cloud_providerstringCloud Provider (destination support only)

Accepted values: aws , azure
false
databasestringDatabase (optional)false
hostnamestringHostnametrue
passwordstringPasswordfalse
portintegerPorttrue
skip_verifybooleanSkip certificate verificationfalse
sshbooleanConnect over SSH tunnel false
sslbooleanUse SSLfalse
usernamestringUsernametrue

cloud_provider

When cloud_provider is aws
NameTypeDescriptionRequired
auth_modestringAWS Authentication Method

How to authenticate with AWS for the staging bucket. Accepted values: access_key_and_secret, iam_role
true
s3_bucket_namestringS3 Bucket Name (destinations only)

Name of bucket used for staging data load files
true
s3_bucket_regionstringS3 Bucket Region (destinations only)true
When cloud_provider is azure
NameTypeDescriptionRequired
azure_access_keystringStorage Account Access Key (destinations only)true
azure_account_namestringStorage Account Name (destinations only)true
container_namestringStorage Container Name (destinations only)

Container used for staging data load files (may be “container” or “container/prefix”)
true

ssh

When ssh is true
NameTypeDescriptionRequired
ssh_hoststringSSH hostfalse
ssh_portintegerSSH portfalse
ssh_private_keystringPrivate keyfalse
ssh_userstringSSH userfalse

auth_mode

When auth_mode is access_key_and_secret
NameTypeDescriptionRequired
aws_access_key_idstringAWS Access Key ID (destinations only)true
aws_secret_access_keystringAWS Secret Access Key (destinations only)true
When auth_mode is iam_role
NameTypeDescriptionRequired
iam_role_arnstringIAM Role ARNtrue

Example

1{
2 "name": "ClickHouse connection",
3 "type": "clickhouse",
4 "configuration": {
5 "auth_mode": "access_key_and_secret",
6 "aws_access_key_id": "AKIAIOSFODNN7EXAMPLE",
7 "aws_secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
8 "cloud_provider": "aws",
9 "database": "default",
10 "hostname": "clickhouse.example.com",
11 "password": "",
12 "port": 0,
13 "s3_bucket_name": "my-bucket",
14 "s3_bucket_region": "us-east-1",
15 "skip_verify": false,
16 "ssh": false,
17 "ssl": false,
18 "username": "default"
19 }
20}

Read-only properties

NameTypeDescriptionRequired

auth_mode

When auth_mode is access_key_and_secret
NameTypeDescriptionRequired
aws_userstringUser ARN (destinations only)false
When auth_mode is iam_role
NameTypeDescriptionRequired
external_idstringExternal ID for the IAM rolefalse

Model Sync

Source

Configuration

NameTypeDescriptionRequired
querystringfalse
tablestringTablefalse
viewstringViewfalse

Example

1{
2 ...
3 "configuration": {
4 "query": "SELECT * from users",
5 "table": "users",
6 "view": "active_users"
7 }
8}

Target

ClickHouse connections may be used as the destination in a model sync.

All targets

Configuration
NameTypeDescriptionRequired
column_codecstringColumn compression codec

CODEC spec applied to every column in Polytomic-created tables. Examples: ZSTD; ZSTD(3); LZ4HC(9).
false
created_columnstring’Created at’ timestamp columnfalse
optimize_after_syncbooleanRun OPTIMIZE FINAL after each sync

When enabled
false
preserve_table_on_resyncbooleanPreserve destination table when resyncingfalse
updated_columnstring’Updated at’ timestamp columnfalse
write_record_timestampsbooleanWrite row timestamp metadatafalse
Example
1{
2 ...
3 "target": {
4 "configuration": {
5 "column_codec": "",
6 "created_column": "",
7 "optimize_after_sync": false,
8 "preserve_table_on_resync": false,
9 "updated_column": "",
10 "write_record_timestamps": false
11 }
12 }
13}

Target creation

ClickHouse connections may be used to create a new target for a model sync. The following parameters are required to create a new target:

NAMEDESCRIPTIONENUM
nameTable namefalse

Bulk Sync

Source

ClickHouse connections may be used as a bulk sync source. No additional configuration options are required.

Destination

Configuration

NameTypeDescriptionRequired
advancedobjectfalse
mirror_schemasbooleanMirror schemasfalse
schemastringOutput schemafalse

Example

1{
2 ...
3 "destination_configuration": {
4 "advanced": {
5 "column_codec": "",
6 "empty_strings_null": false,
7 "hard_deletes": false,
8 "optimize_after_sync": false,
9 "table_prefix": "",
10 "truncate_existing": false
11 },
12 "mirror_schemas": false,
13 "schema": "schema"
14 }
15}

Type handling

Destination types

POLYTOMIC TYPECLICKHOUSE TYPE
array<>Array(Nullable(String))
bigintNullable(Int64)
booleanNullable(Bool)
dateNullable(DateTime64(9))
datetimeNullable(DateTime64(9))
decimal(precision, scale)Nullable(Decimal32(0))
doubleNullable(Float64)
intNullable(Int32)
jsonNullable(JSON)
jsonarrayArray(Nullable(String))
numberNullable(Float64)
object{}Nullable(JSON)
singleNullable(Float32)
smallintNullable(Int16)
stringNullable(String)
timeNullable(DateTime64(9))

Source types

CLICKHOUSE TYPEPOLYTOMIC TYPE
AGGREGATEFUNCTIONstring
Array()array<>
BOOLboolean
BOOLEANboolean
DATEdate
DATE32date
DATETIMEdatetime
DATETIME64datetime
DECIMALnumber
DECIMAL128number
DECIMAL256number
DECIMAL32number
DECIMAL64number
DYNAMICstring
ENUM16string
ENUM8string
FIXEDSTRINGstring
FLOAT32single
FLOAT64double
INT128bigint
INT16smallint
INT256bigint
INT32int
INT64bigint
INT8smallint
IPV4string
IPV6string
Map()map<>
Nested()object{}
SIMPLEAGGREGATEFUNCTIONstring
STRINGstring
TIMEtime
TIME64time
Tuple()object{}
UINT128bigint
UINT16int
UINT256bigint
UINT32int
UINT64bigint
UINT8smallint
UUIDstring
VARIANTstring