You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by xi...@apache.org on 2022/11/25 02:28:14 UTC

[iotdb] branch xingtanzjr/fix_explain created (now 8ff20610a8)

This is an automated email from the ASF dual-hosted git repository.

xingtanzjr pushed a change to branch xingtanzjr/fix_explain
in repository https://gitbox.apache.org/repos/asf/iotdb.git


      at 8ff20610a8 fix the issue that client get 305 when explain non-existing series

This branch includes the following new commits:

     new 8ff20610a8 fix the issue that client get 305 when explain non-existing series

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[iotdb] 01/01: fix the issue that client get 305 when explain non-existing series

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xingtanzjr pushed a commit to branch xingtanzjr/fix_explain
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 8ff20610a8bb94c08066929a93b546f61c97f4f8
Author: Jinrui.Zhang <xi...@gmail.com>
AuthorDate: Fri Nov 25 10:28:00 2022 +0800

    fix the issue that client get 305 when explain non-existing series
---
 .../execution/memory/StatementMemorySourceVisitor.java    | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/execution/memory/StatementMemorySourceVisitor.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/execution/memory/StatementMemorySourceVisitor.java
index 7883417160..81a07bad51 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/execution/memory/StatementMemorySourceVisitor.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/execution/memory/StatementMemorySourceVisitor.java
@@ -72,6 +72,15 @@ public class StatementMemorySourceVisitor
   public StatementMemorySource visitExplain(
       ExplainStatement node, StatementMemorySourceContext context) {
     context.getAnalysis().setStatement(node.getQueryStatement());
+    DatasetHeader header =
+        new DatasetHeader(
+            Collections.singletonList(
+                new ColumnHeader(IoTDBConstant.COLUMN_DISTRIBUTION_PLAN, TSDataType.TEXT)),
+            true);
+    if (context.getAnalysis().getSourceExpressions() == null
+        || context.getAnalysis().getSourceExpressions().isEmpty()) {
+      return new StatementMemorySource(new TsBlock(0), header);
+    }
     LogicalQueryPlan logicalPlan =
         new LogicalPlanner(context.getQueryContext(), new ArrayList<>())
             .plan(context.getAnalysis());
@@ -88,11 +97,7 @@ public class StatementMemorySourceVisitor
           builder.declarePosition();
         });
     TsBlock tsBlock = builder.build();
-    DatasetHeader header =
-        new DatasetHeader(
-            Collections.singletonList(
-                new ColumnHeader(IoTDBConstant.COLUMN_DISTRIBUTION_PLAN, TSDataType.TEXT)),
-            true);
+
     return new StatementMemorySource(tsBlock, header);
   }