private List<Partition> getPartitionsByPartitionIdsInBatch(String catName, String dbName,
      String tblName, List<Long> partIdList, boolean isAcidTable, GetPartitionsArgs args)
      throws MetaException {
    if (partIdList.isEmpty()) {
      return Collections.emptyList(); // no partitions, bail early.
    }
    return Batchable.runBatched(batchSize, partIdList, new Batchable<Long, Partition>() {
      @Override
      public List<Partition> run(List<Long> input) throws MetaException {
        return getPartitionsByPartitionIds(catName, dbName, tblName, input, isAcidTable, args);
      }
    });
  }
Should be called with the list short enough to not trip up Oracle/etc.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java