@Override
  public void transform(Row row, PointCollector collector) throws Exception {
    if (exact) {
      statistics.insert(row);
    } else {
      sketch.insert(Util.getValueAsDouble(row));
    }
  }
calculate the exact or approximate median.
library-udf/src/main/java/org/apache/iotdb/library/dprofile/UDAFMedian.java