private PartitionSpec getSharedSDPartSpec(Table table, StorageDescriptorKey sdKey, List<PartitionWithoutSD> partitions) {
StorageDescriptor sd = new StorageDescriptor(sdKey.getSd());
sd.setLocation(table.getSd().getLocation()); // Use table-dir as root-dir.
PartitionSpecWithSharedSD sharedSDPartSpec =
new PartitionSpecWithSharedSD(partitions, sd);
PartitionSpec ret = new PartitionSpec();
ret.setRootPath(sd.getLocation());
ret.setSharedSDPartitionSpec(sharedSDPartSpec);
ret.setDbName(table.getDbName());