public void alterPartition(String catName, String dbName, String tblName, Partition newPart,
                             EnvironmentContext environmentContext, boolean transactional)
      throws InvalidOperationException, HiveException {
    try {
      if (catName == null) {
        catName = getDefaultCatalog(conf);
      }
      validatePartition(newPart);
      String location = newPart.getLocation();
      if (location != null) {
        location = Utilities.getQualifiedPath(conf, new Path(location));
        newPart.setLocation(location);
      }
      if (environmentContext == null) {
        environmentContext = new EnvironmentContext();
      }
      AcidUtils.TableSnapshot tableSnapshot = null;
      if (transactional) {
        tableSnapshot = AcidUtils.getTableSnapshot(conf, newPart.getTable(), true);
        if (tableSnapshot != null) {
          newPart.getTPartition().setWriteId(tableSnapshot.getWriteId());
        } else {
          LOG.warn("Cannot get a table snapshot for " + tblName);
        }
      }
      getSynchronizedMSC().alter_partition(catName,
          dbName, tblName, newPart.getTPartition(), environmentContext,
          tableSnapshot == null ? null : tableSnapshot.getValidWriteIdList());

    } catch (MetaException e) {
      throw new HiveException("Unable to alter partition. " + e.getMessage(), e);
    } catch (TException e) {
      throw new HiveException("Unable to alter partition. " + e.getMessage(), e);
    }
  }
Updates the existing partition metadata with the new metadata.

@param dbName
         name of the exiting table's database
@param tblName
         name of the existing table
@param newPart
         new partition
@param environmentContext
         environment context for the method
@param transactional
         indicates this call is for transaction stats
@throws InvalidOperationException
          if the changes in metadata is not acceptable
@throws HiveException
ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java