@Override
  public void beforeStart(UDFParameters parameters, UDTFConfigurations configurations)
      throws Exception {
    configurations
        .setAccessStrategy(new SlidingSizeWindowAccessStrategy(Integer.MAX_VALUE))
        .setOutputDataType(parameters.getDataType(0));

    intervalMethod = parameters.getStringOrDefault("method", "Median");
    String intervalString = parameters.getStringOrDefault("interval", null);

    if (intervalString != null) {
      try {
        interval = Long.parseLong(intervalString);
      } catch (NumberFormatException e) {
        interval = Util.parseTime(intervalString, parameters);
      }
    } else {
      interval = 0;
    }

    if (interval > 0) {
      intervalMode = interval;
    } else if ("Median".equalsIgnoreCase(intervalMethod)) {
      intervalMode = -1L;
    } else if ("Mode".equalsIgnoreCase(intervalMethod)) {
      intervalMode = -2L;
    } else if ("Cluster".equalsIgnoreCase(intervalMethod)) {
      intervalMode = -3L;
    } else {
      throw new UDFException("Illegal method.");
    }
  }
This function is used for timestamp repair.
library-udf/src/main/java/org/apache/iotdb/library/drepair/UDTFTimestampRepair.java