hubgeter opened a new pull request, #69704:
URL: https://github.com/apache/doris/pull/69704
### What problem does this PR solve?
Issue Number: DORIS-29855
Related PR: #69551
Problem Summary:
Iceberg SQL MERGE can combine standalone INSERT and DELETE actions. The BE
merge sink reports data rows and position delete rows separately, while the FE
`getUpdateCnt()` previously returned data rows whenever they were non-zero.
This dropped standalone DELETE actions and under-reported the affected-row
count.
Track standalone `kDeleteOperation` rows separately in the BE merge sink. Do
not count `kUpdateDeleteOperation`, because that internal delete shares one
target row with the corresponding `kUpdateInsertOperation`. Report the
standalone delete count through an optional commit-data field, with the FE
adding it to data rows when present and retaining the legacy heuristic when
older BEs omit the field.
This preserves UPDATE counting at one row, counts mixed INSERT+DELETE
correctly, handles delete-only MERGE and V3 deletion vectors, and remains
compatible during rolling upgrades.
### Release note
Fix Iceberg MERGE affected-row counts when the statement combines standalone
INSERT and DELETE actions.
### Check List (For Author)
- Test
- [x] Regression test
- [x] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason
Validated on latest `apache/master`: FE transaction and known-bug tests
passed 111 tests with 3 unrelated known issues skipped; BE Iceberg merge/delete
sink tests passed 32/32. The SQL regression suite parses successfully; its E2E
execution is pending the CI environment requested with `run buildall`.
- Behavior changed:
- [ ] No.
- [x] Yes. MERGE affected-row counts now include standalone DELETE
actions without double-counting UPDATE.
- Does this need documentation?
- [x] No.
- [ ] Yes.
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]