public static ColumnStatsMerger<?> getColumnStatsMerger(final ColumnStatisticsObj statsObjNew,
      final ColumnStatisticsObj statsObjOld) {
    Objects.requireNonNull(statsObjNew, "Column 1 statistics cannot be null");
    Objects.requireNonNull(statsObjOld, "Column 2 statistics cannot be null");

    final _Fields typeNew = statsObjNew.getStatsData().getSetField();
    final _Fields typeOld = statsObjOld.getStatsData().getSetField();

    Preconditions.checkArgument(typeNew == typeOld, "The column types must match: [" + typeNew + "::" + typeOld + "]");

    switch (typeNew) {
    case BOOLEAN_STATS:
      return new BooleanColumnStatsMerger();
    case LONG_STATS:
      return new LongColumnStatsMerger();
    case DOUBLE_STATS:
      return new DoubleColumnStatsMerger();
    case STRING_STATS:
      return new StringColumnStatsMerger();
    case BINARY_STATS:
      return new BinaryColumnStatsMerger();
    case DECIMAL_STATS:
      return new DecimalColumnStatsMerger();
    case DATE_STATS:
      return new DateColumnStatsMerger();
    case TIMESTAMP_STATS:
      return new TimestampColumnStatsMerger();
    default:
      throw new IllegalArgumentException("Unknown stats type: " + statsObjNew.getStatsData().getSetField());
    }
  }
Get a statistics merger to merge the given statistics object.

@param statsObjNew A statistics object to merger
@param statsObjOld A statistics object to merger
@return A ColumnStatsMerger object that can process the requested type
@throws IllegalArgumentException if the column statistics objects are of
          two different types or if they are of an unknown type
@throws NullPointerException if statistics object is {@code null}
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/columnstats/merge/ColumnStatsMergerFactory.java