> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://apidocs.polytomic.com/2024-02-08/guides/configuring-your-connections/connections/clickhouse/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://apidocs.polytomic.com/_mcp/server. # ClickHouse Supports: * ✅ Models * ✅ Model sync destination * ✅ Bulk sync source * ✅ Bulk sync destination ## Connection ### Configuration
NameTypeDescriptionRequired
cloud_provider string Cloud provider (destination support only)

Accepted values: `aws` ↓, `azure` ↓, `gcp` ↓
optional
database string Database (optional) optional
hostname string Hostname required
password string Password optional
port integer Port required
skip_verify boolean Skip certificate verification optional
ssh boolean Connect over SSH tunnel ↓ optional
ssl boolean Use SSL optional
username string Username required
#### `cloud_provider` = `aws`
NameTypeDescriptionRequired
auth_mode string AWS authentication method

How to authenticate with AWS for the staging bucket. Accepted values: `access_key_and_secret` ↓, `iam_role` ↓
required
s3_bucket_name string S3 bucket name (destinations only)

Name of bucket used for staging data load files
required
s3_bucket_region string S3 bucket region (destinations only) required
```json { "name": "ClickHouse connection", "type": "clickhouse", "configuration": { "auth_mode": "access_key_and_secret", "aws_access_key_id": "AKIAIOSFODNN7EXAMPLE", "aws_secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", "cloud_provider": "aws", "database": "default", "hostname": "clickhouse.example.com", "password": "", "port": 9440, "s3_bucket_name": "my-bucket", "s3_bucket_region": "us-east-1", "skip_verify": true, "ssh": false, "ssl": true, "username": "default" } } ``` ##### `auth_mode` When `auth_mode` is `access_key_and_secret`:
NameTypeDescriptionRequired
aws_access_key_id string AWS access key ID (destinations only) required
aws_secret_access_key string AWS secret access key (destinations only) required
Read-only propertyTypeDescription
aws_user string User ARN (destinations only)
When `auth_mode` is `iam_role`:
NameTypeDescriptionRequired
iam_role_arn string IAM role ARN required
Read-only propertyTypeDescription
external_id string External ID for the IAM role
```json { "name": "ClickHouse connection", "type": "clickhouse", "configuration": { "auth_mode": "iam_role", "cloud_provider": "aws", "database": "default", "hostname": "clickhouse.example.com", "iam_role_arn": "", "password": "", "port": 9440, "s3_bucket_name": "my-bucket", "s3_bucket_region": "us-east-1", "skip_verify": true, "ssh": false, "ssl": true, "username": "default" } } ``` #### `cloud_provider` = `azure`
NameTypeDescriptionRequired
azure_access_key string Storage account access key (destinations only) required
azure_account_name string Storage account name (destinations only) required
container_name string Storage container name (destinations only)

Container used for staging data load files (may be "container" or "container/prefix")
required
```json { "name": "ClickHouse connection", "type": "clickhouse", "configuration": { "azure_access_key": "abcdefghijklmnopqrstuvwxyz0123456789/+ABCDEabcdefghijklmnopqrstuvwxyz0123456789/+ABCDE==", "azure_account_name": "account", "cloud_provider": "azure", "container_name": "container", "database": "default", "hostname": "clickhouse.example.com", "password": "", "port": 9440, "skip_verify": true, "ssh": false, "ssl": true, "username": "default" } } ``` #### `cloud_provider` = `gcp`
NameTypeDescriptionRequired
gcs_bucket_name string GCS bucket name (destinations only)

Bucket used for staging data (may be "bucket" or "bucket/prefix")
required
gcs_hmac_access_id string HMAC access ID (destinations only) required
gcs_hmac_secret string HMAC secret (destinations only) required
```json { "name": "ClickHouse connection", "type": "clickhouse", "configuration": { "cloud_provider": "gcp", "database": "default", "gcs_bucket_name": "my-bucket", "gcs_hmac_access_id": "GOOG1EXAMPLEACCESSID", "gcs_hmac_secret": "bGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9EXAMPLE", "hostname": "clickhouse.example.com", "password": "", "port": 9440, "skip_verify": true, "ssh": false, "ssl": true, "username": "default" } } ``` #### `ssh` When `ssh` is `true`:
NameTypeDescriptionRequired
ssh_host string SSH host required
ssh_port integer SSH port required
ssh_private_key string Private key required
ssh_user string SSH user required
```json { "name": "ClickHouse connection", "type": "clickhouse", "configuration": { "auth_mode": "access_key_and_secret", "aws_access_key_id": "AKIAIOSFODNN7EXAMPLE", "aws_secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", "cloud_provider": "aws", "database": "default", "hostname": "clickhouse.example.com", "password": "", "port": 9440, "s3_bucket_name": "my-bucket", "s3_bucket_region": "us-east-1", "skip_verify": true, "ssh": true, "ssh_host": "bastion.example.com", "ssh_port": 22, "ssh_private_key": "", "ssh_user": "root", "ssl": true, "username": "default" } } ``` ## Model Sync ### Source #### Configuration
NameTypeDescriptionRequired
query string optional
table string Table optional
view string View optional
#### Example ```json { ... "configuration": { "query": "SELECT * from users", "table": "users", "view": "active_users" } } ``` ### Target ClickHouse connections may be used as the destination in a model sync. #### All targets ##### Configuration
NameTypeDescriptionRequired
column_codec string Column compression codec

