[fix](fe) Key column varchar length change should't light schema change (#28235)
This commit is contained in:
@ -588,7 +588,13 @@ public class SchemaChangeHandler extends AlterHandler {
|
||||
if (columnPos == null && col.getDataType() == PrimitiveType.VARCHAR
|
||||
&& modColumn.getDataType() == PrimitiveType.VARCHAR) {
|
||||
col.checkSchemaChangeAllowed(modColumn);
|
||||
lightSchemaChange = olapTable.getEnableLightSchemaChange();
|
||||
// If col and modColumn is not key, it allow light schema change,
|
||||
// of course, olapTable has been enable light schema change
|
||||
if (modColumn.isKey() || col.isKey()) {
|
||||
lightSchemaChange = false;
|
||||
} else {
|
||||
lightSchemaChange = olapTable.getEnableLightSchemaChange();
|
||||
}
|
||||
}
|
||||
if (col.isClusterKey()) {
|
||||
throw new DdlException("Can not modify cluster key column: " + col.getName());
|
||||
|
||||
@ -1475,7 +1475,7 @@ public class InternalCatalog implements CatalogIf<Database> {
|
||||
if (!hashDistributionInfo.sameDistributionColumns((HashDistributionInfo) defaultDistributionInfo)) {
|
||||
throw new DdlException("Cannot assign hash distribution with different distribution cols. "
|
||||
+ "new is: " + hashDistributionInfo.getDistributionColumns() + " default is: "
|
||||
+ ((HashDistributionInfo) distributionInfo).getDistributionColumns());
|
||||
+ ((HashDistributionInfo) defaultDistributionInfo).getDistributionColumns());
|
||||
}
|
||||
} else if (distributionInfo.getType() == DistributionInfoType.RANDOM) {
|
||||
RandomDistributionInfo randomDistributionInfo = (RandomDistributionInfo) distributionInfo;
|
||||
|
||||
Reference in New Issue
Block a user