You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ja...@apache.org on 2022/05/07 06:11:23 UTC

[iotdb] branch rel/0.13 updated: push down limit to rawdatasetwithValueFilter (#5814)

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

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


The following commit(s) were added to refs/heads/rel/0.13 by this push:
     new 9633491746 push down limit to rawdatasetwithValueFilter (#5814)
9633491746 is described below

commit 96334917465f1cd645460a5f0d21ce32436523d5
Author: Xiangwei Wei <34...@users.noreply.github.com>
AuthorDate: Sat May 7 14:11:19 2022 +0800

    push down limit to rawdatasetwithValueFilter (#5814)
---
 .../iotdb/db/query/dataset/RawQueryDataSetWithValueFilter.java      | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/query/dataset/RawQueryDataSetWithValueFilter.java b/server/src/main/java/org/apache/iotdb/db/query/dataset/RawQueryDataSetWithValueFilter.java
index 2f5ac52671..744bec341b 100644
--- a/server/src/main/java/org/apache/iotdb/db/query/dataset/RawQueryDataSetWithValueFilter.java
+++ b/server/src/main/java/org/apache/iotdb/db/query/dataset/RawQueryDataSetWithValueFilter.java
@@ -185,11 +185,11 @@ public class RawQueryDataSetWithValueFilter extends QueryDataSet implements IUDF
 
   private boolean cacheRowInObjects() throws IOException {
     int cachedTimeCnt = 0;
-    long[] cachedTimeArray = new long[fetchSize];
+    int timeArraySize = rowLimit > 0 ? Math.min(fetchSize, rowLimit + rowOffset) : fetchSize;
+    long[] cachedTimeArray = new long[timeArraySize];
 
-    // TODO: LIMIT constraint
     // 1. fill time array from time Generator
-    while (timeGenerator.hasNext() && cachedTimeCnt < fetchSize) {
+    while (timeGenerator.hasNext() && cachedTimeCnt < timeArraySize) {
       cachedTimeArray[cachedTimeCnt++] = timeGenerator.next();
     }
     if (cachedTimeCnt == 0) {