You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/07/26 09:37:23 UTC

[GitHub] [doris] morrySnow opened a new pull request, #11210: [enhancement](Nereids)enable explain query for nereids planner

morrySnow opened a new pull request, #11210:
URL: https://github.com/apache/doris/pull/11210

   ## Problem Summary:
   
   Support explain syntax. And generate explain tree string by nereids' planner.
   
   ## Checklist(Required)
   
   1. Does it affect the original behavior: No
   2. Has unit tests been added: Yes
   3. Has document been added or modified: No Need
   4. Does it need to update dependencies: No
   5. Are there any changes that cannot be rolled back: No
   


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] 924060929 merged pull request #11210: [enhancement](Nereids)enable explain query for nereids planner

Posted by GitBox <gi...@apache.org>.
924060929 merged PR #11210:
URL: https://github.com/apache/doris/pull/11210


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] commented on pull request #11210: [enhancement](Nereids)enable explain query for nereids planner

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #11210:
URL: https://github.com/apache/doris/pull/11210#issuecomment-1197633869

   PR approved by at least one committer and no changes requested.


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] morrySnow commented on pull request #11210: [enhancement](Nereids)enable explain query for nereids planner

Posted by GitBox <gi...@apache.org>.
morrySnow commented on PR #11210:
URL: https://github.com/apache/doris/pull/11210#issuecomment-1195252286

   @924060929 PTAL


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] wangshuo128 commented on a diff in pull request #11210: [enhancement](Nereids)enable explain query for nereids planner

Posted by GitBox <gi...@apache.org>.
wangshuo128 commented on code in PR #11210:
URL: https://github.com/apache/doris/pull/11210#discussion_r930703991


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/parser/NereidsParser.java:
##########
@@ -46,14 +49,25 @@ public class NereidsParser {
      * a single packet.
      * https://dev.mysql.com/doc/internals/en/com-set-option.html
      */
-    public List<StatementBase> parseSQL(String originStr) throws Exception {
-        List<LogicalPlan> logicalPlanList = parseMultiple(originStr);
-        List<StatementBase> statementBaseList = new ArrayList<>();
-        for (LogicalPlan logicalPlan : logicalPlanList) {
+    public List<StatementBase> parseSQL(String originStr) {
+        List<LogicalPlan> logicalPlans = parseMultiple(originStr);
+        List<StatementBase> statementBases = new ArrayList<>();
+        for (LogicalPlan logicalPlan : logicalPlans) {
+            // TODO: this is a trick to support explain. Since we do not support any other command in a short time.
+            //     It is acceptable. In the future, we need to refactor this.
+            ExplainOptions explainOptions = null;
+            if (logicalPlan instanceof ExplainCommand) {

Review Comment:
   I think it's clear like this:
   ```java
               if (logicalPlan instanceof ExplainCommand) {
                   ExplainCommand explainCommand = (ExplainCommand) logicalPlan;
                   LogicalPlan innerPlan = explainCommand.getLogicalPlan();
                   LogicalPlanAdapter logicalPlanAdapter = new LogicalPlanAdapter(innerPlan);
                   logicalPlanAdapter.setIsExplain(new ExplainOptions(
                           explainCommand.getLevel() == ExplainLevel.VERBOSE,
                           explainCommand.getLevel() == ExplainLevel.GRAPH));
                   statementBases.add(logicalPlanAdapter);
               } else {
                   statementBases.add(new LogicalPlanAdapter(logicalPlan));
               }
   ```



-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] commented on pull request #11210: [enhancement](Nereids)enable explain query for nereids planner

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #11210:
URL: https://github.com/apache/doris/pull/11210#issuecomment-1197621767

   PR approved by anyone and no changes requested.


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org