@SuppressWarnings("squid:S107")
  public static ITimeRangeIterator getTimeRangeIterator(
      long startTime,
      long endTime,
      TimeDuration interval,
      TimeDuration slidingStep,
      boolean isAscending,
      boolean leftCRightO,
      boolean outputPartialTimeWindow,
      ZoneId zoneId) {
    if (outputPartialTimeWindow
        && interval.getTotalDuration(TimestampPrecisionUtils.currPrecision)
            > slidingStep.getTotalDuration(TimestampPrecisionUtils.currPrecision)) {
      if (!interval.containsMonth() && !slidingStep.containsMonth()) {
        return new PreAggrWindowIterator(
            startTime,
            endTime,
            interval.nonMonthDuration,
            slidingStep.nonMonthDuration,
            isAscending,
            leftCRightO);
      } else {
        return new PreAggrWindowWithNaturalMonthIterator(
            startTime, endTime, interval, slidingStep, isAscending, leftCRightO, zoneId);
      }
    } else {
      return new AggrWindowIterator(
          startTime, endTime, interval, slidingStep, isAscending, leftCRightO, zoneId);
    }
  }
The method returns different implements of ITimeRangeIterator depending on the parameters.

<p>Note: interval and slidingStep is always stand for the milliseconds in this method.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/aggregation/timerangeiterator/TimeRangeIteratorFactory.java