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

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


The following commit(s) were added to refs/heads/master by this push:
     new e28a27c1eda [IOTDB-6195] Fix bug in group by month while using left 
open and right close syntax
e28a27c1eda is described below

commit e28a27c1edae80aab98220b316ad47e2a0cfe5dd
Author: Weihao Li <[email protected]>
AuthorDate: Thu Oct 19 10:42:56 2023 +0800

    [IOTDB-6195] Fix bug in group by month while using left open and right 
close syntax
---
 .../db/it/groupby/IoTDBGroupByNaturalMonthIT.java    |  2 --
 .../db/queryengine/plan/analyze/AnalyzeVisitor.java  | 20 ++++++++++----------
 2 files changed, 10 insertions(+), 12 deletions(-)

diff --git 
a/integration-test/src/test/java/org/apache/iotdb/db/it/groupby/IoTDBGroupByNaturalMonthIT.java
 
b/integration-test/src/test/java/org/apache/iotdb/db/it/groupby/IoTDBGroupByNaturalMonthIT.java
index 0cd6bfab56f..ef0e8b214a7 100644
--- 
a/integration-test/src/test/java/org/apache/iotdb/db/it/groupby/IoTDBGroupByNaturalMonthIT.java
+++ 
b/integration-test/src/test/java/org/apache/iotdb/db/it/groupby/IoTDBGroupByNaturalMonthIT.java
@@ -266,8 +266,6 @@ public class IoTDBGroupByNaturalMonthIT {
         df);
   }
 
-  @Ignore
-  // TODO After potential bug fixed
   @Test
   public void groupByNaturalYearTest2() {
     String[] expectedHeader = new String[] {TIMESTAMP_STR, 
count("root.test.d1.s1")};
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/AnalyzeVisitor.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/AnalyzeVisitor.java
index e5832fb0213..7e6aead2b63 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/AnalyzeVisitor.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/AnalyzeVisitor.java
@@ -3084,24 +3084,24 @@ public class AnalyzeVisitor extends 
StatementVisitor<Analysis, MPPQueryContext>
   }
 
   private GroupByFilter initGroupByFilter(GroupByTimeComponent 
groupByTimeComponent) {
+    long startTime =
+        groupByTimeComponent.isLeftCRightO()
+            ? groupByTimeComponent.getStartTime()
+            : groupByTimeComponent.getStartTime() + 1;
+    long endTime =
+        groupByTimeComponent.isLeftCRightO()
+            ? groupByTimeComponent.getEndTime()
+            : groupByTimeComponent.getEndTime() + 1;
     if (groupByTimeComponent.isIntervalByMonth() || 
groupByTimeComponent.isSlidingStepByMonth()) {
       return new GroupByMonthFilter(
           groupByTimeComponent.getInterval(),
           groupByTimeComponent.getSlidingStep(),
-          groupByTimeComponent.getStartTime(),
-          groupByTimeComponent.getEndTime(),
+          startTime,
+          endTime,
           groupByTimeComponent.isSlidingStepByMonth(),
           groupByTimeComponent.isIntervalByMonth(),
           TimeZone.getTimeZone("+00:00"));
     } else {
-      long startTime =
-          groupByTimeComponent.isLeftCRightO()
-              ? groupByTimeComponent.getStartTime()
-              : groupByTimeComponent.getStartTime() + 1;
-      long endTime =
-          groupByTimeComponent.isLeftCRightO()
-              ? groupByTimeComponent.getEndTime()
-              : groupByTimeComponent.getEndTime() + 1;
       return new GroupByFilter(
           groupByTimeComponent.getInterval(),
           groupByTimeComponent.getSlidingStep(),

Reply via email to