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

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


The following commit(s) were added to refs/heads/ty/TableModelGrammar by this 
push:
     new 224ad44425d support outputnode
224ad44425d is described below

commit 224ad44425d717737203d64847761906b93b1ee8
Author: JackieTien97 <[email protected]>
AuthorDate: Thu Apr 18 14:53:46 2024 +0800

    support outputnode
---
 .../plan/planner/TableOperatorGenerator.java       | 27 +++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/TableOperatorGenerator.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/TableOperatorGenerator.java
index d027ceb6498..c8825447e88 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/TableOperatorGenerator.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/TableOperatorGenerator.java
@@ -403,7 +403,32 @@ public class TableOperatorGenerator extends 
PlanVisitor<Operator, LocalExecution
 
   @Override
   public Operator visitOutput(OutputNode node, LocalExecutionPlanContext 
context) {
-    return super.visitOutput(node, context);
+    TypeProvider typeProvider = context.getTypeProvider();
+    Optional<Expression> predicate;
+    Operator inputOperator;
+    List<TSDataType> inputDataTypes;
+    Map<Symbol, List<InputLocation>> inputLocations;
+    if (node.getChild() instanceof FilterNode) {
+      FilterNode filterNode = (FilterNode) node.getChild();
+      predicate = Optional.of(filterNode.getPredicate());
+      inputOperator = filterNode.getChild().accept(this, context);
+      inputDataTypes = getInputColumnTypes(filterNode, typeProvider);
+      inputLocations = makeLayout(filterNode.getChildren());
+    } else {
+      predicate = Optional.empty();
+      inputOperator = node.getChild().accept(this, context);
+      inputDataTypes = getInputColumnTypes(node, typeProvider);
+      inputLocations = makeLayout(node.getChildren());
+    }
+
+    return constructFilterAndProjectOperator(
+        predicate,
+        inputOperator,
+        
node.getOutputSymbols().stream().map(Symbol::toSymbolReference).toArray(Expression[]::new),
+        inputDataTypes,
+        inputLocations,
+        node.getPlanNodeId(),
+        context);
   }
 
   @Override

Reply via email to