This reverts commit 00c8bab84de8154052f9d323800b436cd0ad36e5.
This commit is contained in:
@ -423,7 +423,6 @@ public class CreateTableStmt extends DdlStmt {
|
||||
if (keysDesc.getKeysType() == KeysType.UNIQUE_KEYS) {
|
||||
enableUniqueKeyMergeOnWrite = false;
|
||||
if (properties != null) {
|
||||
properties = PropertyAnalyzer.enableUniqueKeyMergeOnWriteIfNotExists(properties);
|
||||
// `analyzeXXX` would modify `properties`, which will be used later,
|
||||
// so we just clone a properties map here.
|
||||
enableUniqueKeyMergeOnWrite = PropertyAnalyzer.analyzeUniqueKeyMergeOnWrite(
|
||||
|
||||
@ -3215,8 +3215,8 @@ public class Env {
|
||||
sb.append(olapTable.getEstimatePartitionSize()).append("\"");
|
||||
}
|
||||
|
||||
// unique key table with merge on write, always print this property for unique table
|
||||
if (olapTable.getKeysType() == KeysType.UNIQUE_KEYS) {
|
||||
// unique key table with merge on write
|
||||
if (olapTable.getKeysType() == KeysType.UNIQUE_KEYS && olapTable.getEnableUniqueKeyMergeOnWrite()) {
|
||||
sb.append(",\n\"").append(PropertyAnalyzer.ENABLE_UNIQUE_KEY_MERGE_ON_WRITE).append("\" = \"");
|
||||
sb.append(olapTable.getEnableUniqueKeyMergeOnWrite()).append("\"");
|
||||
}
|
||||
|
||||
@ -461,9 +461,6 @@ public class TableProperty implements Writable {
|
||||
properties.put(PropertyAnalyzer.ENABLE_UNIQUE_KEY_MERGE_ON_WRITE, Boolean.toString(enable));
|
||||
}
|
||||
|
||||
// In order to ensure that unique tables without the `enable_unique_key_merge_on_write` property specified
|
||||
// before version 2.1 still maintain the merge-on-read implementation after the upgrade, we will keep
|
||||
// the default value here as false.
|
||||
public boolean getEnableUniqueKeyMergeOnWrite() {
|
||||
return Boolean.parseBoolean(properties.getOrDefault(
|
||||
PropertyAnalyzer.ENABLE_UNIQUE_KEY_MERGE_ON_WRITE, "false"));
|
||||
|
||||
@ -1280,13 +1280,4 @@ public class PropertyAnalyzer {
|
||||
return properties;
|
||||
}
|
||||
|
||||
// Since we can't change the default value of the property `enable_unique_key_merge_on_write`
|
||||
// due to backward compatibility, we just explicitly set the value of this property to `true` if
|
||||
// the user doesn't specify the property in `CreateTableStmt`/`CreateTableInfo`
|
||||
public static Map<String, String> enableUniqueKeyMergeOnWriteIfNotExists(Map<String, String> properties) {
|
||||
if (properties != null && properties.get(PropertyAnalyzer.ENABLE_UNIQUE_KEY_MERGE_ON_WRITE) == null) {
|
||||
properties.put(PropertyAnalyzer.ENABLE_UNIQUE_KEY_MERGE_ON_WRITE, "true");
|
||||
}
|
||||
return properties;
|
||||
}
|
||||
}
|
||||
|
||||
@ -264,10 +264,6 @@ public class CreateTableInfo {
|
||||
+ " set 'true' when create olap table by default.");
|
||||
}
|
||||
|
||||
if (keysType.equals(KeysType.UNIQUE_KEYS)) {
|
||||
properties = PropertyAnalyzer.enableUniqueKeyMergeOnWriteIfNotExists(properties);
|
||||
}
|
||||
|
||||
if (properties != null && properties.containsKey(PropertyAnalyzer.ENABLE_UNIQUE_KEY_MERGE_ON_WRITE)) {
|
||||
if (!keysType.equals(KeysType.UNIQUE_KEYS)) {
|
||||
throw new AnalysisException(PropertyAnalyzer.ENABLE_UNIQUE_KEY_MERGE_ON_WRITE
|
||||
|
||||
Reference in New Issue
Block a user