private List<SQLCheckConstraint> addCheckConstraints(List<SQLCheckConstraint> ccs, boolean retrieveCD)
      throws InvalidObjectException, MetaException {
    List<MConstraint> cstrs = new ArrayList<>();

    for (SQLCheckConstraint cc: ccs) {
      final String catName = normalizeIdentifier(cc.getCatName());
      final String tableDB = normalizeIdentifier(cc.getTable_db());
      final String tableName = normalizeIdentifier(cc.getTable_name());
      final String columnName = cc.getColumn_name() == null? null
          : normalizeIdentifier(cc.getColumn_name());
      final String ccName = cc.getDc_name();
      boolean isEnable = cc.isEnable_cstr();
      boolean isValidate = cc.isValidate_cstr();
      boolean isRely = cc.isRely_cstr();
      String constraintValue = cc.getCheck_expression();
      MConstraint muk = addConstraint(catName, tableDB, tableName, columnName, ccName, isEnable, isRely, isValidate,
                    MConstraint.CHECK_CONSTRAINT, constraintValue, retrieveCD);
      cstrs.add(muk);

      // Add normalized identifier back to result
      cc.setCatName(catName);
      cc.setTable_db(tableDB);
      cc.setTable_name(tableName);
      cc.setColumn_name(columnName);
      cc.setDc_name(muk.getConstraintName());
    }
    pm.makePersistentAll(cstrs);
    return ccs;
  }
Called right before an action that would drop a storage descriptor.
This function makes the SD's reference to a CD null, and then deletes the CD
if it no longer is referenced in the table.
@param msd the storage descriptor to drop
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java