xy720 commented on a change in pull request #3981:
URL: https://github.com/apache/incubator-doris/pull/3981#discussion_r451273362



##########
File path: fe/src/main/java/org/apache/doris/analysis/ModifyPartitionClause.java
##########
@@ -48,27 +61,80 @@ public ModifyPartitionClause(String partitionName, 
Map<String, String> propertie
         this.needTableStable = false;
     }
 
+    // c'tor for 'Modify Partition(*)' clause
+    private ModifyPartitionClause(Map<String, String> properties) {
+        super(AlterOpType.MODIFY_PARTITION);
+        this.partitionNames = Lists.newArrayList();
+        this.properties = properties;
+        this.needExpand = true;
+        this.needTableStable = false;
+    }
+
+    public static ModifyPartitionClause createStarClause(Map<String, String> 
properties) {
+        return new ModifyPartitionClause(properties);
+    }
+
     @Override
     public void analyze(Analyzer analyzer) throws AnalysisException {
-        if (Strings.isNullOrEmpty(partitionName)) {
-            throw new AnalysisException("Partition name is not set");
+        if (partitionNames == null || (!needExpand && 
partitionNames.isEmpty())) {
+            throw new AnalysisException("Partition names is not set or empty");
+        }
+
+        if (partitionNames.stream().anyMatch(entity -> 
Strings.isNullOrEmpty(entity))) {
+            throw new AnalysisException("there are empty partition name");
         }
 
         if (properties == null || properties.isEmpty()) {
             throw new AnalysisException("Properties is not set");
         }
+
+        // check properties here
+        preCheck(Maps.newHashMap(properties));
+    }
+
+    // pre check the following properties' legality before modifying partition.
+    // 1. replication_num
+    // 2. storage_medium && storage_cooldown_time
+    // 3. in_memory
+    // 4. tablet type
+    public static void preCheck(Map<String, String> properties) throws 
AnalysisException {

Review comment:
       done




----------------------------------------------------------------
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.

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

Reply via email to