private List<SQLDefaultConstraint> addDefaultConstraints(List<SQLDefaultConstraint> dcs, boolean retrieveCD)
      throws InvalidObjectException, MetaException {

    List<MConstraint> cstrs = new ArrayList<>();
    for (SQLDefaultConstraint dc : dcs) {
      final String catName = normalizeIdentifier(dc.getCatName());
      final String tableDB = normalizeIdentifier(dc.getTable_db());
      final String tableName = normalizeIdentifier(dc.getTable_name());
      final String columnName = normalizeIdentifier(dc.getColumn_name());
      final String dcName = dc.getDc_name();
      boolean isEnable = dc.isEnable_cstr();
      boolean isValidate = dc.isValidate_cstr();
      boolean isRely = dc.isRely_cstr();
      String constraintValue = dc.getDefault_value();
      MConstraint muk = addConstraint(catName, tableDB, tableName, columnName, dcName, isEnable, isRely, isValidate,
      MConstraint.DEFAULT_CONSTRAINT, constraintValue, retrieveCD);
      cstrs.add(muk);

      // Add normalized identifier back to result
      dc.setCatName(catName);
      dc.setTable_db(tableDB);
      dc.setTable_name(tableName);
      dc.setColumn_name(columnName);
      dc.setDc_name(muk.getConstraintName());
    }
    pm.makePersistentAll(cstrs);
    return dcs;
  }
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