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


##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/operations/SqlNodeToOperationSqlCreateOrAlterMaterializedTableConverterTest.java:
##########
@@ -261,6 +261,73 @@ void 
testCreateOrAlterMaterializedTableWithDistributionForExistingTable()
                                 + "  MODIFY DISTRIBUTED BY HASH(`b`) INTO 4 
BUCKETS");
     }
 
+    @Test
+    void testCreateOrAlterMaterializedTableWithDroppedConstraint() {
+        final String sql =
+                "CREATE OR ALTER MATERIALIZED TABLE mt \n"
+                        + "COMMENT 'New materialized table comment'\n"
+                        + "PARTITIONED BY (a, d)\n"
+                        + "WITH (\n"
+                        + "  'connector' = 'filesystem', \n"
+                        + "  'format' = 'json'\n"
+                        + ")\n"
+                        + "REFRESH_MODE = FULL\n"
+                        + "AS SELECT * FROM t1";
+        Operation operation = parse(sql);
+
+        
assertThat(operation).isInstanceOf(FullAlterMaterializedTableOperation.class);
+
+        FullAlterMaterializedTableOperation op = 
(FullAlterMaterializedTableOperation) operation;
+        assertThat(op.getTableChanges())
+                .containsExactly(
+                        TableChange.dropConstraint("ct1"),
+                        TableChange.modifyDefinitionQuery(
+                                "SELECT *\n" + "FROM `t1`",
+                                "SELECT `t1`.`a`, `t1`.`b`, `t1`.`c`, 
`t1`.`d`\n"
+                                        + "FROM `builtin`.`default`.`t1` AS 
`t1`"));
+        assertThat(operation.asSummaryString())
+                .isEqualTo(
+                        "CREATE OR ALTER MATERIALIZED TABLE 
builtin.default.mt\n"
+                                + "  DROP CONSTRAINT ct1,\n"

Review Comment:
   in fact the only difference was for changing query, so made it using 2 
spaces as for all others



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