public List<org.apache.hadoop.hive.metastore.api.Partition> getPartitionsByNames(GetPartitionsByNamesRequest req,
      Table table)
        throws HiveException {
    try {
      if (AcidUtils.isTransactionalTable(table)) {
        ValidWriteIdList validWriteIdList = getValidWriteIdList(req.getDb_name(), req.getTbl_name());
        req.setValidWriteIdList(validWriteIdList != null ? validWriteIdList.toString() : null);
        req.setId(table.getTTable().getId());
      }
      return (getMSC().getPartitionsByNames(req)).getPartitions();
    } catch (Exception e) {
      LOG.error("Failed getPartitionsByNames", 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