@Override
    public Partition next() {

        if (iterator.hasNext())
          return iterator.next();

        while (++index < partitionSpecProxies.size()
            && !(iterator = partitionSpecProxies.get(index).getPartitionIterator()).hasNext());

        return index == partitionSpecProxies.size()? null : iterator.next();

    }
Iterator to iterate over all Partitions, across all PartitionSpecProxy instances within the Composite.
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/partition/spec/CompositePartitionSpecProxy.java