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 2021/11/14 15:33:32 UTC

[GitHub] [iotdb] qiaojialin commented on a change in pull request #4382: New architecture of aligned timeseries

qiaojialin commented on a change in pull request #4382:
URL: https://github.com/apache/iotdb/pull/4382#discussion_r748857312



##########
File path: server/src/main/java/org/apache/iotdb/db/metadata/path/MeasurementPath.java
##########
@@ -0,0 +1,291 @@
+/*
+ * 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.metadata.path;
+
+import org.apache.iotdb.db.conf.IoTDBConstant;
+import org.apache.iotdb.db.engine.memtable.IWritableMemChunk;
+import org.apache.iotdb.db.engine.modification.Modification;
+import org.apache.iotdb.db.engine.modification.ModificationFile;
+import org.apache.iotdb.db.engine.querycontext.QueryDataSource;
+import org.apache.iotdb.db.engine.querycontext.ReadOnlyMemChunk;
+import org.apache.iotdb.db.engine.storagegroup.TsFileResource;
+import org.apache.iotdb.db.exception.metadata.IllegalPathException;
+import org.apache.iotdb.db.exception.query.QueryProcessException;
+import org.apache.iotdb.db.query.context.QueryContext;
+import org.apache.iotdb.db.query.executor.fill.LastPointReader;
+import org.apache.iotdb.db.query.filter.TsFileFilter;
+import org.apache.iotdb.db.query.reader.series.SeriesReader;
+import org.apache.iotdb.db.utils.QueryUtils;
+import org.apache.iotdb.db.utils.TestOnly;
+import org.apache.iotdb.db.utils.datastructure.TVList;
+import org.apache.iotdb.tsfile.file.metadata.IChunkMetadata;
+import org.apache.iotdb.tsfile.file.metadata.TimeseriesMetadata;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.file.metadata.statistics.Statistics;
+import org.apache.iotdb.tsfile.read.common.TimeRange;
+import org.apache.iotdb.tsfile.read.filter.basic.Filter;
+import org.apache.iotdb.tsfile.write.schema.IMeasurementSchema;
+import org.apache.iotdb.tsfile.write.schema.UnaryMeasurementSchema;
+import org.apache.iotdb.tsfile.write.writer.RestorableTsFileIOWriter;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+public class MeasurementPath extends PartialPath {
+
+  private IMeasurementSchema measurementSchema;
+
+  private boolean isUnderAlignedEntity = false;
+
+  // alias of measurement, null pointer cannot be serialized in thrift so empty string is instead
+  private String measurementAlias = "";

Review comment:
       change the related field in thrift to optional and set the default meassurementAlias to null 

##########
File path: server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/GroupByLevelDataSet.java
##########
@@ -79,6 +79,10 @@ public GroupByLevelDataSet(GroupByTimePlan plan, GroupByEngineDataSet dataSet)
         }
       }
     }
+    // group by level's column number is different from other datasets
+    // TODO I don't know whether it's right or not in AlignedPath, remember to check here while
+    // adapting GroupByLevel query for new vector
+    super.columnNum = dataTypes.size();

Review comment:
       check

##########
File path: server/src/main/java/org/apache/iotdb/db/qp/physical/crud/InsertRowPlan.java
##########
@@ -340,11 +340,7 @@ public void serialize(DataOutputStream stream) throws IOException {
 
   public void subSerialize(DataOutputStream stream) throws IOException {
     stream.writeLong(time);
-    if (isAligned && originalPrefixPath != null) {
-      putString(stream, originalPrefixPath.getFullPath());
-    } else {
-      putString(stream, prefixPath.getFullPath());
-    }
+    putString(stream, prefixPath.getFullPath());

Review comment:
       ```suggestion
       putString(stream, devicePath.getFullPath());
   ```

##########
File path: cluster/src/main/java/org/apache/iotdb/cluster/utils/ClusterQueryUtils.java
##########
@@ -67,41 +53,30 @@ public static void checkPathExistence(PartialPath path) throws QueryProcessExcep
     }
   }
 
-  public static void checkPathExistence(List<PartialPath> paths) throws QueryProcessException {
-    for (PartialPath path : paths) {
-      checkPathExistence(path);
-    }
-  }
-
   /**
    * Generate path string list for RPC request.
    *
-   * <p>If vector path, return its vectorId with all subSensors. Else just return path string.
+   * <p>If vector path, return its vectorId with all subSensors. Else just return path string. TODO
+   * aligned path
    */
-  public static List<String> getPathStrListForRequest(Path path) {
-    if (path instanceof VectorPartialPath) {
-      List<String> pathWithSubSensors =
-          new ArrayList<>(((VectorPartialPath) path).getSubSensorsList().size() + 1);
-      pathWithSubSensors.add(path.getFullPath());
-      pathWithSubSensors.addAll(((VectorPartialPath) path).getSubSensorsList());
-      return pathWithSubSensors;
-    } else {
-      return Collections.singletonList(path.getFullPath());
-    }
+  public static String getPathStrListForRequest(Path path) {
+    // TODO aligned Path
+    return path.getFullPath();

Review comment:
       check

##########
File path: server/src/main/java/org/apache/iotdb/db/query/dataset/AlignByDeviceDataSet.java
##########
@@ -84,7 +79,10 @@
   public AlignByDeviceDataSet(
       AlignByDevicePlan alignByDevicePlan, QueryContext context, IQueryRouter queryRouter) {
     super(null, alignByDevicePlan.getDataTypes());
-
+    // align by device's column number is different from other datasets
+    // TODO I don't know whether it's right or not in AlignedPath, remember to check here while
+    // adapting AlignByDevice query for new vector
+    super.columnNum = alignByDevicePlan.getDataTypes().size();

Review comment:
       remember to check this

##########
File path: server/src/main/java/org/apache/iotdb/db/query/dataset/SingleDataSet.java
##########
@@ -33,6 +33,10 @@
 
   public SingleDataSet(List<PartialPath> paths, List<TSDataType> dataTypes) {
     super(new ArrayList<>(paths), dataTypes);
+    // SingleDataSet's column number is different from other datasets
+    // TODO I don't know whether it's right or not in AlignedPath, remember to check here while
+    // adapting SingleDataSet query for new vector
+    super.columnNum = dataTypes.size();

Review comment:
       check




-- 
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