raminqaf commented on code in PR #29843:
URL: https://github.com/apache/flink/pull/29843#discussion_r4536136287


##########
docs/content.zh/docs/sql/materialized-table/statements.md:
##########
@@ -81,6 +81,9 @@ AS <select_statement>
 }
 ```
 
+If the refresh job starts but the catalog cannot record it, CREATE cancels the 
job and drops the table it created.

Review Comment:
   Is this for the case of `full` mode? I am asking because the next sentence 
starts  with`In continuous mode...`



##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/delegation/materializedtable/DefaultMaterializedTableExecutor.java:
##########
@@ -191,8 +195,15 @@ private void createMaterializedTableInContinuousMode(
         } catch (Exception e) {
             // drop materialized table if submitting the Flink streaming job 
encounters an
             // exception. Thus, weak atomicity is guaranteed
-            new DropMaterializedTableOperation(materializedTableIdentifier, 
true)
-                    .execute(operationCtx);
+            cleanUpAfterFailure(
+                    () ->
+                            new 
DropMaterializedTableOperation(materializedTableIdentifier, true)
+                                    .execute(operationCtx),
+                    e,
+                    String.format(
+                            "Failed to submit continuous refresh job for 
materialized table %s, and dropping the table failed as well."

Review Comment:
   here and everywhere else
   ```suggestion
                               "Failed to submit continuous refresh job for 
materialized table '%s', and dropping the table failed as well."
   ```



##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/delegation/materializedtable/DefaultMaterializedTableExecutor.java:
##########
@@ -108,6 +108,10 @@ public class DefaultMaterializedTableExecutor implements 
MaterializedTableExecut
     private static final Logger LOG =
             LoggerFactory.getLogger(DefaultMaterializedTableExecutor.class);
 
+    private static final String LEFT_IN_INITIALIZING_STATUS =
+            " The table was left in INITIALIZING status. No materialized table 
statement can drop a"
+                    + " table in this status or move it out of it. Remove it 
from the catalog directly.";

Review Comment:
   Do users know what `INITIALIZING` status is?



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