// fully-specified partition
List<String> currentParts = client.listPartitionNames(outputInfo.getDatabaseName(),
outputInfo.getTableName(), partitionValues, (short) 1);
if (currentParts.size() > 0) {
throw new HCatException(ErrorType.ERROR_DUPLICATE_PARTITION);
}
}
} else {
List<String> partitionValues = getPartitionValueList(
table, outputInfo.getPartitionValues());
// non-partitioned table
Path tablePath = new Path(table.getTTable().getSd().getLocation());
FileSystem fs = tablePath.getFileSystem(context.getConfiguration());
if (fs.exists(tablePath)) {
FileStatus[] status = fs.globStatus(new Path(tablePath, "*"), hiddenFileFilter);
if (status.length > 0) {
throw new HCatException(ErrorType.ERROR_NON_EMPTY_TABLE,
table.getDbName() + "." + table.getTableName());
}
}
}
}