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 <[email protected]> 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) {
