public List<org.apache.hadoop.hive.metastore.api.Partition> getPartitionsByNames(String dbName, String tableName,
      List<String> partitionNames, Table t) throws HiveException {
    try {
      GetPartitionsByNamesRequest req = new GetPartitionsByNamesRequest();
      req.setDb_name(dbName);
      req.setTbl_name(tableName);
      req.setNames(partitionNames);
      return getPartitionsByNames(req, t);
    } 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