private Set<MColumnDescriptor> detachCdsFromSdsNoTxn(
      String catName, String dbName, String tblName, List<String> partNames) {
    Pair<Query, Map<String, String>> queryWithParams =
        getPartQueryWithParams(catName, dbName, tblName, partNames);
    try (QueryWrapper query = new QueryWrapper(queryWithParams.getLeft())) {
      query.setClass(MPartition.class);
      query.setResult("sd");
      List<MStorageDescriptor> sds = (List<MStorageDescriptor>) query.executeWithMap(
          queryWithParams.getRight());
      HashSet<MColumnDescriptor> candidateCds = new HashSet<>();
      for (MStorageDescriptor sd : sds) {
        if (sd != null && sd.getCD() != null) {
          candidateCds.add(sd.getCD());
          sd.setCD(null);
        }
      }
      return candidateCds;
    }
  }
Detaches column descriptors from storage descriptors; returns the set of unique CDs
thus detached. This is done before dropping partitions because CDs are reused between
SDs; so, we remove the links to delete SDs and then check the returned CDs to see if
they are referenced by other SDs.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java