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


##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/operations/SqlNodeToOperationSqlCreateOrAlterMaterializedTableConverterTest.java:
##########
@@ -308,6 +308,37 @@ void 
testCreateOrAlterMaterializedTableWithChangedConstraint() {
                                 + "  MODIFY CONSTRAINT `new_constraint` 
PRIMARY KEY (`a`) NOT ENFORCED");
     }
 
+    @Test
+    void testCreateOrAlterMaterializedTableWithNewConstraint()

Review Comment:
   done



##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/operations/SqlNodeToOperationSqlCreateOrAlterMaterializedTableConverterTest.java:
##########
@@ -413,20 +413,55 @@ void 
testCreateOrAlterMaterializedTableWithDroppedWatermark2()
     }
 
     @Test
-    void testCreateOrAlterMaterializedTableWithModifiedWatermark2()
+    void testCreateOrAlterMaterializedTableWithCommentChange()
+            throws TableAlreadyExistException, DatabaseNotExistException {
+        final String prepSql =
+                "CREATE MATERIALIZED TABLE mt1 (\n"
+                        + "   id INT COMMENT 'INT comment', t 
TIMESTAMP_LTZ(3)\n"
+                        + ")\n"
+                        + "AS SELECT 1 as id, current_timestamp as t";
+        createMaterializedTableInCatalog(prepSql, "mt1");
+
+        final String sql =
+                "CREATE OR ALTER MATERIALIZED TABLE mt1 (\n"
+                        + "   id INT, t TIMESTAMP_LTZ(3) COMMENT 'Timestamp 
Comment'\n"
+                        + ")\n"
+                        + "AS SELECT 1 as id, current_timestamp as t";
+        Operation operation = parse(sql);
+
+        
assertThat(operation).isInstanceOf(FullAlterMaterializedTableOperation.class);
+
+        FullAlterMaterializedTableOperation op = 
(FullAlterMaterializedTableOperation) operation;
+        assertThat(op.getTableChanges())
+                .containsExactly(
+                        TableChange.modifyColumnComment(
+                                Column.physical("id", 
DataTypes.INT()).withComment("INT comment"),
+                                null),
+                        TableChange.modifyColumnComment(
+                                Column.physical("t", 
DataTypes.TIMESTAMP_WITH_LOCAL_TIME_ZONE(3)),
+                                "Timestamp Comment"));
+        assertThat(operation.asSummaryString())
+                .isEqualTo(
+                        "CREATE OR ALTER MATERIALIZED TABLE 
builtin.default.mt1\n"
+                                + "  MODIFY `id` COMMENT '',\n"
+                                + "  MODIFY `t` COMMENT 'Timestamp Comment'");
+    }
+
+    @Test
+    void testCreateOrAlterMaterializedTableWithModifiedWatermark()
             throws TableAlreadyExistException, DatabaseNotExistException {
         final String prepSql =
                 "CREATE MATERIALIZED TABLE mt1 (\n"
                         + "   id INT, t TIMESTAMP_LTZ(3),\n"
-                        + "   WATERMARK FOR t as current_timestamp - INTERVAL 
'5' SECOND"
+                        + "   WATERMARK FOR t as current_timestamp - INTERVAL 
'5' SECOND\n"

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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to