private void noPartitionsCopyData(Configuration conf, OutputInfo outputInfo)
throws IOException
{
Preconditions.checkArgument(!outputInfo.hasPartitionInfo());
Path tablePath = new Path(outputInfo.getTableRoot());
Path writePath = new Path(outputInfo.getPartitionPath());
FileSystem tableFs = tablePath.getFileSystem(conf);
FileSystem writePathFs = writePath.getFileSystem(conf);
if (!tableFs.getUri().equals(writePathFs.getUri())) {
LOG.error("Table's root path fs {} is not on same as its partition path fs {}",
tableFs.getUri(), writePathFs.getUri());
throw new IllegalStateException("Table's root path fs " + tableFs.getUri() +
" is not on same as its partition path fs " + writePathFs.getUri());
}
LOG.info("No partitions, copying data from {} to {}", writePath, tablePath);
FileSystems.move(tableFs, writePath, writePath, tablePath);
tableFs.delete(writePath, true);
}