diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/DeleteStmt.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/DeleteStmt.java index ff6be0f1d696ba..24c54ae8bcf7d6 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/DeleteStmt.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/DeleteStmt.java @@ -157,7 +157,7 @@ private void constructInsertStmt() throws AnalysisException { expr = new BoolLiteral(true); } else if (column.isKey()) { expr = new SlotRef(targetTableRef.getAliasAsName(), column.getName()); - } else if (!isMow && !column.isVisible() || (!column.isAllowNull() && !column.hasDefaultValue())) { + } else if (!isMow && !column.isVisible()) { expr = new SlotRef(targetTableRef.getAliasAsName(), column.getName()); } else { continue; diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/DeleteCommand.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/DeleteCommand.java index dba753264ae218..fa6fd629008389 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/DeleteCommand.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/DeleteCommand.java @@ -103,7 +103,7 @@ public LogicalPlan completeQueryPlan(ConnectContext ctx, LogicalPlan logicalQuer selectLists.add(new UnboundSlot(tableName, targetTable.getSequenceMapCol())); } else if (column.isKey()) { selectLists.add(new UnboundSlot(tableName, column.getName())); - } else if ((!isMow && !column.isVisible()) || (!column.isAllowNull() && !column.hasDefaultValue())) { + } else if (!isMow && !column.isVisible()) { selectLists.add(new UnboundSlot(tableName, column.getName())); } else { continue; diff --git a/regression-test/data/nereids_p0/delete/delete_mow_partial_update.out b/regression-test/data/nereids_p0/delete/delete_mow_partial_update.out index 2f8e157a9449c0..488ad711f4e8ab 100644 --- a/regression-test/data/nereids_p0/delete/delete_mow_partial_update.out +++ b/regression-test/data/nereids_p0/delete/delete_mow_partial_update.out @@ -36,11 +36,11 @@ 5 5 5 5 5 -- !sql -- -1 \N \N \N \N 1 +1 \N \N 0 \N 1 1 1 1 1 1 0 -2 \N \N \N \N 1 +2 \N \N 0 \N 1 2 2 2 2 2 0 -3 \N \N \N \N 1 +3 \N \N 0 \N 1 3 3 3 3 3 0 4 4 4 4 4 0 5 5 5 5 5 0 diff --git a/regression-test/data/unique_with_mow_p0/partial_update/test_partial_update_delete.out b/regression-test/data/unique_with_mow_p0/partial_update/test_partial_update_delete.out index 89faa7fed05223..3477da40685cc0 100644 --- a/regression-test/data/unique_with_mow_p0/partial_update/test_partial_update_delete.out +++ b/regression-test/data/unique_with_mow_p0/partial_update/test_partial_update_delete.out @@ -11,11 +11,11 @@ 5 5 5 5 5 -- !with_delete_sign -- -1 \N \N \N \N 1 +1 \N \N 0 \N 1 1 1 1 1 1 0 -2 \N \N \N \N 1 +2 \N \N 0 \N 1 2 2 2 2 2 0 -3 \N \N \N \N 1 +3 \N \N 0 \N 1 3 3 3 3 3 0 4 4 4 4 4 0 5 5 5 5 5 0 diff --git a/regression-test/suites/nereids_p0/delete/delete_mow_partial_update.groovy b/regression-test/suites/nereids_p0/delete/delete_mow_partial_update.groovy index 6f3221e702ce61..f510724629da02 100644 --- a/regression-test/suites/nereids_p0/delete/delete_mow_partial_update.groovy +++ b/regression-test/suites/nereids_p0/delete/delete_mow_partial_update.groovy @@ -78,7 +78,7 @@ suite('nereids_delete_mow_partial_update') { `k1` int NOT NULL, `c1` int, `c2` int, - `c3` int, + `c3` int NOT NULL, `c4` int )UNIQUE KEY(k1) DISTRIBUTED BY HASH(k1) BUCKETS 1 @@ -95,7 +95,7 @@ suite('nereids_delete_mow_partial_update') { set 'column_separator', ',' set 'format', 'csv' set 'columns', 'k1' - set 'partial_colunms', 'true' + set 'partial_columns', 'true' set 'merge_type', 'DELETE' file 'partial_update_delete.csv' diff --git a/regression-test/suites/unique_with_mow_p0/partial_update/test_partial_update_delete.groovy b/regression-test/suites/unique_with_mow_p0/partial_update/test_partial_update_delete.groovy index f8ed38c96f50d4..fc413cdcae1d8a 100644 --- a/regression-test/suites/unique_with_mow_p0/partial_update/test_partial_update_delete.groovy +++ b/regression-test/suites/unique_with_mow_p0/partial_update/test_partial_update_delete.groovy @@ -26,7 +26,7 @@ suite('test_partial_update_delete') { `k1` int NOT NULL, `c1` int, `c2` int, - `c3` int, + `c3` int NOT NULL, `c4` int )UNIQUE KEY(k1) DISTRIBUTED BY HASH(k1) BUCKETS 1 @@ -84,7 +84,7 @@ suite('test_partial_update_delete') { set 'column_separator', ',' set 'format', 'csv' set 'columns', 'k1' - set 'partial_colunms', 'true' + set 'partial_columns', 'true' set 'merge_type', 'DELETE' file 'partial_update_delete.csv'