yujun777 commented on code in PR #30069: URL: https://github.com/apache/doris/pull/30069#discussion_r1458253522
########## fe/fe-core/src/main/java/org/apache/doris/common/util/PropertyAnalyzer.java: ########## @@ -194,6 +195,55 @@ public class PropertyAnalyzer { public static final long TIME_SERIES_COMPACTION_TIME_THRESHOLD_SECONDS_DEFAULT_VALUE = 3600; public static final long TIME_SERIES_COMPACTION_EMPTY_ROWSETS_THRESHOLD_DEFAULT_VALUE = 5; + // for unsupported property map, + // if property can ignore and use a default string, then its value is the default value, + // if property can't ignore, then its value is null + private static final Map<String, String> unsupportedProperties; + + static { + unsupportedProperties = Maps.newHashMap(); + if (Config.isCloudMode()) { + ReplicaAllocation singleReplica = new ReplicaAllocation((short) 1); + unsupportedProperties.put(PROPERTIES_INMEMORY, "true"); + //unsupportedProperties.put(PROPERTIES_STORAGE_MEDIUM, ""); + //unsupportedProperties.put(DynamicPartitionProperty.PROPERTIES_STORAGE_MEDIUM, ""); + unsupportedProperties.put(PROPERTIES_STORAGE_FORMAT, ""); + unsupportedProperties.put(PROPERTIES_STORAGE_POLICY, ""); + unsupportedProperties.put(PROPERTIES_STORAGE_COOLDOWN_TIME, ""); + unsupportedProperties.put(PROPERTIES_MIN_LOAD_REPLICA_NUM, "-1"); + unsupportedProperties.put(PROPERTIES_DISABLE_AUTO_COMPACTION, "false"); + unsupportedProperties.put(PROPERTIES_ENABLE_LIGHT_SCHEMA_CHANGE, "true"); + unsupportedProperties.put(PROPERTIES_REPLICATION_NUM, "1"); + unsupportedProperties.put(DynamicPartitionProperty.REPLICATION_NUM, "1"); + unsupportedProperties.put(PROPERTIES_REPLICATION_ALLOCATION, singleReplica.toCreateStmt()); + unsupportedProperties.put(DynamicPartitionProperty.REPLICATION_ALLOCATION, + singleReplica.toCreateStmt()); + } else { + unsupportedProperties.put(PROPERTIES_FILE_CACHE_TTL_SECONDS, "0"); + } + } + + public static void checkAndRewriteProperties(Map<String, String> properties) throws AnalysisException { + if (properties == null) { + return; + } + for (String property : properties.keySet()) { + if (!unsupportedProperties.containsKey(property)) { + continue; + } + + String value = unsupportedProperties.get(property); + if (value != null) { Review Comment: update -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org