(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:
xueweizhang
2023-04-21 21:55:37 +08:00
committed by GitHub
parent 0ae3a6df7e
commit f7651d8dfb
29 changed files with 206 additions and 204 deletions

View File

@ -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();

View File

@ -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);

View File

@ -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)) {

View File

@ -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);

View File

@ -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("\" = \"");

View File

@ -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 {