@Override
      public int estimate() {
        JavaDataModel model = JavaDataModel.get();
        return histogram.lengthFor(model) +
            model.array() + JavaDataModel.PRIMITIVES2 * quantiles.length;
      }
Construct a histogram using the algorithm described by Ben-Haim and Tom-Tov, and then
use it to compute an approximate percentile value.
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFPercentileApprox.java