@Override
  public void onResultCalculated(Object result, Range range) {
    if (previousSum != null) {
      previousSum.set((HiveDecimalWritable) result);
    } else {
      previousSum = new HiveDecimalWritable((HiveDecimalWritable) result);
    }
    this.previousRange = range;
  }
This class evaluates HiveDecimal sum() for a PTF group.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/ptf/VectorPTFEvaluatorDecimalSum.java