private TimeRange getLeftmostTimeRange() {
    long retEndTime;
    if (interval.containsMonth()) {
      // calculate interval length by natural month based on startTime
      // ie. startTIme = 1/31, interval = 1mo, curEndTime will be set to 2/29
      retEndTime =
          Math.min(DateTimeUtils.calcPositiveIntervalByMonth(startTime, interval, zoneId), endTime);
    } else {
      retEndTime = Math.min(startTime + interval.nonMonthDuration, endTime);
    }
    return new TimeRange(startTime, retEndTime);
  }
This class iteratively generates aggregated time windows.

<p>For example, startTime = 0, endTime = 10, interval = 5, slidingStep = 3, leftCloseRightOpen,
return [0,5],[3,7],[6,9],[9,9]
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/aggregation/timerangeiterator/AggrWindowIterator.java