@Override
  public void transform(Row row, PointCollector collector) throws Exception {
    if (compute.equalsIgnoreCase(STREAM_COMPUTE) && sd > 0) {
      collector.putDouble(row.getTime(), (Util.getValueAsDouble(row) - avg) / sd);
    } else if (compute.equalsIgnoreCase(BATCH_COMPUTE)) {
      double v = Util.getValueAsDouble(row);
      if (Double.isFinite(v)) {
        value.add(v);
        timestamp.add(row.getTime());
        sum += v;
        squareSum += v * v;
      }
    }
  }
This function is used to standardize the input series with z-score. Stream swap require user to
provide average and stddev, while global swap does not.
library-udf/src/main/java/org/apache/iotdb/library/dprofile/UDTFZScore.java