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 2020/05/09 11:26:39 UTC
[incubator-iotdb] 01/01: group by bug
This is an automated email from the ASF dual-hosted git repository.
jackietien pushed a commit to branch TyGroupByNewBug
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
commit 3a784bffe4ff4d8260a430c07f5951316ba39856
Author: JackieTien97 <Ja...@foxmail.com>
AuthorDate: Sat May 9 19:26:14 2020 +0800
group by bug
---
.../apache/iotdb/db/query/dataset/groupby/LocalGroupByExecutor.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/LocalGroupByExecutor.java b/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/LocalGroupByExecutor.java
index b69f90f..007843c 100644
--- a/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/LocalGroupByExecutor.java
+++ b/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/LocalGroupByExecutor.java
@@ -98,7 +98,7 @@ public class LocalGroupByExecutor implements GroupByExecutor {
// lazy reset batch data for calculation
batchData.resetBatchData();
// skip points that cannot be calculated
- while (batchData.currentTime() < curStartTime && batchData.hasCurrent()) {
+ while (batchData.hasCurrent() && batchData.currentTime() < curStartTime) {
batchData.next();
}
if (batchData.hasCurrent()) {
@@ -222,7 +222,9 @@ public class LocalGroupByExecutor implements GroupByExecutor {
}
calcFromBatch(batchData, curStartTime, curEndTime);
- if (isEndCalc() || batchData.currentTime() >= curEndTime) {
+
+ // judge whether the calculation finished
+ if (isEndCalc() || (batchData.hasCurrent() && batchData.currentTime() >= curEndTime)) {
return true;
}
}