morningman commented on code in PR #17148:
URL: https://github.com/apache/doris/pull/17148#discussion_r1118186121
##########
fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeHandler.java:
##########
@@ -1969,6 +1976,12 @@ public void updatePartitionsProperties(Database db,
String tableName, List<Strin
}
}
String storagePolicy =
properties.get(PropertyAnalyzer.PROPERTIES_STORAGE_POLICY);
+ boolean enableUniqueKeyMergeOnWrite =
olapTable.getEnableUniqueKeyMergeOnWrite();
+ if (enableUniqueKeyMergeOnWrite && !storagePolicy.equals("")) {
Review Comment:
```suggestion
if (enableUniqueKeyMergeOnWrite &&
!Strings.isNullOrEmpty(storagePolicy)) {
```
##########
fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeHandler.java:
##########
@@ -1934,6 +1936,11 @@ public void updateTableProperties(Database db, String
tableName, Map<String, Str
}
}
String storagePolicy =
properties.get(PropertyAnalyzer.PROPERTIES_STORAGE_POLICY);
+ if (enableUniqueKeyMergeOnWrite && !storagePolicy.equals("")) {
Review Comment:
```suggestion
if (enableUniqueKeyMergeOnWrite &&
!Strings.isNullOrEmpty(storagePolicy)) {
```
##########
fe/fe-core/src/main/java/org/apache/doris/analysis/ModifyTablePropertiesClause.java:
##########
@@ -101,7 +101,14 @@ public void analyze(Analyzer analyzer) throws
AnalysisException {
throw new AnalysisException("Alter tablet type not supported");
} else if
(properties.containsKey(PropertyAnalyzer.PROPERTIES_STORAGE_POLICY)) {
this.needTableStable = false;
-
setStoragePolicy(properties.getOrDefault(PropertyAnalyzer.PROPERTIES_STORAGE_POLICY,
""));
+ String storagePolicy =
properties.getOrDefault(PropertyAnalyzer.PROPERTIES_STORAGE_POLICY, "");
+ if (!storagePolicy.equals("")
Review Comment:
```suggestion
if (!Strings.isNullOrEmpty(storagePolicy)
```
##########
fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java:
##########
@@ -2013,6 +2013,11 @@ private void createOlapTable(Database db,
CreateTableStmt stmt) throws UserExcep
// set storage policy
String storagePolicy =
PropertyAnalyzer.analyzeStoragePolicy(properties);
Env.getCurrentEnv().getPolicyMgr().checkStoragePolicyExist(storagePolicy);
+ if (olapTable.getEnableUniqueKeyMergeOnWrite() &&
!storagePolicy.equals("")) {
Review Comment:
```suggestion
if (olapTable.getEnableUniqueKeyMergeOnWrite() &&
!Strings.isNullOrEmpty(storagePolicy)) {
```
##########
fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java:
##########
@@ -2231,6 +2236,11 @@ private void createOlapTable(Database db,
CreateTableStmt stmt) throws UserExcep
DistributionInfo partitionDistributionInfo =
distributionDesc.toDistributionInfo(baseSchema);
// use partition storage policy if it exist.
String partionStoragePolicy =
partitionInfo.getStoragePolicy(entry.getValue());
+ if (olapTable.getEnableUniqueKeyMergeOnWrite() &&
!partionStoragePolicy.equals("")) {
Review Comment:
```suggestion
if (olapTable.getEnableUniqueKeyMergeOnWrite() &&
!Strings.isNullOrEmpty(partitionStoragePolicy)) {
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]