JackieTien97 commented on a change in pull request #821: [IOTDB-298]Last 
time-value query
URL: https://github.com/apache/incubator-iotdb/pull/821#discussion_r380540195
 
 

 ##########
 File path: 
server/src/main/java/org/apache/iotdb/db/qp/physical/crud/BatchInsertPlan.java
 ##########
 @@ -288,6 +292,23 @@ public long getMaxTime() {
     return maxTime;
   }
 
+  public void updateMNodeLastValues(MNode node) {
+    long maxTime = Long.MIN_VALUE;
+    int maxIndex = 0;
+    for (int i = 0; i < times.length; i++) {
+      if (times[i] > maxTime) {
+        maxTime = times[i];
+        maxIndex = i;
+      }
+    }
+    for (int i = 0; i < measurements.length; i++) {
+      if (node.hasChild(measurements[i])) {
+        Object[] column = (Object[]) columns[i];
+        node.getChild(measurements[i]).updateCachedLast(maxTime, 
column[maxIndex], dataTypes[i]);
+      }
+    }
+  }
+
 
 Review comment:
   This function is not the InsertPlan's responsibility

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