private void mergeRemainingIntervals(
        int remainingIndex, Intervals remainingIntervals, Intervals result) {
      for (int i = remainingIndex; i < remainingIntervals.getIntervalSize(); i++) {
        long lb = remainingIntervals.getLowerBound(i);
        long ub = remainingIntervals.getUpperBound(i);
        result.mergeLast(lb, ub);
      }
    }
The union is implemented by merge, so the two intervals must be ordered.

@param that
@return
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/TimeValuePairUtils.java