AI / Apache Paimon Interview questions
What is the difference between the First Row and Deduplicate merge engines?
Both are simple "pick one record" merge engines, but they pick from opposite ends of the arrival order:
| Merge engine | Keeps | Typical use |
| Deduplicate | The latest record seen for a key. | Standard upsert semantics, mirroring a source database's current state. |
| First Row | The first record ever seen for a key; later records for that key are ignored. | Deduplicating an append-only or CDC-insert stream where you want "first occurrence wins," such as building a table of unique first-touch events. |
CREATE TABLE first_seen ( user_id BIGINT PRIMARY KEY NOT ENFORCED, first_seen_at TIMESTAMP ) WITH ( 'merge-engine' = 'first-row' );
A practical tell for which to use: if "the record should reflect the most recent update," reach for Deduplicate; if "the record should reflect when this key first appeared and nothing after should change it," reach for First Row.
More Related questions...