public boolean merge(State other) {
      if (other == null || other.counts == null || other.percentiles == null) {
        return true;
      }

      if (state.percentiles == null) {
        state.percentiles = new ArrayList<>(other.percentiles);
      }

      for (Map.Entry<LongWritable, LongWritable> e: other.counts.entrySet()) {
        increment(state, e.getKey(), e.getValue().get());
      }
      return true;
    }
The evaluator for percentile computation based on long for an array of percentiles.
ql/src/java/org/apache/hadoop/hive/ql/udf/UDAFPercentile.java