@Override
    public void iterate(AggregationBuffer agg, Object[] parameters) throws HiveException {
      PercentileAgg percAgg = (PercentileAgg) agg;
      if (parameters.length == 4) {
        iterate(percAgg, parameters[0], parameters[1]);
      } else {
        iterate(percAgg, parameters[1], parameters[0]);
      }
    }
A state class to store intermediate aggregation results.
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFPercentileCont.java