@Override
  public void beforeStart(UDFParameters parameters, UDTFConfigurations configurations)
      throws Exception {
    configurations.setAccessStrategy(new RowByRowAccessStrategy()).setOutputDataType(Type.INT32);
    long gap = Util.parseTime(parameters.getStringOrDefault("gap", "0ms"), parameters);
    consUtil = new ConsecutiveUtil(-gap, -gap, gap);
  }
This function searches for all longest consecutive subsequences of input sereis.
library-udf/src/main/java/org/apache/iotdb/library/series/UDTFConsecutiveSequences.java