You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/04/22 01:03:53 UTC
[GitHub] [iotdb] JackieTien97 commented on a diff in pull request #5616: Refactor attributes in PlanNode
JackieTien97 commented on code in PR #5616:
URL: https://github.com/apache/iotdb/pull/5616#discussion_r855691301
##########
server/src/main/java/org/apache/iotdb/db/mpp/sql/planner/plan/node/source/SeriesAggregateScanNode.java:
##########
@@ -67,28 +67,31 @@
* represent the whole aggregation result of this series. And the timestamp will be 0, which is
* meaningless.
*/
-public class SeriesAggregateScanNode extends SourceNode implements IOutputPlanNode {
+public class SeriesAggregateScanNode extends SourceNode {
// The series path and aggregation functions on this series.
// (Currently, we only support one series in the aggregation function)
private final PartialPath seriesPath;
- private final List<AggregationType> aggregateFuncList;
+ @Deprecated private final List<AggregationType> aggregateFuncList;
+ private Aggregation aggregation;
Review Comment:
It should also be a `List<Aggregation>`
##########
server/src/main/java/org/apache/iotdb/db/mpp/common/FilterNullParameter.java:
##########
@@ -0,0 +1,96 @@
+/*
+ * 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.mpp.common;
+
+import org.apache.iotdb.db.mpp.sql.planner.plan.InputLocation;
+import org.apache.iotdb.db.mpp.sql.statement.component.FilterNullPolicy;
+import org.apache.iotdb.tsfile.utils.ReadWriteIOUtils;
+
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+
+public class FilterNullParameter {
+
+ // The policy to discard the result from upstream npde
+ private final FilterNullPolicy filterNullPolicy;
+
+ // indicate columns used to filter null
+ private final List<InputLocation> filterNullColumns;
+
+ public FilterNullParameter(
+ FilterNullPolicy filterNullPolicy, List<InputLocation> filterNullColumns) {
+ this.filterNullPolicy = filterNullPolicy;
+ this.filterNullColumns = filterNullColumns;
+ }
+
+ public FilterNullPolicy getFilterNullPolicy() {
+ return filterNullPolicy;
+ }
+
+ public List<InputLocation> getFilterNullColumns() {
+ return filterNullColumns;
+ }
+
+ public void serialize(ByteBuffer byteBuffer) {
+ ReadWriteIOUtils.write(filterNullPolicy.ordinal(), byteBuffer);
+ if (filterNullColumns == null) {
+ ReadWriteIOUtils.write(-1, byteBuffer);
+ } else {
Review Comment:
When will the filterNullColumns be null?
##########
server/src/test/java/org/apache/iotdb/db/mpp/sql/plan/node/process/GroupByLevelNodeSerdeTest.java:
##########
@@ -106,7 +103,10 @@ public void TestSerializeAndDeserialize() throws IllegalPathException {
FilterNullNode filterNullNode =
new FilterNullNode(
- new PlanNodeId("TestFilterNullNode"), filterNode, FilterNullPolicy.ALL_NULL, null);
+ new PlanNodeId("TestFilterNullNode"),
+ filterNode,
+ FilterNullPolicy.ALL_NULL,
+ ImmutableList.of());
Review Comment:
same as above
##########
server/src/test/java/org/apache/iotdb/db/mpp/sql/plan/node/process/FilterNullNodeSerdeTest.java:
##########
@@ -104,7 +101,10 @@ public void TestSerializeAndDeserialize() throws IllegalPathException {
FilterNullNode filterNullNode =
new FilterNullNode(
- new PlanNodeId("TestFilterNullNode"), filterNode, FilterNullPolicy.ALL_NULL, null);
+ new PlanNodeId("TestFilterNullNode"),
+ filterNode,
+ FilterNullPolicy.ALL_NULL,
+ ImmutableList.of());
Review Comment:
Should not be `ImmutableList.of()`
##########
server/src/main/java/org/apache/iotdb/db/mpp/sql/planner/QueryPlanBuilder.java:
##########
@@ -270,10 +272,8 @@ public void planFilterNull(FilterNullComponent filterNullComponent) {
new FilterNullNode(
context.getQueryId().genPlanNodeId(),
this.getRoot(),
- filterNullComponent.getWithoutPolicyType(),
- filterNullComponent.getWithoutNullColumns().stream()
- .map(Expression::getExpressionString)
- .collect(Collectors.toList()));
+ new FilterNullParameter(
+ filterNullComponent.getWithoutPolicyType(), ImmutableList.of()));
Review Comment:
Why here using `ImmutableList.of()`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org