lsyldliu commented on code in PR #25880:
URL: https://github.com/apache/flink/pull/25880#discussion_r1900848607


##########
flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/service/materializedtable/MaterializedTableManager.java:
##########
@@ -804,6 +808,78 @@ protected static String getRefreshStatement(
         return insertStatement.toString();
     }
 
+    private ResultFetcher callAlterMaterializedTableAsQueryOperation(
+            OperationExecutor operationExecutor,
+            OperationHandle handle,
+            AlterMaterializedTableAsQueryOperation op) {
+        ObjectIdentifier tableIdentifier = op.getTableIdentifier();
+        CatalogMaterializedTable materializedTable =
+                getCatalogMaterializedTable(operationExecutor, 
tableIdentifier);

Review Comment:
   After some thinking last night, I believe the overall process for this 
method should be as follows:
   
   1. Compile the select query in the appropriate full or continuous refresh 
mode and verify that the query is correct.
   2. Suspend the refresh job in continuous mode; do nothing for full mode.
   3. Alter the materialized table by TableChange.
   4. Start the refresh job in continuous mode using the new query; do nothing 
for full mode.
   5. If starting the refresh job in continuous mode fails, roll back the 
TableChange, and then resume the continuous job using the old query. And then 
throw exception



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to