[branch-2.1] Picks "[opt](autoinc) Remove some restrictions on schema change on table that has auto-increment column #40280" (#41096)

picks https://github.com/apache/doris/pull/40280
This commit is contained in:
bobhan1
2024-09-23 09:30:15 +08:00
committed by GitHub
parent 9dc55f90eb
commit 7d64c8cbc6
5 changed files with 140 additions and 12 deletions

View File

@ -718,12 +718,6 @@ public class SchemaChangeHandler extends AlterHandler {
} // end for handling other indices
if (typeChanged && !lightSchemaChange) {
Optional<Column> autoIncCol = olapTable.getBaseSchema(true).stream()
.filter(col -> col.isAutoInc()).findFirst();
if (autoIncCol.isPresent()) {
throw new DdlException("Can not modify column " + modColumn.getName() + " becasue table "
+ olapTable.getName() + " has auto-increment column " + autoIncCol.get().getName());
}
/*
* In new alter table process (AlterJobV2), any modified columns are treated as new columns.
* But the modified columns' name does not changed. So in order to distinguish this, we will add