CODEC spec applied to every column in Polytomic-created tables. Examples: ZSTD; ZSTD(3); LZ4HC(9).
optional
created_column string 'Created at' timestamp column optional
optimize_after_sync boolean Run OPTIMIZE FINAL after each sync

When enabled
optional
preserve_table_on_resync boolean Preserve destination table when resyncing optional
updated_column string 'Updated at' timestamp column optional
write_record_timestamps boolean Write row timestamp metadata optional
##### Example ```json { ... "target": { "configuration": { "column_codec": "ZSTD", "created_column": "", "optimize_after_sync": false, "preserve_table_on_resync": false, "updated_column": "", "write_record_timestamps": false } } } ``` ### 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:
NAME DESCRIPTION ENUM
name Table name false
## Bulk Sync ### Source ClickHouse connections may be used as a bulk sync source. No additional configuration options are required. ### Destination #### Configuration
NameTypeDescriptionRequired
advanced object optional
mirror_schemas boolean Mirror schemas optional
schema string Output schema optional
#### Example ```json { ... "destination_configuration": { "advanced": { "column_codec": "ZSTD", "empty_strings_null": true, "hard_deletes": false, "initial_execution": "rebuild", "optimize_after_sync": false, "table_prefix": "", "truncate_existing": false }, "mirror_schemas": false, "schema": "schema" } } ``` ## Type handling ### Destination types | POLYTOMIC TYPE | CLICKHOUSE TYPE | |-----------------------------|---------------------------| | `array<>` | `Array(Nullable(String))` | | `bigint` | `Nullable(Int64)` | | `boolean` | `Nullable(Bool)` | | `date` | `Nullable(DateTime64(9))` | | `datetime` | `Nullable(DateTime64(9))` | | `decimal(precision, scale)` | `Nullable(Decimal(0, 0))` | | `double` | `Nullable(Float64)` | | `int` | `Nullable(Int32)` | | `json` | `Nullable(JSON)` | | `jsonarray` | `Array(Nullable(String))` | | `number` | `Nullable(Float64)` | | `object{}` | `Nullable(JSON)` | | `single` | `Nullable(Float32)` | | `smallint` | `Nullable(Int16)` | | `string` | `Nullable(String)` | | `time` | `Nullable(DateTime64(9))` | ### Source types | CLICKHOUSE TYPE | POLYTOMIC TYPE | |---------------------------|----------------| | `AGGREGATEFUNCTION` | `string` | | `Array()` | `array<>` | | `BOOL` | `boolean` | | `BOOLEAN` | `boolean` | | `DATE` | `date` | | `DATE32` | `date` | | `DATETIME` | `datetime` | | `DATETIME64` | `datetime` | | `DECIMAL` | `number` | | `DECIMAL128` | `number` | | `DECIMAL256` | `number` | | `DECIMAL32` | `number` | | `DECIMAL64` | `number` | | `DYNAMIC` | `string` | | `ENUM16` | `string` | | `ENUM8` | `string` | | `FIXEDSTRING` | `string` | | `FLOAT32` | `single` | | `FLOAT64` | `double` | | `INT128` | `bigint` | | `INT16` | `smallint` | | `INT256` | `bigint` | | `INT32` | `int` | | `INT64` | `bigint` | | `INT8` | `smallint` | | `IPV4` | `string` | | `IPV6` | `string` | | `Map()` | `map<>` | | `Nested()` | `object{}` | | `SIMPLEAGGREGATEFUNCTION` | `string` | | `STRING` | `string` | | `TIME` | `time` | | `TIME64` | `time` | | `Tuple()` | `object{}` | | `UINT128` | `bigint` | | `UINT16` | `int` | | `UINT256` | `bigint` | | `UINT32` | `int` | | `UINT64` | `bigint` | | `UINT8` | `smallint` | | `UUID` | `string` | | `VARIANT` | `string` |