public String checkHistogram(ColumnStatisticsData cd) {
    byte[] buffer = null;

    if (cd.isSetDateStats() && cd.getDateStats().isSetHistogram()) {
      buffer = cd.getDateStats().getHistogram();
    } else if (cd.isSetDoubleStats() && cd.getDoubleStats().isSetHistogram()) {
      buffer = cd.getDoubleStats().getHistogram();
    } else if (cd.isSetDecimalStats() && cd.getDecimalStats().isSetHistogram()) {
      buffer = cd.getDecimalStats().getHistogram();
    } else if (cd.isSetLongStats() && cd.getLongStats().isSetHistogram()) {
      buffer = cd.getLongStats().getHistogram();
    } else if (cd.isSetTimestampStats() && cd.getTimestampStats().isSetHistogram()) {
      buffer = cd.getTimestampStats().getHistogram();
    }

    return encodeBytes(buffer);
  }
Checks whether the column statistics data stores histogram statistics, and returns its base64 encoding if so.
@param cd the column statistics data
@return the base64 encoding of the histogram statistics if existing, null otherwise.
ql/src/java/org/apache/hadoop/hive/ql/exec/DDLPlanUtils.java