twalthr commented on a change in pull request #18215:
URL: https://github.com/apache/flink/pull/18215#discussion_r783150473



##########
File path: 
flink-table/flink-sql-parser/src/main/codegen/includes/parserImpls.ftl
##########
@@ -1738,6 +1765,28 @@ SqlNode SqlRichExplain() :
     }
 }
 
+/**
+* Parses a execute statement.
+*/
+SqlNode SqlExecute() :
+{
+    SqlParserPos startPos;
+    SqlNode stmt;
+}
+{
+    <EXECUTE>{ startPos = getPos(); }
+    (
+        stmt = SqlStatementSet()
+        |
+        stmt = OrderedQueryOrExpr(ExprContext.ACCEPT_QUERY)

Review comment:
       Just to double check: Does this include the `WITH` clause?
   
   https://modern-sql.com/feature/with

##########
File path: 
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/operations/SqlToOperationConverterTest.java
##########
@@ -1489,6 +1491,50 @@ public void testSqlRichExplainWithInsert() {
         assertThat(operation).isInstanceOf(ExplainOperation.class);
     }
 
+    @Test
+    public void testSqlRichExplainWithStatementSet() {
+        final String sql =
+                "explain plan for statement set begin "

Review comment:
       Please check 
https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=191336489#FLIP190:SupportVersionUpgradesforTableAPI&SQLPrograms-EXPLAIN
   
   ```
   However, the PLAN FOR provides no additional benefit and disables specifying 
the explain details.
   
   Note: Since "PLAN" should be reserved for the JSON plan, we suggest to 
deprecate the PLAN FOR syntax.
   ```
   
   Can we test if the explain details work instead?




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