title_wip

## ClickHouseIO.Write parameters[​](#clickhouseiowrite-parameters "Direct link to ClickHouseIO.Write parameters")

You can adjust the `ClickHouseIO.Write` configuration with the following setter functions:

|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Parameter Setter Function Argument Type Default Value Description|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `withMaxInsertBlockSize` `(long maxInsertBlockSize)` `1000000` Maximum size of a block of rows to insert.|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `withMaxRetries` `(int maxRetries)` `5` Maximum number of retries for failed inserts.|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `withMaxCumulativeBackoff` `(Duration maxBackoff)` `Duration.standardDays(1000)` Maximum cumulative backoff duration for retries.|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `withInitialBackoff` `(Duration initialBackoff)` `Duration.standardSeconds(5)` Initial backoff duration before the first retry.|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `withInsertDistributedSync` `(Boolean sync)` `true` If true, synchronizes insert operations for distributed tables.|  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `withInsertQuorum` `(Long quorum)` `null` The number of replicas required to confirm an insert operation.|  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | | `withInsertDeduplicate` `(Boolean deduplicate)` `true` If true, deduplication is enabled for insert operations.|  |  |  |  | | --- | --- | --- | --- | | `withTableSchema` `(TableSchema schema)` `null` Schema of the target ClickHouse table. | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |

## Limitations[​](#limitations "Direct link to Limitations")

Please consider the following limitations when using the connector:

- As of today, only Sink operation is supported. The connector doesn't support Source operation.
- ClickHouse performs deduplication when inserting into a `ReplicatedMergeTree` or a `Distributed` table built on top of a `ReplicatedMergeTree`. Without replication, inserting into a regular MergeTree can result in duplicates if an insert fails and then successfully retries. However, each block is inserted atomically, and the block size can be configured using `ClickHouseIO.Write.withMaxInsertBlockSize(long)`. Deduplication is achieved by using checksums of the inserted blocks. For more information about deduplication, please visit [Deduplication](/docs/guides/developer/deduplication) and [Deduplicate insertion config](/docs/operations/settings/settings#insert_deduplicate).
- The connector doesn't perform any DDL statements; therefore, the target table must exist prior insertion.

## Related content[​](#related-content "Direct link to Related content")

- `ClickHouseIO` class [documentation](https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/io/clickhouse/ClickHouseIO.html).
- `Github` repository of examples [clickhouse-beam-connector](https://github.com/ClickHouse/clickhouse-beam-connector).

- [Integration package](#integration-package)- [Setup of the Apache Beam ClickHouse package](#setup-of-the-apache-beam-clickhouse-package)
    - [Package installation](#package-installation)- [Code example](#code-example)- [Supported data types](#supported-data-types)- [ClickHouseIO.Write parameters](#clickhouseiowrite-parameters)- [Limitations](#limitations)- [Related content](#related-content)

Was this page helpful?