You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by hu...@apache.org on 2022/05/26 09:40:55 UTC

[iotdb] 03/04: plan LastPointFetchStatement

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

hui pushed a commit to branch lmh/LastPointFetch
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 95bacef712e70f45e7935d25eb8c33bed11ef161
Author: Minghui Liu <li...@foxmail.com>
AuthorDate: Thu May 26 17:34:45 2022 +0800

    plan LastPointFetchStatement
---
 .../org/apache/iotdb/db/mpp/plan/planner/LogicalPlanner.java     | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/LogicalPlanner.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/LogicalPlanner.java
index 0e6da8c705..5423d543bf 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/LogicalPlanner.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/LogicalPlanner.java
@@ -45,6 +45,7 @@ import org.apache.iotdb.db.mpp.plan.statement.crud.InsertRowStatement;
 import org.apache.iotdb.db.mpp.plan.statement.crud.InsertRowsOfOneDeviceStatement;
 import org.apache.iotdb.db.mpp.plan.statement.crud.InsertRowsStatement;
 import org.apache.iotdb.db.mpp.plan.statement.crud.InsertTabletStatement;
+import org.apache.iotdb.db.mpp.plan.statement.crud.LastPointFetchStatement;
 import org.apache.iotdb.db.mpp.plan.statement.crud.QueryStatement;
 import org.apache.iotdb.db.mpp.plan.statement.metadata.AlterTimeSeriesStatement;
 import org.apache.iotdb.db.mpp.plan.statement.metadata.CountDevicesStatement;
@@ -277,6 +278,14 @@ public class LogicalPlanner {
       return planBuilder.getRoot();
     }
 
+    public PlanNode visitLastPointFetch(
+        LastPointFetchStatement lastPointFetchStatement, MPPQueryContext context) {
+      LogicalPlanBuilder planBuilder = new LogicalPlanBuilder(context);
+      return planBuilder
+          .planLast(analysis.getSourceExpressions(), analysis.getGlobalTimeFilter())
+          .getRoot();
+    }
+
     @Override
     public PlanNode visitCreateTimeseries(
         CreateTimeSeriesStatement createTimeSeriesStatement, MPPQueryContext context) {