public static byte[] getHistogram(byte[] bytes) {
    // workaround for DN bug in persisting nulls in pg bytea column
    // instead set empty bit vector with header.
    // https://issues.apache.org/jira/browse/HIVE-17836
    if (bytes != null && bytes.length == 0) {
      return null;
    }
    return bytes;
  }
This class contains conversion logic that creates Thrift stat objects from
JDO stat objects and plain arrays from DirectSQL.
It is hidden here so that we wouldn't have to look at it in elsewhere.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/StatObjectConverter.java