Search before asking
Paimon version
master
Compute Engine
Spark
Minimal reproduce step
CREATE TABLE t (id INT, g INT, v BIGINT) TBLPROPERTIES (
'primary-key' = 'id',
'bucket' = '2',
'merge-engine' = 'partial-update',
'fields.g.sequence-group' = 'v',
'partial-update.remove-record-on-sequence-group' = 'g');
INSERT INTO t VALUES (1, 1, 10), (2, 1, 20);
DELETE FROM t WHERE id = 1;
SELECT * FROM t;
-- both rows are still there, the DELETE silently has no effect
What doesn't meet your expectations?
validatePKUpsertDeletable allows batch DELETE when partial-update.remove-record-on-sequence-group is set, so the statement goes through the pk-upsert delete path (scan matching rows, mark them with -D and write back). The -D rows carry the real field values including the sequence-group field, so I'd expect retractWithSequenceGroup to set currentDeleteRow and remove the row — but nothing is deleted and no error is raised.
Not sure whether this is a bug or expected (e.g. the delete row is required to carry a larger sequence value than the current one?). If it is expected, maybe validatePKUpsertDeletable should reject this case or the behavior should be documented, since a silently no-op DELETE is quite surprising.
Noticed while working on #8837 (the fast path there is gated to DEDUPLICATE, so it's unrelated to that change — reproducible on vanilla master).
Anything else?
No response
Are you willing to submit a PR?
Search before asking
Paimon version
master
Compute Engine
Spark
Minimal reproduce step
What doesn't meet your expectations?
validatePKUpsertDeletableallows batch DELETE whenpartial-update.remove-record-on-sequence-groupis set, so the statement goes through the pk-upsert delete path (scan matching rows, mark them with-Dand write back). The-Drows carry the real field values including the sequence-group field, so I'd expectretractWithSequenceGroupto setcurrentDeleteRowand remove the row — but nothing is deleted and no error is raised.Not sure whether this is a bug or expected (e.g. the delete row is required to carry a larger sequence value than the current one?). If it is expected, maybe
validatePKUpsertDeletableshould reject this case or the behavior should be documented, since a silently no-op DELETE is quite surprising.Noticed while working on #8837 (the fast path there is gated to DEDUPLICATE, so it's unrelated to that change — reproducible on vanilla master).
Anything else?
No response
Are you willing to submit a PR?