use of com.facebook.presto.hive.metastore.PrestoTableType in project presto by prestodb.
the class HiveWriteUtils method checkTableIsWritable.
public static void checkTableIsWritable(Table table, boolean writesToNonManagedTablesEnabled) {
PrestoTableType tableType = table.getTableType();
if (!writesToNonManagedTablesEnabled && !tableType.equals(MANAGED_TABLE) && !tableType.equals(MATERIALIZED_VIEW) && !tableType.equals(TEMPORARY_TABLE)) {
throw new PrestoException(NOT_SUPPORTED, "Cannot write to non-managed Hive table");
}
checkWritable(table.getSchemaTableName(), Optional.empty(), getProtectMode(table), table.getParameters(), table.getStorage());
}
Aggregations