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

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


The following commit(s) were added to refs/heads/master by this push:
     new dcb6d8e3caa Fix explain error when align by device + template
dcb6d8e3caa is described below

commit dcb6d8e3caa82bd803a60bfe110b770ad727b55a
Author: Beyyes <[email protected]>
AuthorDate: Fri Nov 24 15:02:17 2023 +0800

    Fix explain error when align by device + template
---
 .../plan/execution/memory/StatementMemorySourceVisitor.java           | 3 ++-
 .../iotdb/db/queryengine/plan/analyze/FakeSchemaFetcherImpl.java      | 4 +---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/memory/StatementMemorySourceVisitor.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/memory/StatementMemorySourceVisitor.java
index 964d85963fe..4b590b04bf4 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/memory/StatementMemorySourceVisitor.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/memory/StatementMemorySourceVisitor.java
@@ -71,7 +71,8 @@ public class StatementMemorySourceVisitor
     return (context.getAnalysis().getSourceExpressions() == null
             || context.getAnalysis().getSourceExpressions().isEmpty())
         && (context.getAnalysis().getDeviceToSourceExpressions() == null
-            || context.getAnalysis().getDeviceToSourceExpressions().isEmpty());
+            || context.getAnalysis().getDeviceToSourceExpressions().isEmpty())
+        && context.getAnalysis().getDeviceTemplate() == null;
   }
 
   @Override
diff --git 
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/analyze/FakeSchemaFetcherImpl.java
 
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/analyze/FakeSchemaFetcherImpl.java
index 88380621630..15e09d93df4 100644
--- 
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/analyze/FakeSchemaFetcherImpl.java
+++ 
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/analyze/FakeSchemaFetcherImpl.java
@@ -44,11 +44,9 @@ import java.util.Map;
 public class FakeSchemaFetcherImpl implements ISchemaFetcher {
 
   private final ClusterSchemaTree schemaTree = new 
ClusterSchemaTree(generateSchemaTree());
-  private MPPQueryContext context;
 
   @Override
   public ClusterSchemaTree fetchSchema(PathPatternTree patternTree, 
MPPQueryContext context) {
-    this.context = context;
     schemaTree.setDatabases(Collections.singleton("root.sg"));
     return schemaTree;
   }
@@ -77,7 +75,7 @@ public class FakeSchemaFetcherImpl implements ISchemaFetcher {
    * Generate the following tree: root.sg.d1.s1, root.sg.d1.s2(status) 
root.sg.d2.s1,
    * root.sg.d2.s2(status) root.sg.d2.a.s1, root.sg.d2.a.s2(status)
    *
-   * @return the root node of the generated schemTree
+   * @return the root node of the generated schemaTree
    */
   private SchemaNode generateSchemaTree() {
     SchemaNode root = new SchemaInternalNode("root");

Reply via email to