@Override
    public Object terminatePartial(AggregationBuffer agg) throws HiveException {
      if (isWindowingDistinct()) {
        throw new HiveException("Distinct windowing UDAF doesn't support merge and terminatePartial");
      } else {
        return terminate(agg);
      }
    }
The base type for sum operator evaluator
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFSum.java