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

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


The following commit(s) were added to refs/heads/agg_table_scan by this push:
     new d27be355be4 tmp
d27be355be4 is described below

commit d27be355be4fa005034afb111e56fdc95d4bc900
Author: Beyyes <[email protected]>
AuthorDate: Fri Sep 27 16:23:23 2024 +0800

    tmp
---
 .../TableAggregationTableScanOperator.java         | 79 ++++++++++++++++++++++
 .../plan/planner/TableOperatorGenerator.java       |  8 +++
 2 files changed, 87 insertions(+)

diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/TableAggregationTableScanOperator.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/TableAggregationTableScanOperator.java
new file mode 100644
index 00000000000..8d548e5e79e
--- /dev/null
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/TableAggregationTableScanOperator.java
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.db.queryengine.execution.operator.source.relational;
+
+import org.apache.iotdb.db.queryengine.execution.aggregation.Aggregator;
+import org.apache.iotdb.db.queryengine.execution.operator.OperatorContext;
+import org.apache.iotdb.db.queryengine.plan.planner.plan.node.PlanNodeId;
+import 
org.apache.iotdb.db.queryengine.plan.planner.plan.parameter.SeriesScanOptions;
+import org.apache.iotdb.db.queryengine.plan.relational.metadata.ColumnSchema;
+import org.apache.iotdb.db.queryengine.plan.relational.metadata.DeviceEntry;
+import org.apache.iotdb.db.queryengine.plan.statement.component.Ordering;
+
+import org.apache.tsfile.write.schema.IMeasurementSchema;
+
+import java.util.List;
+
+public class TableAggregationTableScanOperator extends TableScanOperator {
+
+  List<Aggregator> aggregators;
+
+  public TableAggregationTableScanOperator(
+      OperatorContext context,
+      PlanNodeId sourceId,
+      List<ColumnSchema> columnSchemas,
+      int[] columnsIndexArray,
+      int measurementColumnCount,
+      List<DeviceEntry> deviceEntries,
+      Ordering scanOrder,
+      SeriesScanOptions seriesScanOptions,
+      List<String> measurementColumnNames,
+      List<IMeasurementSchema> measurementSchemas,
+      int maxTsBlockLineNum) {
+    super(
+        context,
+        sourceId,
+        columnSchemas,
+        columnsIndexArray,
+        measurementColumnCount,
+        deviceEntries,
+        scanOrder,
+        seriesScanOptions,
+        measurementColumnNames,
+        measurementSchemas,
+        maxTsBlockLineNum);
+  }
+
+  @Override
+  public boolean hasNext() throws Exception {
+    return !isFinished();
+  }
+
+  @Override
+  public boolean isFinished() throws Exception {
+    return (retainedTsBlock == null);
+    // && (currentDeviceIndex >= deviceCount || 
seriesScanOptions.limitConsumedUp());
+  }
+
+  @Override
+  public long ramBytesUsed() {
+    return 0;
+  }
+}
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 754cde57912..6d9667235d7 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
@@ -50,6 +50,7 @@ import 
org.apache.iotdb.db.queryengine.execution.operator.sink.IdentitySinkOpera
 import 
org.apache.iotdb.db.queryengine.execution.operator.source.AlignedSeriesScanOperator;
 import 
org.apache.iotdb.db.queryengine.execution.operator.source.ExchangeOperator;
 import 
org.apache.iotdb.db.queryengine.execution.operator.source.relational.InnerJoinOperator;
+import 
org.apache.iotdb.db.queryengine.execution.operator.source.relational.TableAggregationTableScanOperator;
 import 
org.apache.iotdb.db.queryengine.execution.operator.source.relational.TableScanOperator;
 import 
org.apache.iotdb.db.queryengine.execution.relational.ColumnTransformerBuilder;
 import org.apache.iotdb.db.queryengine.plan.analyze.TypeProvider;
@@ -902,6 +903,13 @@ public class TableOperatorGenerator extends 
PlanVisitor<Operator, LocalExecution
   @Override
   public Operator visitAggregationTableScan(
       AggregationTableScanNode node, LocalExecutionPlanContext context) {
+    final OperatorContext operatorContext =
+        context
+            .getDriverContext()
+            .addOperatorContext(
+                context.getNextOperatorId(),
+                node.getPlanNodeId(),
+                TableAggregationTableScanOperator.class.getSimpleName());
     throw new UnsupportedOperationException("Agg-BE not supported");
   }
 }

Reply via email to