@Override
    public Object terminate(AggregationBuffer agg) throws HiveException {
      HypotheticalSetRankBuffer rankBuffer = (HypotheticalSetRankBuffer) agg;
      return new DoubleWritable((rankBuffer.rank + 1.0) / (rankBuffer.rowCount + 1.0));
    }
Evaluator for calculating the cumulative distribution.
SELECT cume_dist(expression) WITHIN GROUP (ORDER BY col1)
Implementation is based on hypothetical rank calculation: (rank + 1) / (count + 1)
Differences:
- rows which has equal column value with the specified expression value should be counted in the rank
- the return value type of this function is double.
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFCumeDist.java