@Override
  public void transform(Row row, PointCollector collector) throws Exception {
    if (row.isNull(0) || row.isNull(1)) { // skip null rows
      return;
    }
    double x = Util.getValueAsDouble(row, 0);
    double y = Util.getValueAsDouble(row, 1);
    if (Double.isFinite(x) && Double.isFinite(y)) { // skip NaN rows
      count++;
      sumX += x;
      sumY += y;
      sumXY += x * y;
    }
  }
This function calculates Covariance between two input series.
library-udf/src/main/java/org/apache/iotdb/library/dmatch/UDAFCov.java