private static void verifyFractionType(ObjectInspector oi) throws UDFArgumentTypeException {
    PrimitiveCategory pc = ((PrimitiveObjectInspector)oi).getPrimitiveCategory();
    switch(pc) {
      case FLOAT:
      case DOUBLE:
      case DECIMAL:
        break;
      default:
        throw new UDFArgumentTypeException(1, "Only a floating point or decimal, or "
          + "floating point or decimal array argument is accepted as parameter 2, but "
          + pc + " was passed instead.");
    }
  }
Computes an approximate percentile (quantile) from an approximate histogram, for very
large numbers of rows where the regular percentile() UDAF might run out of memory.

The input is a single double value or an array of double values representing the quantiles
requested. The output, corresponding to the input, is either an single double value or an
array of doubles that are the quantile values.
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFPercentileApprox.java