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

[iotdb] branch pushdownlimit created (now 349c8ce4a7)

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

xiangweiwei pushed a change to branch pushdownlimit
in repository https://gitbox.apache.org/repos/asf/iotdb.git


      at 349c8ce4a7 push down limit to rawdatasetwithValueFilter

This branch includes the following new commits:

     new 349c8ce4a7 push down limit to rawdatasetwithValueFilter

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[iotdb] 01/01: push down limit to rawdatasetwithValueFilter

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 349c8ce4a7dbe2c8d2de22432dba7d4ea5e116a2
Author: Alima777 <wx...@gmail.com>
AuthorDate: Fri May 6 10:20:23 2022 +0800

    push down limit to rawdatasetwithValueFilter
---
 .../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 63bf52feb3..f0cb49fdc6 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) {