protected KllHistogramEstimator mergeHistograms(List<ColStatsObjWithSourceInfo> colStatsWithSourceInfo) {
    // invariant: no two elements of this list are merge-compatible
    final List<KllHistogramEstimator> mergedHistogramEstimators = new ArrayList<>();
    final BitSet mergedStats = new BitSet(colStatsWithSourceInfo.size());
    int currIndex = 0;

    while (mergedStats.cardinality() != colStatsWithSourceInfo.size()) {
      currIndex = mergedStats.nextClearBit(currIndex);
      final ColumnStatisticsObj currColStatsObj = colStatsWithSourceInfo.get(currIndex).getColStatsObj();
      final KllHistogramEstimator statsEstimator = getHistogramFromStats(currColStatsObj);
      if (statsEstimator == null) {
        mergedStats.set(currIndex); // so we can move past it
        continue;
      }
      final KllHistogramEstimator currHistogram = KllHistogramEstimatorFactory.getEmptyHistogramEstimator(statsEstimator);
      // we need to create a new estimator to not alter the one from the stats object via merging
      currHistogram.mergeEstimators(statsEstimator);

      // check if the histogram can be merged an existing element in the final list
      for (KllHistogramEstimator candidateHistogram : mergedHistogramEstimators) {
        if (candidateHistogram.canMerge(currHistogram)) {
          candidateHistogram.mergeEstimators(currHistogram);
          mergedStats.set(currIndex);
          break;
        }
      }

      // if it has not been merged, then store it in the final list
      if (!mergedStats.get(currIndex)) {
        mergedHistogramEstimators.add(currHistogram);
        mergedStats.set(currIndex);
      }
    }

    // find the histogram with largest N
    long biggestN = -1;
    KllHistogramEstimator largestHistogramEstimator = null;
    for (KllHistogramEstimator hist : mergedHistogramEstimators) {
      if (hist.getSketch().getN() > biggestN) {
        biggestN = hist.getSketch().getN();
        largestHistogramEstimator = hist;
      }
    }

    // set the histogram with largest N
    return largestHistogramEstimator;
  }
The tuner controls the derivation of the NDV value when aggregating statistics from multiple partitions. It accepts
values in the range [0, 1] pushing the aggregated NDV closer to the lower, or upper bound respectively.
<p>
For example, consider the aggregation of three partitions with NDV values 2, 3, and 4, respectively. The NDV
lower bound is 4 (the highest among individual NDVs), and the upper bound is 9 (the sum of individual NDVs). In
this case the aggregated NDV will be in the range [4, 9] touching the bounds when the tuner is equal to 0, or 1
respectively.
</p>
<p>
It is optional and concrete implementations can choose to ignore it completely.
</p>
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/columnstats/aggr/ColumnStatsAggregator.java