cqzhang7 commented on code in PR #11290:
URL: https://github.com/apache/iotdb/pull/11290#discussion_r1361830571


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/DateTimeUtils.java:
##########
@@ -733,6 +741,7 @@ public static TimeUnit toTimeUnit(String t) {
    * @return nextStartTime
    */
   public static long calcIntervalByMonth(long startTime, long numMonths) {
+    numMonths = numMonths / MS_TO_MONTH;

Review Comment:
   Because I changed function 
`org.apache.iotdb.db.queryengine.execution.aggregation.timerangeiterator.TimeRangeIteratorFactory#getTimeRangeIterator`
 , previous  code is  `interval = isIntervalByMonth ? interval / MS_TO_MONTH : 
interval;` while the interval is '1mo1d' to long now  ,then the input 
**numMonths** in **calcIntervalByMonth** is the long value 
**fixedSlidingStepInMonth** in new logic



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/aggregation/timerangeiterator/AggrWindowIterator.java:
##########
@@ -36,6 +34,10 @@ public class AggrWindowIterator implements 
ITimeRangeIterator {
   private final long endTime;
   private final long interval;
   private final long slidingStep;
+  private final long fixedIntervalInMonth;
+  private final long fixedSlidingStepInMonth;

Review Comment:
   **fixedIntervalInMonth** is generated to distinguish natural months from 
other fixed times. eg. while input interval string is '1mo1d' , 
**fixedIntervalInMonth**  is '1mo' to long  value '30 * 86_400_000L'  and 
**fixedIntervalOther** is '1d' to long  value '86_400_000L'  while  **the 
previous interval** is '31 * 86_400_000L'  now.     So I can identify which 
part of **the previous interval**   (31* 86_400_000L) belongs to the input  
month str '1mo'  and the other parts belong to fixedIntervalOther.  
fixedSlidingStepInMonth is similar



-- 
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