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 ff6be0f1d696bad..24c54ae8bcf7d67 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 a124a9fb5aad788..84adddb81eeacaf 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 2f8e157a9449c04..488ad711f4e8ab8 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 89faa7fed05223c..3477da40685cc0a 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 460d0bd43475409..b8f44f97cb2ec59 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 @@ -77,7 +77,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 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 e582414f4fc1663..be4033199ce9fb3 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