static String shouldTableBeExternal(Table tableObj, String ownerName, Configuration conf,
IMetaStoreClient hms, Boolean isPathOwnedByHive)
throws IOException, MetaException, TException {
if (MetaStoreUtils.isNonNativeTable(tableObj)) {
return "Table is a non-native (StorageHandler) table";
}
if (HiveStrictManagedUtils.isAvroTableWithExternalSchema(tableObj)) {
return "Table is an Avro table with an external schema url";
}
if (HiveStrictManagedUtils.isListBucketedTable(tableObj)) {
return "Table is a list bucketed table";
}
if (isPathOwnedByHive != null) {
return isPathOwnedByHive ? null :
String.format("One or more table directories is not owned by hive or non-HDFS path at source cluster");
} else if (shouldTablePathBeExternal(tableObj, ownerName, conf, hms)) {
return String.format("One or more table directories not owned by %s, or non-HDFS path", ownerName);
}
return null;
}