@Override
    public Object terminate(AggregationBuffer agg) throws HiveException {
      HypotheticalSetRankBuffer rankBuffer = (HypotheticalSetRankBuffer) agg;
      return new DoubleWritable(((double)rankBuffer.rank) / rankBuffer.rowCount);
    }
Evaluator for calculating the percent rank.
SELECT percent_rank(expression1[, expressionn]*) WITHIN GROUP (ORDER BY col1[, coln]*)
Implementation is based on hypothetical rank calculation: rank - 1 / count
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFPercentRank.java