List<Partition> getPartitionsWithSpecsByNames(Table tbl, List<String> partNames, GetPartitionsRequest request)
      throws HiveException, TException {

    if (!tbl.isPartitioned()) {
      throw new HiveException(ErrorMsg.TABLE_NOT_PARTITIONED, tbl.getTableName());
    }
    List<Partition> partitions = new ArrayList<Partition>(partNames.size());

    int batchSize = HiveConf.getIntVar(conf, HiveConf.ConfVars.METASTORE_BATCH_RETRIEVE_MAX);
    // I do not want to modify the original request when implementing batching, hence we will know what actual request was being made
    GetPartitionsRequest req = request;
    if (!req.isSetFilterSpec()) {
      req.setFilterSpec(new GetPartitionsFilterSpec());
    }

    try {
      Batchable.runBatched(batchSize, partNames, new Batchable<String, Void>() {
        @Override
        public List<Void> run(List<String> list) throws Exception {
          req.getFilterSpec().setFilters(list);
          req.getFilterSpec().setFilterMode(PartitionFilterMode.BY_NAMES);
          List<Partition> tParts = getPartitionsWithSpecsInternal(tbl, req);
          if (tParts != null) {
            partitions.addAll(tParts);
          }
          return Collections.emptyList();
        }
      });
    } catch (Exception e) {
      throw new HiveException(e);
    }
    return partitions;
  }
Get a list of Partitions by filter.
@param tbl The table containing the partitions.
@param filter A string represent partition predicates.
@return a list of partitions satisfying the partition predicates.
@throws HiveException
@throws MetaException
@throws NoSuchObjectException
@throws TException
ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java