Hi Caner,
That feature is called "Rollup" ... Druid will essentially aggregate records based on the __time value and the dimension values (like a Group By).
Here is the doc ref:
https://druid.apache.org/docs/latest/ingestion/schema-design#rollup
I believe you can force a table to rollup even if it was originally not ingested as a rollup table. Then this rollup behavior carries through to the compaction process as well.
I have seen people do this for deduping purposes just as you mentioned.
Let us know if you have further questions once you dive into it.
Thanks. John