[fix](partial update) keep case insensitivity and use the columns' origin names in partialUpdateCols in origin planner (#27223)

close: #27161
This commit is contained in:
bobhan1
2023-11-20 21:16:28 +08:00
committed by GitHub
parent fec94b7278
commit 0b459e50fb
3 changed files with 154 additions and 2 deletions

View File

@ -1156,7 +1156,7 @@ public class NativeInsertStmt extends InsertStmt {
for (Column col : olapTable.getFullSchema()) {
boolean exists = false;
for (Column insertCol : targetColumns) {
if (insertCol.getName() != null && insertCol.getName().equals(col.getName())) {
if (insertCol.getName() != null && insertCol.getName().equalsIgnoreCase(col.getName())) {
if (!col.isVisible() && !Column.DELETE_SIGN.equals(col.getName())) {
throw new UserException("Partial update should not include invisible column except"
+ " delete sign column: " + col.getName());
@ -1171,7 +1171,11 @@ public class NativeInsertStmt extends InsertStmt {
}
isPartialUpdate = true;
partialUpdateCols.addAll(targetColumnNames);
for (String name : targetColumnNames) {
Column column = olapTable.getFullSchema().stream()
.filter(col -> col.getName().equalsIgnoreCase(name)).findFirst().get();
partialUpdateCols.add(column.getName());
}
if (isPartialUpdate && olapTable.hasSequenceCol() && olapTable.getSequenceMapCol() != null
&& partialUpdateCols.contains(olapTable.getSequenceMapCol())) {
partialUpdateCols.add(Column.SEQUENCE_COL);