@Override
  public void validate(UDFParameterValidator validator) throws Exception {
    validator
        .validateInputSeriesNumber(1)
        .validateInputSeriesDataType(0, Type.DOUBLE, Type.FLOAT, Type.INT32, Type.INT64);

    String intervalString = validator.getParameters().getStringOrDefault("interval", null);
    if (intervalString != null) {
      try {
        interval = Long.parseLong(intervalString);
      } catch (NumberFormatException e) {
        try {
          interval = Util.parseTime(intervalString, validator.getParameters());
        } catch (Exception ex) {
          throw new UDFException("Invalid time format for interval.");
        }
      }
      validator.validate(
          x -> interval > 0,
          "Invalid time unit input. Supported units are ns, us, ms, s, m, h, d.");
    }
  }
This function is used for timestamp repair.
library-udf/src/main/java/org/apache/iotdb/library/drepair/UDTFTimestampRepair.java