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/03/14 05:53:43 UTC
[iotdb] 11/11: add RowBasedSeriesAggregateNode
This is an automated email from the ASF dual-hosted git repository.
xingtanzjr pushed a commit to branch xingtanzjr/mpp-query-basis
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit b06892c1b901cbbf2a3859f13961463ef42c41b1
Author: Jinrui.Zhang <xi...@gmail.com>
AuthorDate: Thu Mar 10 22:39:27 2022 +0800
add RowBasedSeriesAggregateNode
---
.../plan/process/RowBasedSeriesAggregateNode.java | 37 ++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/query/distribution/plan/process/RowBasedSeriesAggregateNode.java b/cluster/src/main/java/org/apache/iotdb/cluster/query/distribution/plan/process/RowBasedSeriesAggregateNode.java
new file mode 100644
index 0000000..5ed718e
--- /dev/null
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/query/distribution/plan/process/RowBasedSeriesAggregateNode.java
@@ -0,0 +1,37 @@
+package org.apache.iotdb.cluster.query.distribution.plan.process;
+
+import org.apache.iotdb.cluster.query.distribution.common.GroupByTimeParameter;
+import org.apache.iotdb.cluster.query.distribution.plan.PlanNodeId;
+import org.apache.iotdb.db.query.expression.unary.FunctionExpression;
+
+import java.util.List;
+
+/**
+ * This node is used to aggregate required series by raw data.
+ * The raw data will be input as a TsBlock. This node will output the series aggregated result represented by TsBlock
+ * Thus, the columns in output TsBlock will be different from input TsBlock.
+ */
+public class RowBasedSeriesAggregateNode extends ProcessNode {
+ // The parameter of `group by time`
+ // Its value will be null if there is no `group by time` clause,
+ private GroupByTimeParameter groupByTimeParameter;
+
+ // The list of aggregation functions, each FunctionExpression will be output as one column of result TsBlock
+ // (Currently we only support one series in the aggregation function)
+ // TODO: need consider whether it is suitable the aggregation function using FunctionExpression
+ private List<FunctionExpression> aggregateFuncList;
+
+ public RowBasedSeriesAggregateNode(PlanNodeId id) {
+ super(id);
+ }
+
+ public RowBasedSeriesAggregateNode(PlanNodeId id, List<FunctionExpression> aggregateFuncList) {
+ this(id);
+ this.aggregateFuncList = aggregateFuncList;
+ }
+
+ public RowBasedSeriesAggregateNode(PlanNodeId id, List<FunctionExpression> aggregateFuncList, GroupByTimeParameter groupByTimeParameter) {
+ this(id, aggregateFuncList);
+ this.groupByTimeParameter = groupByTimeParameter;
+ }
+}