@Override
  public void beforeStart(UDFParameters parameters, UDTFConfigurations configurations)
      throws Exception {
    configurations.setAccessStrategy(new RowByRowAccessStrategy()).setOutputDataType(Type.DOUBLE);
    timestamp.clear();
    value.clear();
    this.windowSize = parameters.getIntOrDefault("window", 10);
    this.maxError = parameters.getDoubleOrDefault("error", 0.1);
    this.method = parameters.getStringOrDefault("method", METHOD_BOTTOM_UP);
    this.method = this.method.toLowerCase();
    this.output = parameters.getStringOrDefault("output", OUTPUT_FIRST);
    this.output = this.output.toLowerCase();
  }
This function segment input series into linear parts.
library-udf/src/main/java/org/apache/iotdb/library/dprofile/UDTFSegment.java