Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix](delete) Fix error when creating a non-MOW table while the default value of enable_mow_light_delete is true #40197

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1466,14 +1466,15 @@ public static boolean analyzeUniqueKeyMergeOnWrite(Map<String, String> propertie
throw new AnalysisException(PropertyAnalyzer.ENABLE_UNIQUE_KEY_MERGE_ON_WRITE + " must be `true` or `false`");
}

public static boolean analyzeEnableDeleteOnDeletePredicate(Map<String, String> properties)
public static boolean analyzeEnableDeleteOnDeletePredicate(Map<String, String> properties,
boolean enableUniqueKeyMergeOnWrite)
throws AnalysisException {
if (properties == null || properties.isEmpty()) {
return Config.enable_mow_light_delete;
return enableUniqueKeyMergeOnWrite ? Config.enable_mow_light_delete : false;
}
String value = properties.get(PropertyAnalyzer.PROPERTIES_ENABLE_MOW_LIGHT_DELETE);
if (value == null) {
return Config.enable_mow_light_delete;
return enableUniqueKeyMergeOnWrite ? Config.enable_mow_light_delete : false;
}
properties.remove(PropertyAnalyzer.PROPERTIES_ENABLE_MOW_LIGHT_DELETE);
if (value.equals("true")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2655,7 +2655,8 @@ private boolean createOlapTable(Database db, CreateTableStmt stmt) throws UserEx

boolean enableDeleteOnDeletePredicate = false;
try {
enableDeleteOnDeletePredicate = PropertyAnalyzer.analyzeEnableDeleteOnDeletePredicate(properties);
enableDeleteOnDeletePredicate = PropertyAnalyzer.analyzeEnableDeleteOnDeletePredicate(properties,
enableUniqueKeyMergeOnWrite);
} catch (AnalysisException e) {
throw new DdlException(e.getMessage());
}
Expand Down
Loading