@Override
    public boolean hasNext() {

      if (iterator == null) {
        return false;
      }

      if (iterator.hasNext()) {
        return true;
      }

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

      return index < partitionSpecProxies.size() && iterator.hasNext();

    }
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