public void alterPartitions(String dbName, String tableName,
      List<org.apache.hadoop.hive.metastore.api.Partition> partitions, EnvironmentContext ec, String validWriteIdList,
      long writeId) throws HiveException {
    try {
      getMSC().alter_partitions(dbName, tableName, partitions, ec, validWriteIdList, writeId);
    } catch (Exception e) {
      LOG.error("Failed alterPartitions", e);
      throw new HiveException(e);
    }
  }
Creates a partition.

@param tbl
         table for which partition needs to be created
@param partSpec
         partition keys and their values
@return created partition object
@throws HiveException
          if table doesn't exist or partition already exists
ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java