(fix)[olap] not support in_memory=true now (#18731)
* (fix)[olap] can not set in_memory=true now --------- Signed-off-by: nextdreamblue <zxw520blue1@163.com>
This commit is contained in:
@ -242,6 +242,11 @@ public class Alter {
|
||||
}
|
||||
Map<String, String> properties = clause.getProperties();
|
||||
if (properties.containsKey(PropertyAnalyzer.PROPERTIES_INMEMORY)) {
|
||||
boolean isInMemory =
|
||||
Boolean.parseBoolean(properties.get(PropertyAnalyzer.PROPERTIES_INMEMORY));
|
||||
if (isInMemory == true) {
|
||||
throw new UserException("Not support set 'in_memory'='true' now!");
|
||||
}
|
||||
needProcessOutsideTableLock = true;
|
||||
} else {
|
||||
List<String> partitionNames = clause.getPartitionNames();
|
||||
|
||||
@ -105,7 +105,11 @@ public class ModifyPartitionClause extends AlterTableClause {
|
||||
PropertyAnalyzer.analyzeReplicaAllocation(properties, "");
|
||||
|
||||
// 2. in memory
|
||||
PropertyAnalyzer.analyzeBooleanProp(properties, PropertyAnalyzer.PROPERTIES_INMEMORY, false);
|
||||
boolean isInMemory =
|
||||
PropertyAnalyzer.analyzeBooleanProp(properties, PropertyAnalyzer.PROPERTIES_INMEMORY, false);
|
||||
if (isInMemory == true) {
|
||||
throw new AnalysisException("Not support set 'in_memory'='true' now!");
|
||||
}
|
||||
|
||||
// 3. tablet type
|
||||
PropertyAnalyzer.analyzeTabletType(properties);
|
||||
|
||||
@ -97,6 +97,10 @@ public class ModifyTablePropertiesClause extends AlterTableClause {
|
||||
properties.put("default." + PropertyAnalyzer.PROPERTIES_REPLICATION_ALLOCATION,
|
||||
replicaAlloc.toCreateStmt());
|
||||
} else if (properties.containsKey(PropertyAnalyzer.PROPERTIES_INMEMORY)) {
|
||||
boolean isInMemory = Boolean.parseBoolean(properties.get(PropertyAnalyzer.PROPERTIES_INMEMORY));
|
||||
if (isInMemory == true) {
|
||||
throw new AnalysisException("Not support set 'in_memory'='true' now!");
|
||||
}
|
||||
this.needTableStable = false;
|
||||
this.opType = AlterOpType.MODIFY_TABLE_PROPERTY_SYNC;
|
||||
} else if (properties.containsKey(PropertyAnalyzer.PROPERTIES_TABLET_TYPE)) {
|
||||
|
||||
@ -146,6 +146,9 @@ public class SinglePartitionDesc implements AllPartitionDesc {
|
||||
|
||||
// analyze in memory
|
||||
isInMemory = PropertyAnalyzer.analyzeBooleanProp(properties, PropertyAnalyzer.PROPERTIES_INMEMORY, false);
|
||||
if (isInMemory == true) {
|
||||
throw new AnalysisException("Not support set 'in_memory'='true' now!");
|
||||
}
|
||||
|
||||
// analyze is mutable
|
||||
isMutable = PropertyAnalyzer.analyzeBooleanProp(properties, PropertyAnalyzer.PROPERTIES_MUTABLE, true);
|
||||
|
||||
@ -2982,8 +2982,10 @@ public class Env {
|
||||
}
|
||||
|
||||
// in memory
|
||||
sb.append(",\n\"").append(PropertyAnalyzer.PROPERTIES_INMEMORY).append("\" = \"");
|
||||
sb.append(olapTable.isInMemory()).append("\"");
|
||||
if (olapTable.isInMemory()) {
|
||||
sb.append(",\n\"").append(PropertyAnalyzer.PROPERTIES_INMEMORY).append("\" = \"");
|
||||
sb.append(olapTable.isInMemory()).append("\"");
|
||||
}
|
||||
|
||||
// storage type
|
||||
sb.append(",\n\"").append(PropertyAnalyzer.PROPERTIES_STORAGE_FORMAT).append("\" = \"");
|
||||
|
||||
@ -2016,7 +2016,10 @@ public class InternalCatalog implements CatalogIf<Database> {
|
||||
// set in memory
|
||||
boolean isInMemory = PropertyAnalyzer.analyzeBooleanProp(properties, PropertyAnalyzer.PROPERTIES_INMEMORY,
|
||||
false);
|
||||
olapTable.setIsInMemory(isInMemory);
|
||||
if (isInMemory == true) {
|
||||
throw new AnalysisException("Not support set 'in_memory'='true' now!");
|
||||
}
|
||||
olapTable.setIsInMemory(false);
|
||||
|
||||
boolean storeRowColumn = false;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user