@Override
  public void validate(UDFParameterValidator validator) throws Exception {
    validator
        .validate(
            x -> (long) x > 0,
            "gap should be a time period whose unit is ms, s, m, h.",
            Util.parseTime(
                validator.getParameters().getStringOrDefault("gap", "1ms"),
                validator.getParameters()))
        .validate(
            x -> (long) x > 0,
            "length should be a time period whose unit is ms, s, m, h.",
            Util.parseTime(
                validator.getParameters().getString("length"), validator.getParameters()));
  }
This function searches for consecutive subsequences of given length of input sereis.
library-udf/src/main/java/org/apache/iotdb/library/series/UDTFConsecutiveWindows.java