AMashenkov commented on code in PR #5603:
URL: https://github.com/apache/ignite-3/pull/5603#discussion_r2041939923


##########
modules/sql-engine/src/main/codegen/includes/parserImpls.ftl:
##########
@@ -787,3 +787,39 @@ Boolean SqlKillNoWait():
         return noWait;
     }
 }
+
+/**
+ * Parses an EXPLAIN PLAN statement.
+ */
+SqlNode SqlIgniteExplain() :
+{
+    SqlNode stmt;
+    SqlExplainLevel detailLevel = SqlExplainLevel.EXPPLAN_ATTRIBUTES;
+    SqlExplain.Depth depth;
+    Span s;
+    final SqlExplainFormat format;
+}
+{
+    <EXPLAIN> { s = span(); } <PLAN>
+    [ detailLevel = ExplainDetailLevel() ]
+    depth = ExplainDepth()
+    (
+        LOOKAHEAD(2)
+        <AS> <XML> { format = SqlExplainFormat.XML; }
+    |
+        LOOKAHEAD(2)
+        <AS> <JSON> { format = SqlExplainFormat.JSON; }
+    |
+        <AS> <DOT_FORMAT> { format = SqlExplainFormat.DOT; }

Review Comment:
   Should we use LOOKAHEAD(2) here as well or it is enough to set it once for 
the very first option?



-- 
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: notifications-unsubscr...@ignite.apache.org

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

Reply via email to