qiaojialin commented on a change in pull request #812: [IOTDB-464] Vectorize 
the IReaderByTimestamp
URL: https://github.com/apache/incubator-iotdb/pull/812#discussion_r379807579
 
 

 ##########
 File path: 
server/src/main/java/org/apache/iotdb/db/query/reader/series/SeriesReaderByTimestamp.java
 ##########
 @@ -41,14 +42,23 @@ public SeriesReaderByTimestamp(Path seriesPath, TSDataType 
dataType, QueryContex
   }
 
   @Override
-  public Object getValueInTimestamp(long timestamp) throws IOException {
-    seriesReader.setTimeFilter(timestamp);
-    if ((batchData == null || batchData.getTimeByIndex(batchData.length() - 1) 
< timestamp)
-        && !hasNext(timestamp)) {
-      return null;
-    }
+  public Object[] getValuesInTimestamps(long[] timestamps) throws IOException {
+    Object[] result = new Object[timestamps.length];
 
-    return batchData.getValueInTimestamp(timestamp);
+    for (int i = 0; i < timestamps.length; i++) {
+      if (timestamps[i] < currentTime) {
+        throw new IOException("time must be increasing when use 
ReaderByTimestamp");
+      }
+      currentTime = timestamps[i];
+      seriesReader.setTimeFilter(currentTime);
 
 Review comment:
   try Time In Filter

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to