public void updatePrimaryIndexKeyOfResourceId(String resource, Object resourceId, Object newPrimaryIndexKey) throws HiveLockableException {
Preconditions.isWritable(directory.getKeySemamphoresOfPrimaryIndexKey(newPrimaryIndexKey), semaphore);
final Resource r = getResource(resource);
if (r.isPartitioningResource())
throw new HiveRuntimeException(String.format("Resource %s is a partitioning dimension, you cannot update its primary index key because it is the resource id", r.getName()));
directory.updatePrimaryIndexKeyOfResourceId(r, resourceId, newPrimaryIndexKey);
}