@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()));
  }
This function searches for all longest consecutive subsequences of input sereis.
library-udf/src/main/java/org/apache/iotdb/library/series/UDTFConsecutiveSequences.java