N
N
namee2022-03-31 12:16:22
SQL
namee, 2022-03-31 12:16:22

How to ignore or replace duplicate data in clickhouse?

Good day.
Actually the question is simple.
Table snippet

...
`id` String,
`install_time` DateTime
)
ENGINE = ReplacingMergeTree
ORDER BY (id, install_time)

insert query is the simplest
INSERT INTO installs (f1,f2) values ​​(v1,v2)

but the records are suddenly duplicated.

and the query OPTIMIZE TABLE installs DEDUPLICATE;
works fine and duplicates disappear.
Does it really need to be run every time?

Or is there a way to teach the table to skip or replace duplicates?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question