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


##########
flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/service/operation/OperationExecutor.java:
##########
@@ -518,7 +519,7 @@ private ResultFetcher executeOperation(
         } else if (op instanceof EndStatementSetOperation) {
             throw new SqlExecutionException(
                     "No Statement Set to submit. 'END' statement should be 
used after 'BEGIN STATEMENT SET'.");
-        } else if (op instanceof ModifyOperation) {
+        } else if (op instanceof ModifyOperation && !(op instanceof 
MaterializedTableOperation)) {

Review Comment:
   `MaterializedTableOperation` is a marker shared by SUSPEND, RESUME, REFRESH 
and DROP too. Those have no definition query, so they can't implement the` 
ModifyOperation` contract (`getChild()` / `accept(visitor)`) in any meaningful 
way. More importantly, if the marker were a `ModifyOperation`, every MT op 
would fall into the `callModifyOperations` branch and execute as an `INSERT`. 
   
   That's what the `&& !(op instanceof MaterializedTableOperation)` guard 
enforces. So only the query-bearing operations implement `ModifyOperation`, and 
purely so the planner can translate them into a sink for `EXPLAIN`. Execution 
still goes through the manager for all of them.



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