static byte[] extractSqlBlob(Object value) throws MetaException {
    if (value == null)
      return null;
    if (value instanceof Blob) {
      //derby, oracle
      try {
        // getBytes function says: pos the ordinal position of the first byte in
        // the BLOB value to be extracted; the first byte is at position 1
        return ((Blob) value).getBytes(1, (int) ((Blob) value).length());
      } catch (SQLException e) {
        throw new MetaException("Encounter error while processing blob.");
      }
    }
    else if (value instanceof byte[]) {
      // mysql, postgres, sql server
      return (byte[]) value;
    }
	else {
      // org.apache.hadoop.hive.metastore.MetaStoreDirectSql.getStatsList(enableBitVector,enableKll)
      // We get here when enableBitvector or enableKll is false
      return null;
    }
  }
Convert a boolean value returned from the RDBMS to a Java Boolean object.
MySQL has booleans, but e.g. Derby uses 'Y'/'N' mapping and Oracle DB
doesn't supports boolean, so we have used Number to store the value,
which maps to BigDecimal.

@param value
         column value from the database
@return The Boolean value of the database column value, null if the column
        value is null
@throws MetaException
          if the column value cannot be converted into a Boolean object
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetastoreDirectSqlUtils.java