@Override
      public boolean hasNext() {
        return iterator.hasNext() || (current != null && current.hasNext());
      }
The partitions might have different write ids, groups the partitions by write id first,
then iterate each group, for each iteration, there is a maximum number(e.g, the batchSize)
of the partitions returned.
@param partitions partitions in this alter event
@param batchSize the maximum number of partitions returned in each iteration
@return iterator of partitions in bulk
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/events/AlterPartitionsEvent.java