AI / Apache Paimon Interview questions
Why is Cross Partitions Upsert more expensive than a normal bucketed upsert?
In a standard Paimon primary key table, a record's partition and bucket are derived deterministically from its columns, so an upsert only ever needs to check for an existing matching key inside that one target bucket — a cheap, local operation.
Cross Partitions Upsert mode exists for a harder case: when the same primary key can legitimately arrive under a different partition value than it did before (for example, a "status" column used as the partition key that changes over a record's lifecycle). To correctly upsert in that scenario, Paimon must be able to find where any earlier version of that key currently lives, across all partitions, not just the one the new record happens to target — otherwise you'd end up with duplicate rows for the same key sitting in two different partitions.
That broader lookup is what makes it more expensive: Paimon maintains an index mapping primary keys to their partition and bucket so it can locate and correct any cross-partition match, which adds bookkeeping and lookup cost that a normal single-partition upsert never has to pay.
More Related questions...