Search in sources :

Example 6 with PrestoTableType

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());
}
Also used : PrestoTableType(com.facebook.presto.hive.metastore.PrestoTableType) PrestoException(com.facebook.presto.spi.PrestoException)

Aggregations

PrestoTableType (com.facebook.presto.hive.metastore.PrestoTableType)6 Table (com.facebook.presto.hive.metastore.Table)5 DwrfTableEncryptionProperties.forTable (com.facebook.presto.hive.DwrfTableEncryptionProperties.forTable)3 PrestoException (com.facebook.presto.spi.PrestoException)3 MoreFutures.toCompletableFuture (com.facebook.airlift.concurrent.MoreFutures.toCompletableFuture)2 JsonCodec (com.facebook.airlift.json.JsonCodec)2 JsonCodec.jsonCodec (com.facebook.airlift.json.JsonCodec.jsonCodec)2 SmileCodec (com.facebook.airlift.json.smile.SmileCodec)2 Subfield (com.facebook.presto.common.Subfield)2 Block (com.facebook.presto.common.block.Block)2 Domain (com.facebook.presto.common.predicate.Domain)2 NullableValue (com.facebook.presto.common.predicate.NullableValue)2 TupleDomain (com.facebook.presto.common.predicate.TupleDomain)2 TupleDomain.withColumnDomains (com.facebook.presto.common.predicate.TupleDomain.withColumnDomains)2 ArrayType (com.facebook.presto.common.type.ArrayType)2 BIGINT (com.facebook.presto.common.type.BigintType.BIGINT)2 BOOLEAN (com.facebook.presto.common.type.BooleanType.BOOLEAN)2 Chars.isCharType (com.facebook.presto.common.type.Chars.isCharType)2 DATE (com.facebook.presto.common.type.DateType.DATE)2 MapType (com.facebook.presto.common.type.MapType)2