public static ColumnStatisticsObj newColumnStaticsObj(final String colName, final String colType,
      final _Fields type) {
    final ColumnStatisticsObj cso = new ColumnStatisticsObj();
    final ColumnStatisticsData csd = new ColumnStatisticsData();

    Objects.requireNonNull(colName, "Column name cannot be null");
    Objects.requireNonNull(colType, "Column type cannot be null");
    Objects.requireNonNull(type, "Field type cannot be null");

    switch (type) {
    case BOOLEAN_STATS:
      csd.setBooleanStats(new BooleanColumnStatsData());
      break;

    case LONG_STATS:
      csd.setLongStats(new LongColumnStatsDataInspector());
      break;

    case DOUBLE_STATS:
      csd.setDoubleStats(new DoubleColumnStatsDataInspector());
      break;

    case STRING_STATS:
      csd.setStringStats(new StringColumnStatsDataInspector());
      break;

    case BINARY_STATS:
      csd.setBinaryStats(new BinaryColumnStatsData());
      break;

    case DECIMAL_STATS:
      csd.setDecimalStats(new DecimalColumnStatsDataInspector());
      break;

    case DATE_STATS:
      csd.setDateStats(new DateColumnStatsDataInspector());
      break;

    case TIMESTAMP_STATS:
      csd.setTimestampStats(new TimestampColumnStatsDataInspector());
      break;

    default:
      throw new IllegalArgumentException("Unknown stats type: " + type);
    }

    cso.setColName(colName);
    cso.setColType(colType);
    cso.setStatsData(csd);

    return cso;
  }
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