This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch QueryPerformace
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/QueryPerformace by this push:
     new b76b253b51 change last query
b76b253b51 is described below

commit b76b253b5179f7e7c71fc2d8e71907115c00a895
Author: JackieTien97 <[email protected]>
AuthorDate: Wed Jun 22 10:46:31 2022 +0800

    change last query
---
 .../execution/operator/process/UpdateLastCacheOperator.java    | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git 
a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/UpdateLastCacheOperator.java
 
b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/UpdateLastCacheOperator.java
index f2ec8c0cc8..0d42c50b51 100644
--- 
a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/UpdateLastCacheOperator.java
+++ 
b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/UpdateLastCacheOperator.java
@@ -56,7 +56,7 @@ public class UpdateLastCacheOperator implements 
ProcessOperator {
 
   private final boolean needUpdateCache;
 
-  private final TsBlockBuilder tsBlockBuilder;
+  private TsBlockBuilder tsBlockBuilder;
 
   public UpdateLastCacheOperator(
       OperatorContext operatorContext,
@@ -109,12 +109,16 @@ public class UpdateLastCacheOperator implements 
ProcessOperator {
       lastCache.updateLastCache(fullPath, timeValuePair, false, 
Long.MIN_VALUE);
     }
 
-    tsBlockBuilder.reset();
+    checkArgument(
+        tsBlockBuilder != null, "UpdateLastCacheOperator.next() should only be 
called once.");
 
     LastQueryUtil.appendLastValue(
         tsBlockBuilder, lastTime, fullPath.getFullPath(), 
lastValue.getStringValue(), dataType);
 
-    return tsBlockBuilder.build();
+    res = tsBlockBuilder.build();
+    tsBlockBuilder = null;
+
+    return res;
   }
 
   @Override

Reply via email to