private Partition alterPartitionNoTxn(String catName, String dbname,
      String name, MPartition oldp, Partition newPart,
      String validWriteIds,
      Ref<MColumnDescriptor> oldCd, MTable table)
      throws InvalidObjectException, MetaException {
    catName = normalizeIdentifier(catName);
    name = normalizeIdentifier(name);
    dbname = normalizeIdentifier(dbname);
    MPartition newp = convertToMPart(newPart, table);
    MColumnDescriptor oldCD = null;
    MStorageDescriptor oldSD = oldp.getSd();
    if (oldSD != null) {
      oldCD = oldSD.getCD();
    }
    if (newp == null) {
      throw new InvalidObjectException("partition does not exist.");
    }
    oldp.setValues(newp.getValues());
    oldp.setPartitionName(newp.getPartitionName());
    boolean isTxn = TxnUtils.isTransactionalTable(table.getParameters());
    if (isTxn && areTxnStatsSupported) {
      // Transactional table is altered without a txn. Make sure there are no changes to the flag.
      String errorMsg = verifyStatsChangeCtx(TableName.getDbTable(dbname, name),
              oldp.getParameters(),
              newPart.getParameters(), newPart.getWriteId(), validWriteIds, false);
      if (errorMsg != null) {
        throw new MetaException(errorMsg);
      }
    }
    oldp.setParameters(newPart.getParameters());
    if (!TableType.VIRTUAL_VIEW.name().equals(oldp.getTable().getTableType())) {
      copyMSD(newp.getSd(), oldp.getSd());
    }
    if (newp.getCreateTime() != oldp.getCreateTime()) {
      oldp.setCreateTime(newp.getCreateTime());
    }
    if (newp.getLastAccessTime() != oldp.getLastAccessTime()) {
      oldp.setLastAccessTime(newp.getLastAccessTime());
    }

    // If transactional, add/update the MUPdaterTransaction
    // for the current updater query.
    if (isTxn) {
      if (!areTxnStatsSupported) {
        StatsSetupConst.setBasicStatsState(oldp.getParameters(), StatsSetupConst.FALSE);
      } else if (validWriteIds != null && newPart.getWriteId() > 0) {
        // Check concurrent INSERT case and set false to the flag.
        if (!isCurrentStatsValidForTheQuery(oldp, validWriteIds, true)) {
          StatsSetupConst.setBasicStatsState(oldp.getParameters(), StatsSetupConst.FALSE);
          LOG.info("Removed COLUMN_STATS_ACCURATE from the parameters of the partition " +
                  dbname + "." + name + "." + oldp.getPartitionName() + " will be made persistent.");
        }
        oldp.setWriteId(newPart.getWriteId());
      }
    }

    oldCd.t = oldCD;
    return convertToPart(catName, dbname, name, oldp, TxnUtils.isAcidTable(table.getParameters()));
  }
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