lancelly commented on code in PR #11429:
URL: https://github.com/apache/iotdb/pull/11429#discussion_r1378526056


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/aggregation/timerangeiterator/AggrWindowIterator.java:
##########
@@ -92,24 +87,31 @@ private TimeRange getRightmostTimeRange() {
     long queryRange = endTime - startTime;
     long intervalNum;
 
-    if (isSlidingStepByMonth) {
-      intervalNum = (long) Math.ceil(queryRange / (double) (slidingStep * 
MS_TO_MONTH));
-      retStartTime = DateTimeUtils.calcIntervalByMonth(startTime, intervalNum 
* slidingStep);
+    if (slidingStep.containsMonth()) {
+      intervalNum =
+          (long)
+              Math.ceil(
+                  queryRange
+                      / (double)
+                          
(slidingStep.getMaxTotalDuration(TimestampPrecisionUtils.currPrecision)));

Review Comment:
   I am not very familiar with this part of the code, so I wonder why use 
getMaxTotalDuration here? Will there be a problem if 1 month has less than 31 
days?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to