@Override
    public Partition getCurrent() {
      PartitionWithoutSD partWithoutSD = pSpec.getPartitions().get(index);
      StorageDescriptor partSD = new StorageDescriptor(pSpec.getSd());
      partSD.setLocation(partSD.getLocation() + partWithoutSD.getRelativePath());

      Partition p = new Partition(
          partWithoutSD.getValues(),
          partitionSpecWithSharedSDProxy.partitionSpec.getDbName(),
          partitionSpecWithSharedSDProxy.partitionSpec.getTableName(),
          partWithoutSD.getCreateTime(),
          partWithoutSD.getLastAccessTime(),
          partSD,
          partWithoutSD.getParameters()
      );
      p.setCatName(partitionSpecWithSharedSDProxy.partitionSpec.getCatName());
      return p;
    }
Iterator implementation to iterate over all Partitions within the PartitionSpecWithSharedSDProxy.
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/partition/spec/PartitionSpecWithSharedSDProxy.java