private void addConsolidatedPartitionDesc(AlterTableAddPartitionDesc lastAlterTableAddPartitionDesc) throws Exception {
    int maxTasks = 0;
    //Load partitions equal to batch size at one go for metadata only and for external tables.
    if (isMetaDataOp() || TableType.EXTERNAL_TABLE.equals(table.getTableType())) {
      maxTasks = context.hiveConf.getIntVar(HiveConf.ConfVars.REPL_LOAD_PARTITIONS_BATCH_SIZE);
    } else {
      maxTasks = context.hiveConf.getIntVar(HiveConf.ConfVars.REPL_LOAD_PARTITIONS_WITH_DATA_COPY_BATCH_SIZE);
    }
    int currentPartitionCount = 0;
    Iterator<AlterTableAddPartitionDesc> partitionIterator = event.partitionDescriptions(tableDesc).iterator();
    //If already a set of partitions are processed as part of previous run, we skip those
    if (lastAlterTableAddPartitionDesc != null) {
      while (partitionIterator.hasNext()) {
        currentPartitionCount++;
        AlterTableAddPartitionDesc addPartitionDesc = partitionIterator.next();
        if (lastAlterTableAddPartitionDesc.getPartitions().get(0).getPartSpec()
          .equals(addPartitionDesc.getPartitions().get(0).getPartSpec())) {
          break;
        }
      }
    }
    List<AlterTableAddPartitionDesc> partitionDescs = event.partitionDescriptions(tableDesc);
    int totalPartitionCount = partitionDescs.size();
    while (currentPartitionCount < totalPartitionCount) {
      List<AlterTableAddPartitionDesc.PartitionDesc> partitions = new LinkedList<>();
      int pendingPartitionCount = totalPartitionCount - currentPartitionCount;
      int toPartitionCount = currentPartitionCount + Math.min(pendingPartitionCount, maxTasks);
      List<AlterTableAddPartitionDesc> partitionBatch = partitionDescs.subList(currentPartitionCount,
        toPartitionCount);
      for (AlterTableAddPartitionDesc addPartitionDesc : partitionBatch) {
        AlterTableAddPartitionDesc.PartitionDesc src = addPartitionDesc.getPartitions().get(0);
        Map<String, String> partParams = src.getPartParams();
        if (partParams == null) {
          partParams = new HashMap<>();
        }
        partParams.put(ReplConst.REPL_TARGET_DB_PROPERTY, context.dumpDirectory);
        Path replicaWarehousePartitionLocation = locationOnReplicaWarehouse(table, src);
        partitions.add(new AlterTableAddPartitionDesc.PartitionDesc(
          src.getPartSpec(), replicaWarehousePartitionLocation.toString(), partParams, src.getInputFormat(),
          src.getOutputFormat(), src.getNumBuckets(), src.getCols(), src.getSerializationLib(),
          src.getSerdeParams(), src.getBucketCols(), src.getSortCols(), src.getColStats(),
          src.getWriteId()));
      }
      AlterTableAddPartitionDesc consolidatedPartitionDesc = new AlterTableAddPartitionDesc(tableDesc.getDatabaseName(),
        tableDesc.getTableName(), true, partitions);

      //don't need to add ckpt task separately. Added as part of add partition task
      addPartition((toPartitionCount < totalPartitionCount), consolidatedPartitionDesc);
      if (!tracker.canAddMoreTasks()) {
        //No need to do processing as no more tasks can be added. Will be processed in next run. State is already
        //updated in add partition task
        return;
      }
      currentPartitionCount = toPartitionCount;
    }
  }
Get all partitions in a batch and consolidate them into single partition request.
Also, copy relevant stats and other information from original request.

@throws SemanticException
@param lastAlterTableAddPartitionDesc
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/bootstrap/load/table/LoadPartitions.java