I'm using Apache Beam Java SDK to process events and write them to the Clickhouse Database. Luckily there is ready to use ClickhouseIO.
ClickhouseIO accumulates elements and inserts them in batch, but because of the parallel nature of the pipeline it still results in a lot of inserts per second in my case. I'm frequently receiving "DB::Exception: Too many parts" or "DB::Exception: Too much simultaneous queries" in Clickhouse.
Clickhouse documentation recommends doing 1 insert per second. Is there a way I can ensure this with ClickhouseIO? Maybe some KV grouping before ClickhouseIO.Write or something?