[pick](Variant) check enable light_schema_change when create table with variant type (#41102)

#40908
This commit is contained in:
lihangyu
2024-09-23 14:30:16 +08:00
committed by GitHub
parent f6917acd6a
commit 76d62c42db
2 changed files with 26 additions and 0 deletions

View File

@ -2358,6 +2358,16 @@ public class InternalCatalog implements CatalogIf<Database> {
// use light schema change optimization
olapTable.setEnableLightSchemaChange(enableLightSchemaChange);
// check if light schema change is disabled, variant type rely on light schema change
if (!enableLightSchemaChange) {
for (Column column : baseSchema) {
if (column.getType().isVariantType()) {
throw new DdlException("Variant type rely on light schema change, "
+ " please use light_schema_change = true.");
}
}
}
boolean disableAutoCompaction = false;
try {
disableAutoCompaction = PropertyAnalyzer.analyzeDisableAutoCompaction(properties);