How to avoid duplicates in clickhouse table?

前端 未结 2 1705
心在旅途
心在旅途 2020-12-22 00:48

I have created table and trying to insert the values multiple time to check the duplicates. I can see duplicates are inserting. Is there a way to avoid duplicates in clickho

2条回答
  •  不思量自难忘°
    2020-12-22 01:07

    Most likely ReplacingMergeTree is what you need as long as duplicate records duplicate primary keys. You can also try out other MergeTree engines for more actions when replicate record is encountered. FINAL keyword can be used when doing queries to ensure uniquity.

提交回复
热议问题