Skip to content

Commit

Permalink
[regression](partial update) Add cases when the deleted rows have non…
Browse files Browse the repository at this point in the history
… nullable columns without default value (apache#26776)
  • Loading branch information
bobhan1 authored and seawinde committed Nov 13, 2023
1 parent ab93383 commit 30f24e9
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 30f24e9

Please sign in to comment.