Uh oh!
There was an error while loading. Please reload this page.
branch-4.1: [fix](fe) Handle generated columns in delete partial update #64884 - #65027
Merged
Conversation
### What problem does this PR solve? Issue Number: N/A Related PR: N/A Original Problem: DELETE failed during analysis on a unique merge-on-write table that contains a generated column when light delete is disabled. The original reported table had a generated VARIANT column: ```sql new_col variant AS (receive_address_detail) NULL ``` and the DELETE failed with: ```text errCode = 2, detailMessage = cannot find column from target table /receive_address_detail ``` A minimized reproduction is: ```sql create table test_gen_col_mow_delete_partial_update ( a int, b int, c int as (b + 1), d int ) unique key(a) distributed by hash(a) buckets 1 properties ( "enable_unique_key_merge_on_write" = "true", "enable_mow_light_delete" = "false", "replication_num" = "1" ); ``` After inserting rows, running: ```sql delete from test_gen_col_mow_delete_partial_update where a = 1; ``` failed with: ```text java.sql.SQLException: errCode = 2, detailMessage = cannot find column from target table [b] ``` Problem Summary: DELETE on a unique merge-on-write table with light delete disabled is rewritten to a partial update load that writes key columns and the delete sign. BindSink used to auto-add every generated column and then recompute omitted generated columns, which required ordinary value columns that were not part of the DELETE output and caused analysis to fail. This change treats DELETE partial updates specially: generated columns that are not emitted by the child plan are skipped, and generated columns that are emitted by the child plan use that child output directly. Normal partial update generated-column dependency checks are unchanged. The tests cover generated value columns, generated key columns, a generated value-column table with an omitted NOT NULL value column that has no default value, and the original VARIANT generated-column shape based on `receive_address_detail`. ### Release note Fix DELETE failure on unique merge-on-write tables with generated columns when light delete is disabled. ### Check List (For Author) - Test: Regression test / Unit Test - `./build.sh --fe -j100` - `./run-fe-ut.sh --run org.apache.doris.nereids.trees.plans.DeleteFromUsingCommandTest` - `./run-regression-test.sh --run -d regression-test/suites/ddl_p0/test_create_table_generated_column -s test_generated_column_delete -forceGenOut` - `./run-regression-test.sh --run -d regression-test/suites/ddl_p0/test_create_table_generated_column -s test_generated_column_delete` - `./run-regression-test.sh --run -d regression-test/suites/ddl_p0/test_create_table_generated_column -s test_partial_update_generated_column` - Behavior changed: Yes (DELETE now succeeds for unique merge-on-write tables with generated columns when light delete is disabled.) - Does this need documentation: No
hello-stephen
commented
Jun 30, 2026
Contributor
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
hello-stephen
commented
Jun 30, 2026
Contributor
run buildall |
hello-stephen
commented
Jun 30, 2026
Contributor
FE UT Coverage ReportIncrement line coverage |
yiguolei
approved these changes
Jul 1, 2026
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-picked from #64884