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 #26776 (#26848)
  • Loading branch information
bobhan1 authored Nov 13, 2023
1 parent d25f02c commit 925ff56
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 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 @@ -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
Expand All @@ -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'
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 Expand Up @@ -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'
Expand Down

0 comments on commit 925ff56

Please sign in to comment.