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/16 02:24:26 UTC

[GitHub] [iotdb] qiaojialin commented on a change in pull request #4390: [IOTDB-1926]TsFile API supports query on aligned timeseries

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



##########
File path: example/tsfile/src/main/java/org/apache/iotdb/tsfile/TsFileRead.java
##########
@@ -40,55 +41,55 @@
  */
 public class TsFileRead {
 
-  private static final String DEVICE1 = "device_1";
+  private static final String DEVICE1 = "root.sg.d1";
 
   private static void queryAndPrint(
-      ArrayList<Path> paths, ReadOnlyTsFile readTsFile, IExpression statement) throws IOException {
+      ArrayList<Path> paths, TsFileReader readTsFile, IExpression statement) throws IOException {
     QueryExpression queryExpression = QueryExpression.create(paths, statement);
     QueryDataSet queryDataSet = readTsFile.query(queryExpression);
     while (queryDataSet.hasNext()) {
       System.out.println(queryDataSet.next());
     }
-    System.out.println("------------");
+    System.out.println("----------------");
   }
 
   public static void main(String[] args) throws IOException {
 
-    // file path
-    String path = "test.tsfile";
+    // file path, the number of levels of the directory must be greater than 3

Review comment:
       what's this for?

##########
File path: example/tsfile/src/main/java/org/apache/iotdb/tsfile/TsFileWriteAlignedWithTSRecord.java
##########
@@ -56,7 +56,7 @@ public static void main(String[] args) throws IOException {
       writeMeasurementScheams.add(measurementSchemas.get(0));
       writeMeasurementScheams.add(measurementSchemas.get(1));
       writeMeasurementScheams.add(measurementSchemas.get(2));
-      writeAligned(tsFileWriter, "root.sg.d1", writeMeasurementScheams, 1000000, 0, 0);
+      writeAligned(tsFileWriter, "root.sg.d1", writeMeasurementScheams, 100000, 0, 0);

Review comment:
       why change this?

##########
File path: tsfile/src/main/java/org/apache/iotdb/tsfile/read/TsFileSequenceReader.java
##########
@@ -327,7 +329,7 @@ public BloomFilter readBloomFilter() throws IOException {
     return deviceMetadata;
   }
 
-  public TimeseriesMetadata readTimeseriesMetadata(Path path, boolean ignoreNotExists)
+  public ITimeSeriesMetadata readTimeseriesMetadata(Path path, boolean ignoreNotExists)

Review comment:
       this method is used by the server, where we know whether the timeseries are aligned or not. So no need to change this method you could write a new method (readITimeseriesMetadata) for TsFile API. 

##########
File path: tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/AlignedTimeSeriesMetadata.java
##########
@@ -112,6 +112,9 @@ public void setSeq(boolean seq) {
       // only at least one sensor exits, we add the AlignedChunkMetadata to the list
       boolean exits = false;
       for (List<IChunkMetadata> chunkMetadata : valueChunkMetadataList) {
+        if (i >= chunkMetadata.size()) { // there may be fewer value chunks than time chunks

Review comment:
       no need 




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