@Override
  public Partition alterPartition(String catName, String dbname, String name, List<String> part_vals,
      Partition newPart, String validWriteIds) throws InvalidObjectException, MetaException {
    boolean success = false;
    Throwable e = null;
    Partition result = null;
    try {
      openTransaction();
      Ref<MColumnDescriptor> oldCd = new Ref<>();
      result = alterPartitionNoTxn(catName, dbname, name, part_vals, newPart, validWriteIds, oldCd);
      removeUnusedColumnDescriptor(oldCd.t);
      // commit the changes
      success = commitTransaction();
    } catch (Throwable exception) {
      LOG.error("alterPartition failed", exception);
      e = exception;
    } finally {
      if (!success) {
        rollbackTransaction();
        MetaException metaException = new MetaException(
            "The transaction for alter partition did not commit successfully.");
        if (e != null) {
          metaException.initCause(e);
        }
        throw metaException;
      }
    }
    return result;
  }
Alters an existing partition. Initiates copy of SD. Returns the old CD.
@param part_vals Partition values (of the original partition instance)
@param newPart Partition object containing new information
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java