snuyanzin commented on code in PR #27292:
URL: https://github.com/apache/flink/pull/27292#discussion_r2577599981


##########
flink-table/flink-sql-parser/src/main/java/org/apache/flink/sql/parser/ddl/SqlAlterMaterializedTableDistribution.java:
##########
@@ -50,13 +50,39 @@ public List<SqlNode> getOperandList() {
     @Override
     public void unparseAlterOperation(SqlWriter writer, int leftPrec, int 
rightPrec) {
         super.unparseAlterOperation(writer, leftPrec, rightPrec);
-        writer.keyword("MODIFY");
-        if (distribution != null) {
-            distribution.unparseAlter(writer, leftPrec, rightPrec);
-        }
+        writer.keyword(getAlterOperation());
+        distribution.unparseAlter(writer, leftPrec, rightPrec);
     }
 
     public Optional<SqlDistribution> getDistribution() {
         return Optional.ofNullable(distribution);
     }
+
+    public static class SqlAlterMaterializedTableAddDistribution
+            extends SqlAlterMaterializedTableDistribution {
+
+        public SqlAlterMaterializedTableAddDistribution(
+                SqlParserPos pos, SqlIdentifier tableName, SqlDistribution 
distribution) {
+            super(pos, tableName, distribution);
+        }
+
+        @Override
+        protected String getAlterOperation() {
+            return "ADD";
+        }
+    }
+
+    public static class SqlAlterMaterializedTableModifyDistribution
+            extends SqlAlterMaterializedTableDistribution {
+
+        public SqlAlterMaterializedTableModifyDistribution(
+                SqlParserPos pos, SqlIdentifier tableName, SqlDistribution 
distribution) {
+            super(pos, tableName, distribution);
+        }
+
+        @Override
+        protected String getAlterOperation() {
+            return "MODIFY";
+        }
+    }

Review Comment:
   No, it is the refactoring part for distribution.
   Support of `MODIFY` for distribution was added at FLINK-38311
   here there is no functional changes, just making code more compact



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

Reply via email to